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
53a563bb
Commit
53a563bb
authored
Jun 15, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Exhaustively test the invalid parameter handling of SetupDecompressOrCopyFileA.
parent
813024d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
9 deletions
+35
-9
misc.c
dlls/setupapi/tests/misc.c
+35
-9
No files found.
dlls/setupapi/tests/misc.c
View file @
53a563bb
...
...
@@ -506,6 +506,22 @@ static void test_SetupDecompressOrCopyFile(void)
DWORD
ret
;
char
source
[
MAX_PATH
],
target
[
MAX_PATH
],
temp
[
MAX_PATH
],
*
p
;
UINT
type
;
int
i
;
const
struct
{
PCSTR
source
;
PCSTR
target
;
PUINT
type
;
}
invalid_parameters
[]
=
{
{
NULL
,
NULL
,
NULL
},
{
NULL
,
NULL
,
&
type
},
{
NULL
,
target
,
NULL
},
{
NULL
,
target
,
&
type
},
{
source
,
NULL
,
NULL
},
{
source
,
NULL
,
&
type
},
};
GetTempPathA
(
sizeof
(
temp
),
temp
);
GetTempFileNameA
(
temp
,
"doc"
,
0
,
source
);
...
...
@@ -515,15 +531,25 @@ static void test_SetupDecompressOrCopyFile(void)
create_source_file
(
source
,
uncompressed
,
sizeof
(
uncompressed
));
ret
=
SetupDecompressOrCopyFileA
(
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupDecompressOrCopyFile failed unexpectedly
\n
"
);
type
=
FILE_COMPRESSION_NONE
;
ret
=
SetupDecompressOrCopyFileA
(
NULL
,
target
,
&
type
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupDecompressOrCopyFile failed unexpectedly
\n
"
);
ret
=
SetupDecompressOrCopyFileA
(
source
,
NULL
,
&
type
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupDecompressOrCopyFile failed unexpectedly
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
invalid_parameters
)
/
sizeof
(
invalid_parameters
[
0
]);
i
++
)
{
type
=
FILE_COMPRESSION_NONE
;
ret
=
SetupDecompressOrCopyFileA
(
invalid_parameters
[
i
].
source
,
invalid_parameters
[
i
].
target
,
invalid_parameters
[
i
].
type
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
i
,
ret
);
/* try an invalid compression type */
type
=
5
;
ret
=
SetupDecompressOrCopyFileA
(
invalid_parameters
[
i
].
source
,
invalid_parameters
[
i
].
target
,
invalid_parameters
[
i
].
type
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
i
,
ret
);
}
type
=
5
;
/* try an invalid compression type */
ret
=
SetupDecompressOrCopyFileA
(
source
,
target
,
&
type
);
...
...
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