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
9273a671
Commit
9273a671
authored
Oct 15, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32/tests: Compile with -D__WINESRC__.
parent
ba7f633f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
31 deletions
+29
-31
Makefile.in
dlls/avifil32/tests/Makefile.in
+0
-1
api.c
dlls/avifil32/tests/api.c
+29
-30
No files found.
dlls/avifil32/tests/Makefile.in
View file @
9273a671
TESTDLL
=
avifil32.dll
TESTDLL
=
avifil32.dll
IMPORTS
=
avifil32 ole32
IMPORTS
=
avifil32 ole32
EXTRADEFS
=
-U__WINESRC__
-DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS
C_SRCS
=
\
C_SRCS
=
\
api.c
api.c
...
...
dlls/avifil32/tests/api.c
View file @
9273a671
...
@@ -226,38 +226,38 @@ static void test_EditStreamSetInfo(void)
...
@@ -226,38 +226,38 @@ static void test_EditStreamSetInfo(void)
{
{
PAVISTREAM
stream
=
NULL
;
PAVISTREAM
stream
=
NULL
;
HRESULT
hres
;
HRESULT
hres
;
AVISTREAMINFO
info
,
info2
;
AVISTREAMINFO
A
info
,
info2
;
hres
=
CreateEditableStream
(
&
stream
,
NULL
);
hres
=
CreateEditableStream
(
&
stream
,
NULL
);
ok
(
hres
==
AVIERR_OK
,
"got 0x%08X, expected AVIERR_OK
\n
"
,
hres
);
ok
(
hres
==
AVIERR_OK
,
"got 0x%08X, expected AVIERR_OK
\n
"
,
hres
);
/* Size parameter is somehow checked (notice the crash with size=-1 below) */
/* Size parameter is somehow checked (notice the crash with size=-1 below) */
hres
=
EditStreamSetInfo
(
stream
,
NULL
,
0
);
hres
=
EditStreamSetInfo
A
(
stream
,
NULL
,
0
);
ok
(
hres
==
AVIERR_BADSIZE
,
"got 0x%08X, expected AVIERR_BADSIZE
\n
"
,
hres
);
ok
(
hres
==
AVIERR_BADSIZE
,
"got 0x%08X, expected AVIERR_BADSIZE
\n
"
,
hres
);
hres
=
EditStreamSetInfo
(
stream
,
NULL
,
sizeof
(
AVISTREAMINFO
)
-
1
);
hres
=
EditStreamSetInfo
A
(
stream
,
NULL
,
sizeof
(
AVISTREAMINFOA
)
-
1
);
ok
(
hres
==
AVIERR_BADSIZE
,
"got 0x%08X, expected AVIERR_BADSIZE
\n
"
,
hres
);
ok
(
hres
==
AVIERR_BADSIZE
,
"got 0x%08X, expected AVIERR_BADSIZE
\n
"
,
hres
);
if
(
0
)
if
(
0
)
{
{
/* Crashing - first parameter not checked */
/* Crashing - first parameter not checked */
EditStreamSetInfo
(
NULL
,
&
info
,
sizeof
(
AVISTREAMINFO
)
);
EditStreamSetInfo
A
(
NULL
,
&
info
,
sizeof
(
info
)
);
/* Crashing - second parameter not checked */
/* Crashing - second parameter not checked */
EditStreamSetInfo
(
stream
,
NULL
,
sizeof
(
AVISTREAMINFO
)
);
EditStreamSetInfo
A
(
stream
,
NULL
,
sizeof
(
AVISTREAMINFOA
)
);
EditStreamSetInfo
(
stream
,
NULL
,
-
1
);
EditStreamSetInfo
A
(
stream
,
NULL
,
-
1
);
}
}
hres
=
AVIStreamInfo
(
stream
,
&
info
,
sizeof
(
AVISTREAMINFO
)
);
hres
=
AVIStreamInfo
A
(
stream
,
&
info
,
sizeof
(
info
)
);
ok
(
hres
==
0
,
"got 0x%08X, expected 0
\n
"
,
hres
);
ok
(
hres
==
0
,
"got 0x%08X, expected 0
\n
"
,
hres
);
/* Does the function check what's it's updating ? */
/* Does the function check what's it's updating ? */
#define IS_INFO_UPDATED(m) do { \
#define IS_INFO_UPDATED(m) do { \
hres = EditStreamSetInfo
(stream, &info, sizeof(AVISTREAMINFO
) ); \
hres = EditStreamSetInfo
A(stream, &info, sizeof(info
) ); \
ok( hres == 0, "got 0x%08X, expected 0\n", hres); \
ok( hres == 0, "got 0x%08X, expected 0\n", hres); \
hres = AVIStreamInfo
(stream, &info2, sizeof(AVISTREAMINFO
) ); \
hres = AVIStreamInfo
A(stream, &info2, sizeof(info2
) ); \
ok( hres == 0, "got 0x%08X, expected 0\n", hres); \
ok( hres == 0, "got 0x%08X, expected 0\n", hres); \
ok( info2.m == info.m, "EditStreamSetInfo did not update "#m" parameter\n" ); \
ok( info2.m == info.m, "EditStreamSetInfo did not update "#m" parameter\n" ); \
} while(0)
} while(0)
...
@@ -332,7 +332,7 @@ static void create_avi_file(const COMMON_AVI_HEADERS *cah, char *filename)
...
@@ -332,7 +332,7 @@ static void create_avi_file(const COMMON_AVI_HEADERS *cah, char *filename)
HANDLE
hFile
;
HANDLE
hFile
;
DWORD
written
;
DWORD
written
;
hFile
=
CreateFile
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
hFile
=
CreateFile
A
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
hFile
!=
INVALID_HANDLE_VALUE
,
"Couldn't create file
\n
"
);
ok
(
hFile
!=
INVALID_HANDLE_VALUE
,
"Couldn't create file
\n
"
);
...
@@ -360,17 +360,16 @@ static void test_default_data(void)
...
@@ -360,17 +360,16 @@ static void test_default_data(void)
LONG
lSize
;
LONG
lSize
;
PAVISTREAM
pStream0
;
PAVISTREAM
pStream0
;
PAVISTREAM
pStream1
;
PAVISTREAM
pStream1
;
AVISTREAMINFO
asi0
;
AVISTREAMINFOA
asi0
,
asi1
;
AVISTREAMINFO
asi1
;
WAVEFORMATEX
wfx
;
WAVEFORMATEX
wfx
;
GetTempPath
(
MAX_PATH
,
filename
);
GetTempPath
A
(
MAX_PATH
,
filename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
init_test_struct
(
&
cah
);
init_test_struct
(
&
cah
);
create_avi_file
(
&
cah
,
filename
);
create_avi_file
(
&
cah
,
filename
);
res
=
AVIFileOpen
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
res
=
AVIFileOpen
A
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
ok
(
res
!=
AVIERR_BADFORMAT
,
"Unable to open file: error1=%u
\n
"
,
AVIERR_BADFORMAT
);
ok
(
res
!=
AVIERR_BADFORMAT
,
"Unable to open file: error1=%u
\n
"
,
AVIERR_BADFORMAT
);
ok
(
res
!=
AVIERR_MEMORY
,
"Unable to open file: error2=%u
\n
"
,
AVIERR_MEMORY
);
ok
(
res
!=
AVIERR_MEMORY
,
"Unable to open file: error2=%u
\n
"
,
AVIERR_MEMORY
);
ok
(
res
!=
AVIERR_FILEREAD
,
"Unable to open file: error3=%u
\n
"
,
AVIERR_FILEREAD
);
ok
(
res
!=
AVIERR_FILEREAD
,
"Unable to open file: error3=%u
\n
"
,
AVIERR_FILEREAD
);
...
@@ -384,10 +383,10 @@ static void test_default_data(void)
...
@@ -384,10 +383,10 @@ static void test_default_data(void)
res
=
AVIFileGetStream
(
pFile
,
&
pStream1
,
0
,
1
);
res
=
AVIFileGetStream
(
pFile
,
&
pStream1
,
0
,
1
);
ok
(
res
==
0
,
"Unable to open audio stream: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to open audio stream: error=%u
\n
"
,
res
);
res
=
AVIStreamInfo
(
pStream0
,
&
asi0
,
sizeof
(
AVISTREAMINFO
));
res
=
AVIStreamInfo
A
(
pStream0
,
&
asi0
,
sizeof
(
asi0
));
ok
(
res
==
0
,
"Unable to read stream info: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to read stream info: error=%u
\n
"
,
res
);
res
=
AVIStreamInfo
(
pStream1
,
&
asi1
,
sizeof
(
AVISTREAMINFO
));
res
=
AVIStreamInfo
A
(
pStream1
,
&
asi1
,
sizeof
(
asi1
));
ok
(
res
==
0
,
"Unable to read stream info: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to read stream info: error=%u
\n
"
,
res
);
res
=
AVIStreamReadFormat
(
pStream0
,
AVIStreamStart
(
pStream1
),
NULL
,
&
lSize
);
res
=
AVIStreamReadFormat
(
pStream0
,
AVIStreamStart
(
pStream1
),
NULL
,
&
lSize
);
...
@@ -446,7 +445,7 @@ static void test_default_data(void)
...
@@ -446,7 +445,7 @@ static void test_default_data(void)
AVIStreamRelease
(
pStream0
);
AVIStreamRelease
(
pStream0
);
AVIStreamRelease
(
pStream1
);
AVIStreamRelease
(
pStream1
);
AVIFileRelease
(
pFile
);
AVIFileRelease
(
pFile
);
ok
(
DeleteFile
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
ok
(
DeleteFile
A
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
}
}
static
void
test_amh_corruption
(
void
)
static
void
test_amh_corruption
(
void
)
...
@@ -456,7 +455,7 @@ static void test_amh_corruption(void)
...
@@ -456,7 +455,7 @@ static void test_amh_corruption(void)
PAVIFILE
pFile
;
PAVIFILE
pFile
;
int
res
;
int
res
;
GetTempPath
(
MAX_PATH
,
filename
);
GetTempPath
A
(
MAX_PATH
,
filename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
/* Make sure only AVI files with the proper headers will be loaded */
/* Make sure only AVI files with the proper headers will be loaded */
...
@@ -464,10 +463,10 @@ static void test_amh_corruption(void)
...
@@ -464,10 +463,10 @@ static void test_amh_corruption(void)
cah
.
fh
[
3
]
=
mmioFOURCC
(
'A'
,
'V'
,
'i'
,
' '
);
cah
.
fh
[
3
]
=
mmioFOURCC
(
'A'
,
'V'
,
'i'
,
' '
);
create_avi_file
(
&
cah
,
filename
);
create_avi_file
(
&
cah
,
filename
);
res
=
AVIFileOpen
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
res
=
AVIFileOpen
A
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
ok
(
res
!=
0
,
"Able to open file: error=%u
\n
"
,
res
);
ok
(
res
!=
0
,
"Able to open file: error=%u
\n
"
,
res
);
ok
(
DeleteFile
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
ok
(
DeleteFile
A
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
}
}
static
void
test_ash1_corruption
(
void
)
static
void
test_ash1_corruption
(
void
)
...
@@ -477,9 +476,9 @@ static void test_ash1_corruption(void)
...
@@ -477,9 +476,9 @@ static void test_ash1_corruption(void)
PAVIFILE
pFile
;
PAVIFILE
pFile
;
int
res
;
int
res
;
PAVISTREAM
pStream1
;
PAVISTREAM
pStream1
;
AVISTREAMINFO
asi1
;
AVISTREAMINFO
A
asi1
;
GetTempPath
(
MAX_PATH
,
filename
);
GetTempPath
A
(
MAX_PATH
,
filename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
/* Corrupt the sample size in the audio stream header */
/* Corrupt the sample size in the audio stream header */
...
@@ -488,13 +487,13 @@ static void test_ash1_corruption(void)
...
@@ -488,13 +487,13 @@ static void test_ash1_corruption(void)
create_avi_file
(
&
cah
,
filename
);
create_avi_file
(
&
cah
,
filename
);
res
=
AVIFileOpen
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
res
=
AVIFileOpen
A
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
ok
(
res
==
0
,
"Unable to open file: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to open file: error=%u
\n
"
,
res
);
res
=
AVIFileGetStream
(
pFile
,
&
pStream1
,
0
,
1
);
res
=
AVIFileGetStream
(
pFile
,
&
pStream1
,
0
,
1
);
ok
(
res
==
0
,
"Unable to open audio stream: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to open audio stream: error=%u
\n
"
,
res
);
res
=
AVIStreamInfo
(
pStream1
,
&
asi1
,
sizeof
(
AVISTREAMINFO
));
res
=
AVIStreamInfo
A
(
pStream1
,
&
asi1
,
sizeof
(
asi1
));
ok
(
res
==
0
,
"Unable to read stream info: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to read stream info: error=%u
\n
"
,
res
);
/* The result will still be 2, because the value is dynamically replaced with the nBlockAlign
/* The result will still be 2, because the value is dynamically replaced with the nBlockAlign
...
@@ -503,7 +502,7 @@ static void test_ash1_corruption(void)
...
@@ -503,7 +502,7 @@ static void test_ash1_corruption(void)
AVIStreamRelease
(
pStream1
);
AVIStreamRelease
(
pStream1
);
AVIFileRelease
(
pFile
);
AVIFileRelease
(
pFile
);
ok
(
DeleteFile
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
ok
(
DeleteFile
A
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
}
}
static
void
test_ash1_corruption2
(
void
)
static
void
test_ash1_corruption2
(
void
)
...
@@ -513,9 +512,9 @@ static void test_ash1_corruption2(void)
...
@@ -513,9 +512,9 @@ static void test_ash1_corruption2(void)
PAVIFILE
pFile
;
PAVIFILE
pFile
;
int
res
;
int
res
;
PAVISTREAM
pStream1
;
PAVISTREAM
pStream1
;
AVISTREAMINFO
asi1
;
AVISTREAMINFO
A
asi1
;
GetTempPath
(
MAX_PATH
,
filename
);
GetTempPath
A
(
MAX_PATH
,
filename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
strcpy
(
filename
+
strlen
(
filename
),
testfilename
);
/* Corrupt the block alignment in the audio format header */
/* Corrupt the block alignment in the audio format header */
...
@@ -524,20 +523,20 @@ static void test_ash1_corruption2(void)
...
@@ -524,20 +523,20 @@ static void test_ash1_corruption2(void)
create_avi_file
(
&
cah
,
filename
);
create_avi_file
(
&
cah
,
filename
);
res
=
AVIFileOpen
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
res
=
AVIFileOpen
A
(
&
pFile
,
filename
,
OF_SHARE_DENY_WRITE
,
0L
);
ok
(
res
==
0
,
"Unable to open file: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to open file: error=%u
\n
"
,
res
);
res
=
AVIFileGetStream
(
pFile
,
&
pStream1
,
0
,
1
);
res
=
AVIFileGetStream
(
pFile
,
&
pStream1
,
0
,
1
);
ok
(
res
==
0
,
"Unable to open audio stream: error=%u
\n
"
,
res
);
ok
(
res
==
0
,
"Unable to open audio stream: error=%u
\n
"
,
res
);
ok
(
AVIStreamInfo
(
pStream1
,
&
asi1
,
sizeof
(
AVISTREAMINFO
))
==
0
,
"Unable to read stream info
\n
"
);
ok
(
AVIStreamInfo
A
(
pStream1
,
&
asi1
,
sizeof
(
asi1
))
==
0
,
"Unable to read stream info
\n
"
);
/* The result will also be the corrupt value, as explained above. */
/* The result will also be the corrupt value, as explained above. */
ok
(
asi1
.
dwSampleSize
==
0xdead
,
"got 0x%x (expected 0xdead)
\n
"
,
asi1
.
dwSampleSize
);
ok
(
asi1
.
dwSampleSize
==
0xdead
,
"got 0x%x (expected 0xdead)
\n
"
,
asi1
.
dwSampleSize
);
AVIStreamRelease
(
pStream1
);
AVIStreamRelease
(
pStream1
);
AVIFileRelease
(
pFile
);
AVIFileRelease
(
pFile
);
ok
(
DeleteFile
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
ok
(
DeleteFile
A
(
filename
)
!=
0
,
"Deleting file %s failed
\n
"
,
filename
);
}
}
/* Outer IUnknown for COM aggregation tests */
/* Outer IUnknown for COM aggregation tests */
...
...
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