Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
999bc5bc
Commit
999bc5bc
authored
Apr 04, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Apr 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit/tests: Add test framework and test for IMediaDet_put_Filename.
parent
8b432b36
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
1 deletion
+91
-1
Makefile.in
dlls/qedit/tests/Makefile.in
+3
-1
mediadet.c
dlls/qedit/tests/mediadet.c
+66
-0
qedit.rc
dlls/qedit/tests/qedit.rc
+22
-0
test.avi
dlls/qedit/tests/test.avi
+0
-0
No files found.
dlls/qedit/tests/Makefile.in
View file @
999bc5bc
...
...
@@ -3,12 +3,14 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
qedit.dll
IMPORTS
=
ole32 kernel32
IMPORTS
=
ole
aut32 ole
32 kernel32
EXTRALIBS
=
-lstrmiids
-luuid
CTESTS
=
\
mediadet.c
RC_SRCS
=
qedit.rc
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/qedit/tests/mediadet.c
View file @
999bc5bc
...
...
@@ -25,22 +25,88 @@
#include "wine/test.h"
#include "qedit.h"
static
WCHAR
test_avi_filename
[
MAX_PATH
];
static
BOOL
init_tests
(
void
)
{
static
WCHAR
temp_path
[
MAX_PATH
];
static
WCHAR
prefix
[]
=
{
'D'
,
'E'
,
'S'
,
0
};
static
WCHAR
avi
[]
=
{
'a'
,
'v'
,
'i'
,
0
};
HRSRC
res
;
HGLOBAL
data
;
char
*
mem
;
DWORD
size
,
written
;
HANDLE
fh
;
res
=
FindResourceW
(
NULL
,
(
LPWSTR
)
1
,
(
LPWSTR
)
256
);
if
(
!
res
)
return
FALSE
;
data
=
LoadResource
(
NULL
,
res
);
if
(
!
data
)
return
FALSE
;
mem
=
LockResource
(
data
);
if
(
!
mem
)
return
FALSE
;
size
=
SizeofResource
(
NULL
,
res
);
if
(
size
==
0
)
return
FALSE
;
if
(
!
GetTempPathW
(
sizeof
temp_path
,
temp_path
))
return
FALSE
;
/* We might end up relying on the extension here, so .TMP is no good. */
if
(
!
GetTempFileNameW
(
temp_path
,
prefix
,
0
,
test_avi_filename
))
return
FALSE
;
DeleteFileW
(
test_avi_filename
);
lstrcpyW
(
test_avi_filename
+
lstrlenW
(
test_avi_filename
)
-
3
,
avi
);
fh
=
CreateFileW
(
test_avi_filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
fh
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
if
(
!
WriteFile
(
fh
,
mem
,
size
,
&
written
,
NULL
)
||
written
!=
size
)
return
FALSE
;
CloseHandle
(
fh
);
return
TRUE
;
}
static
void
test_mediadet
(
void
)
{
HRESULT
hr
;
IMediaDet
*
pM
=
NULL
;
BSTR
filename
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_MediaDet
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMediaDet
,
(
LPVOID
*
)
&
pM
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with %x
\n
"
,
hr
);
ok
(
pM
!=
NULL
,
"pM is NULL
\n
"
);
filename
=
SysAllocString
(
test_avi_filename
);
hr
=
IMediaDet_put_Filename
(
pM
,
filename
);
todo_wine
ok
(
hr
==
S_OK
,
"IMediaDet_put_Filename -> %x
\n
"
,
hr
);
SysFreeString
(
filename
);
hr
=
IMediaDet_Release
(
pM
);
ok
(
hr
==
0
,
"IMediaDet_Release returned: %x
\n
"
,
hr
);
DeleteFileW
(
test_avi_filename
);
}
START_TEST
(
mediadet
)
{
if
(
!
init_tests
())
{
skip
(
"Couldn't initialize tests!
\n
"
);
return
;
}
CoInitialize
(
NULL
);
test_mediadet
();
CoUninitialize
();
...
...
dlls/qedit/tests/qedit.rc
0 → 100644
View file @
999bc5bc
/*
* Resource file for qedit tests.
*
* Copyright 2008 Google (Dan Hipschman)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @makedep: test.avi */
1 256 test.avi
dlls/qedit/tests/test.avi
0 → 100644
View file @
999bc5bc
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment