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
8e302e15
Commit
8e302e15
authored
Oct 09, 2006
by
Michael Ploujnikov
Committed by
Alexandre Julliard
Oct 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Win64 printf format warning fixes.
parent
55121688
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
36 deletions
+35
-36
Makefile.in
dlls/setupapi/tests/Makefile.in
+0
-1
devinst.c
dlls/setupapi/tests/devinst.c
+7
-7
parser.c
dlls/setupapi/tests/parser.c
+16
-16
query.c
dlls/setupapi/tests/query.c
+6
-6
stringtable.c
dlls/setupapi/tests/stringtable.c
+6
-6
No files found.
dlls/setupapi/tests/Makefile.in
View file @
8e302e15
...
@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
...
@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
setupapi.dll
TESTDLL
=
setupapi.dll
IMPORTS
=
setupapi advapi32 kernel32
IMPORTS
=
setupapi advapi32 kernel32
EXTRADEFS
=
-DWINE_NO_LONG_AS_INT
CTESTS
=
\
CTESTS
=
\
devinst.c
\
devinst.c
\
...
...
dlls/setupapi/tests/devinst.c
View file @
8e302e15
...
@@ -62,24 +62,24 @@ static void test_SetupDiCreateDeviceInfoListEx(void)
...
@@ -62,24 +62,24 @@ static void test_SetupDiCreateDeviceInfoListEx(void)
devlist
=
pSetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
notnull
);
devlist
=
pSetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
notnull
);
error
=
GetLastError
();
error
=
GetLastError
();
ok
(
devlist
==
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %
l
d (expected %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
ok
(
devlist
==
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %d (expected %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"GetLastError returned wrong value : %
l
d, (expected %d)
\n
"
,
error
,
ERROR_INVALID_PARAMETER
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"GetLastError returned wrong value : %d, (expected %d)
\n
"
,
error
,
ERROR_INVALID_PARAMETER
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
/* create empty DeviceInfoList, but set MachineName to something */
/* create empty DeviceInfoList, but set MachineName to something */
devlist
=
pSetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
machine
,
NULL
);
devlist
=
pSetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
machine
,
NULL
);
error
=
GetLastError
();
error
=
GetLastError
();
ok
(
devlist
==
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %
l
d (expected %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
ok
(
devlist
==
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %d (expected %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
ok
(
error
==
ERROR_INVALID_MACHINENAME
,
"GetLastError returned wrong value : %
l
d, (expected %d)
\n
"
,
error
,
ERROR_INVALID_MACHINENAME
);
ok
(
error
==
ERROR_INVALID_MACHINENAME
,
"GetLastError returned wrong value : %d, (expected %d)
\n
"
,
error
,
ERROR_INVALID_MACHINENAME
);
/* create empty DeviceInfoList */
/* create empty DeviceInfoList */
devlist
=
pSetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
NULL
);
devlist
=
pSetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
devlist
&&
devlist
!=
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %
l
d (expected != %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
ok
(
devlist
&&
devlist
!=
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %d (expected != %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
/* destroy DeviceInfoList */
/* destroy DeviceInfoList */
ret
=
pSetupDiDestroyDeviceInfoList
(
devlist
);
ret
=
pSetupDiDestroyDeviceInfoList
(
devlist
);
ok
(
ret
,
"SetupDiDestroyDeviceInfoList failed : %
l
d
\n
"
,
error
);
ok
(
ret
,
"SetupDiDestroyDeviceInfoList failed : %d
\n
"
,
error
);
}
}
static
void
test_SetupDiOpenClassRegKeyExA
(
void
)
static
void
test_SetupDiOpenClassRegKeyExA
(
void
)
...
@@ -108,7 +108,7 @@ static void test_SetupDiOpenClassRegKeyExA(void)
...
@@ -108,7 +108,7 @@ static void test_SetupDiOpenClassRegKeyExA(void)
classKey
=
pSetupDiOpenClassRegKeyExA
(
&
guid
,
KEY_ALL_ACCESS
,
classKey
=
pSetupDiOpenClassRegKeyExA
(
&
guid
,
KEY_ALL_ACCESS
,
DIOCR_INSTALLER
,
NULL
,
NULL
);
DIOCR_INSTALLER
,
NULL
,
NULL
);
ok
(
classKey
!=
INVALID_HANDLE_VALUE
,
ok
(
classKey
!=
INVALID_HANDLE_VALUE
,
"opening class registry key failed with error %
l
d
\n
"
,
"opening class registry key failed with error %d
\n
"
,
GetLastError
());
GetLastError
());
if
(
classKey
!=
INVALID_HANDLE_VALUE
)
if
(
classKey
!=
INVALID_HANDLE_VALUE
)
RegCloseKey
(
classKey
);
RegCloseKey
(
classKey
);
...
...
dlls/setupapi/tests/parser.c
View file @
8e302e15
...
@@ -143,20 +143,20 @@ static void test_invalid_files(void)
...
@@ -143,20 +143,20 @@ static void test_invalid_files(void)
err_line
=
0xdeadbeef
;
err_line
=
0xdeadbeef
;
hinf
=
test_file_contents
(
invalid_files
[
i
].
data
,
&
err_line
);
hinf
=
test_file_contents
(
invalid_files
[
i
].
data
,
&
err_line
);
err
=
GetLastError
();
err
=
GetLastError
();
trace
(
"hinf=%p err=%
l
x line=%d
\n
"
,
hinf
,
err
,
err_line
);
trace
(
"hinf=%p err=%x line=%d
\n
"
,
hinf
,
err
,
err_line
);
if
(
invalid_files
[
i
].
error
)
/* should fail */
if
(
invalid_files
[
i
].
error
)
/* should fail */
{
{
ok
(
hinf
==
INVALID_HANDLE_VALUE
,
"file %u: Open succeeded
\n
"
,
i
);
ok
(
hinf
==
INVALID_HANDLE_VALUE
,
"file %u: Open succeeded
\n
"
,
i
);
if
(
invalid_files
[
i
].
todo
)
todo_wine
if
(
invalid_files
[
i
].
todo
)
todo_wine
{
{
ok
(
err
==
invalid_files
[
i
].
error
,
"file %u: Bad error %
lx/%l
x
\n
"
,
ok
(
err
==
invalid_files
[
i
].
error
,
"file %u: Bad error %
x/%
x
\n
"
,
i
,
err
,
invalid_files
[
i
].
error
);
i
,
err
,
invalid_files
[
i
].
error
);
ok
(
err_line
==
invalid_files
[
i
].
err_line
,
"file %u: Bad error line %d/%d
\n
"
,
ok
(
err_line
==
invalid_files
[
i
].
err_line
,
"file %u: Bad error line %d/%d
\n
"
,
i
,
err_line
,
invalid_files
[
i
].
err_line
);
i
,
err_line
,
invalid_files
[
i
].
err_line
);
}
}
else
else
{
{
ok
(
err
==
invalid_files
[
i
].
error
,
"file %u: Bad error %
lx/%l
x
\n
"
,
ok
(
err
==
invalid_files
[
i
].
error
,
"file %u: Bad error %
x/%
x
\n
"
,
i
,
err
,
invalid_files
[
i
].
error
);
i
,
err
,
invalid_files
[
i
].
error
);
ok
(
err_line
==
invalid_files
[
i
].
err_line
,
"file %u: Bad error line %d/%d
\n
"
,
ok
(
err_line
==
invalid_files
[
i
].
err_line
,
"file %u: Bad error line %d/%d
\n
"
,
i
,
err_line
,
invalid_files
[
i
].
err_line
);
i
,
err_line
,
invalid_files
[
i
].
err_line
);
...
@@ -165,7 +165,7 @@ static void test_invalid_files(void)
...
@@ -165,7 +165,7 @@ static void test_invalid_files(void)
else
/* should succeed */
else
/* should succeed */
{
{
ok
(
hinf
!=
INVALID_HANDLE_VALUE
,
"file %u: Open failed
\n
"
,
i
);
ok
(
hinf
!=
INVALID_HANDLE_VALUE
,
"file %u: Open failed
\n
"
,
i
);
ok
(
err
==
0
,
"file %u: Error code set to %
l
x
\n
"
,
i
,
err
);
ok
(
err
==
0
,
"file %u: Error code set to %x
\n
"
,
i
,
err
);
}
}
if
(
hinf
!=
INVALID_HANDLE_VALUE
)
SetupCloseInfFile
(
hinf
);
if
(
hinf
!=
INVALID_HANDLE_VALUE
)
SetupCloseInfFile
(
hinf
);
}
}
...
@@ -223,23 +223,23 @@ static void test_section_names(void)
...
@@ -223,23 +223,23 @@ static void test_section_names(void)
{
{
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hinf
=
test_file_contents
(
section_names
[
i
].
data
,
&
err_line
);
hinf
=
test_file_contents
(
section_names
[
i
].
data
,
&
err_line
);
ok
(
hinf
!=
INVALID_HANDLE_VALUE
,
"line %u: open failed err %
l
x
\n
"
,
i
,
GetLastError
()
);
ok
(
hinf
!=
INVALID_HANDLE_VALUE
,
"line %u: open failed err %x
\n
"
,
i
,
GetLastError
()
);
if
(
hinf
==
INVALID_HANDLE_VALUE
)
continue
;
if
(
hinf
==
INVALID_HANDLE_VALUE
)
continue
;
ret
=
SetupGetLineCountA
(
hinf
,
section_names
[
i
].
section
);
ret
=
SetupGetLineCountA
(
hinf
,
section_names
[
i
].
section
);
err
=
GetLastError
();
err
=
GetLastError
();
trace
(
"hinf=%p ret=%
ld err=%l
x
\n
"
,
hinf
,
ret
,
err
);
trace
(
"hinf=%p ret=%
d err=%
x
\n
"
,
hinf
,
ret
,
err
);
if
(
ret
!=
-
1
)
if
(
ret
!=
-
1
)
{
{
ok
(
!
section_names
[
i
].
error
,
"line %u: section name %s found
\n
"
,
ok
(
!
section_names
[
i
].
error
,
"line %u: section name %s found
\n
"
,
i
,
section_names
[
i
].
section
);
i
,
section_names
[
i
].
section
);
ok
(
!
err
,
"line %u: bad error code %
l
x
\n
"
,
i
,
err
);
ok
(
!
err
,
"line %u: bad error code %x
\n
"
,
i
,
err
);
}
}
else
else
{
{
ok
(
section_names
[
i
].
error
,
"line %u: section name %s not found
\n
"
,
ok
(
section_names
[
i
].
error
,
"line %u: section name %s not found
\n
"
,
i
,
section_names
[
i
].
section
);
i
,
section_names
[
i
].
section
);
ok
(
err
==
section_names
[
i
].
error
,
"line %u: bad error %
lx/%l
x
\n
"
,
ok
(
err
==
section_names
[
i
].
error
,
"line %u: bad error %
x/%
x
\n
"
,
i
,
err
,
section_names
[
i
].
error
);
i
,
err
,
section_names
[
i
].
error
);
}
}
SetupCloseInfFile
(
hinf
);
SetupCloseInfFile
(
hinf
);
...
@@ -328,12 +328,12 @@ static const char *check_key( INFCONTEXT *context, const char *wanted )
...
@@ -328,12 +328,12 @@ static const char *check_key( INFCONTEXT *context, const char *wanted )
if
(
!
key
)
if
(
!
key
)
{
{
ok
(
!
wanted
,
"missing key %s
\n
"
,
wanted
);
ok
(
!
wanted
,
"missing key %s
\n
"
,
wanted
);
ok
(
err
==
0
||
err
==
ERROR_INVALID_PARAMETER
,
"last error set to %
l
x
\n
"
,
err
);
ok
(
err
==
0
||
err
==
ERROR_INVALID_PARAMETER
,
"last error set to %x
\n
"
,
err
);
}
}
else
else
{
{
ok
(
!
strcmp
(
key
,
wanted
),
"bad key %s/%s
\n
"
,
key
,
wanted
);
ok
(
!
strcmp
(
key
,
wanted
),
"bad key %s/%s
\n
"
,
key
,
wanted
);
ok
(
err
==
0
,
"last error set to %
l
x
\n
"
,
err
);
ok
(
err
==
0
,
"last error set to %x
\n
"
,
err
);
}
}
return
key
;
return
key
;
}
}
...
@@ -355,7 +355,7 @@ static void test_key_names(void)
...
@@ -355,7 +355,7 @@ static void test_key_names(void)
strcat
(
buffer
,
key_names
[
i
].
data
);
strcat
(
buffer
,
key_names
[
i
].
data
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hinf
=
test_file_contents
(
buffer
,
&
err_line
);
hinf
=
test_file_contents
(
buffer
,
&
err_line
);
ok
(
hinf
!=
INVALID_HANDLE_VALUE
,
"line %u: open failed err %
l
x
\n
"
,
i
,
GetLastError
()
);
ok
(
hinf
!=
INVALID_HANDLE_VALUE
,
"line %u: open failed err %x
\n
"
,
i
,
GetLastError
()
);
if
(
hinf
==
INVALID_HANDLE_VALUE
)
continue
;
if
(
hinf
==
INVALID_HANDLE_VALUE
)
continue
;
ret
=
SetupFindFirstLineA
(
hinf
,
"Test"
,
0
,
&
context
);
ret
=
SetupFindFirstLineA
(
hinf
,
"Test"
,
0
,
&
context
);
...
@@ -370,7 +370,7 @@ static void test_key_names(void)
...
@@ -370,7 +370,7 @@ static void test_key_names(void)
err
=
GetLastError
();
err
=
GetLastError
();
if
(
field
)
if
(
field
)
{
{
ok
(
err
==
0
,
"line %u: bad error %
l
x
\n
"
,
i
,
GetLastError
()
);
ok
(
err
==
0
,
"line %u: bad error %x
\n
"
,
i
,
GetLastError
()
);
if
(
key_names
[
i
].
fields
[
index
])
if
(
key_names
[
i
].
fields
[
index
])
ok
(
!
strcmp
(
field
,
key_names
[
i
].
fields
[
index
]
),
"line %u: bad field %s/%s
\n
"
,
ok
(
!
strcmp
(
field
,
key_names
[
i
].
fields
[
index
]
),
"line %u: bad field %s/%s
\n
"
,
i
,
field
,
key_names
[
i
].
fields
[
index
]
);
i
,
field
,
key_names
[
i
].
fields
[
index
]
);
...
@@ -382,7 +382,7 @@ static void test_key_names(void)
...
@@ -382,7 +382,7 @@ static void test_key_names(void)
else
else
{
{
ok
(
err
==
0
||
err
==
ERROR_INVALID_PARAMETER
,
ok
(
err
==
0
||
err
==
ERROR_INVALID_PARAMETER
,
"line %u: bad error %
l
x
\n
"
,
i
,
GetLastError
()
);
"line %u: bad error %x
\n
"
,
i
,
GetLastError
()
);
if
(
key_names
[
i
].
fields
[
index
])
if
(
key_names
[
i
].
fields
[
index
])
ok
(
0
,
"line %u: missing field %s
\n
"
,
i
,
key_names
[
i
].
fields
[
index
]
);
ok
(
0
,
"line %u: missing field %s
\n
"
,
i
,
key_names
[
i
].
fields
[
index
]
);
}
}
...
@@ -404,7 +404,7 @@ static void test_close_inf_file(void)
...
@@ -404,7 +404,7 @@ static void test_close_inf_file(void)
{
{
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
SetupCloseInfFile
(
NULL
);
SetupCloseInfFile
(
NULL
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %
l
d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
}
}
static
const
char
*
contents
=
"[Version]
\n
"
static
const
char
*
contents
=
"[Version]
\n
"
...
@@ -448,7 +448,7 @@ static void test_pSetupGetField(void)
...
@@ -448,7 +448,7 @@ static void test_pSetupGetField(void)
ret
=
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
field
);
ret
=
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
field
);
ok
(
!
ret
,
"Expected HeapFree to fail
\n
"
);
ok
(
!
ret
,
"Expected HeapFree to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %
l
d
\n
"
,
GetLastError
()
);
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
()
);
}
}
field
=
pSetupGetField
(
&
context
,
3
);
field
=
pSetupGetField
(
&
context
,
3
);
...
@@ -458,7 +458,7 @@ static void test_pSetupGetField(void)
...
@@ -458,7 +458,7 @@ static void test_pSetupGetField(void)
field
=
pSetupGetField
(
&
context
,
4
);
field
=
pSetupGetField
(
&
context
,
4
);
ok
(
field
==
NULL
,
"Expected NULL, got %p
\n
"
,
field
);
ok
(
field
==
NULL
,
"Expected NULL, got %p
\n
"
,
field
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %
l
d
\n
"
,
GetLastError
()
);
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
()
);
SetupCloseInfFile
(
hinf
);
SetupCloseInfFile
(
hinf
);
}
}
...
...
dlls/setupapi/tests/query.c
View file @
8e302e15
...
@@ -139,7 +139,7 @@ static void test_SetupGetInfInformation(void)
...
@@ -139,7 +139,7 @@ static void test_SetupGetInfInformation(void)
ret
=
pSetupGetInfInformationA
(
NULL
,
INFINFO_INF_SPEC_IS_HINF
,
NULL
,
0
,
&
size
);
ret
=
pSetupGetInfInformationA
(
NULL
,
INFINFO_INF_SPEC_IS_HINF
,
NULL
,
0
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %
l
d
\n
"
,
GetLastError
());
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
/* try an invalid inf filename */
/* try an invalid inf filename */
...
@@ -148,7 +148,7 @@ static void test_SetupGetInfInformation(void)
...
@@ -148,7 +148,7 @@ static void test_SetupGetInfInformation(void)
ret
=
pSetupGetInfInformationA
(
NULL
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ret
=
pSetupGetInfInformationA
(
NULL
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %
l
d
\n
"
,
GetLastError
());
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
create_inf_file
(
inf_filename
);
create_inf_file
(
inf_filename
);
...
@@ -159,7 +159,7 @@ static void test_SetupGetInfInformation(void)
...
@@ -159,7 +159,7 @@ static void test_SetupGetInfInformation(void)
ret
=
pSetupGetInfInformationA
(
inf_filename
,
-
1
,
NULL
,
0
,
&
size
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
-
1
,
NULL
,
0
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %
l
d
\n
"
,
GetLastError
());
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
/* try a nonexistent inf file */
/* try a nonexistent inf file */
...
@@ -168,7 +168,7 @@ static void test_SetupGetInfInformation(void)
...
@@ -168,7 +168,7 @@ static void test_SetupGetInfInformation(void)
ret
=
pSetupGetInfInformationA
(
"idontexist"
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ret
=
pSetupGetInfInformationA
(
"idontexist"
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %
l
d
\n
"
,
GetLastError
());
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
/* successfully open the inf file */
/* successfully open the inf file */
...
@@ -182,7 +182,7 @@ static void test_SetupGetInfInformation(void)
...
@@ -182,7 +182,7 @@ static void test_SetupGetInfInformation(void)
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
size
,
&
size
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
size
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %
l
d
\n
"
,
GetLastError
());
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* set ReturnBuffer to NULL and ReturnBufferSize to non-zero value 'size-1' */
/* set ReturnBuffer to NULL and ReturnBufferSize to non-zero value 'size-1' */
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
size
-
1
,
&
size
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
size
-
1
,
&
size
);
...
@@ -203,7 +203,7 @@ static void test_SetupGetInfInformation(void)
...
@@ -203,7 +203,7 @@ static void test_SetupGetInfInformation(void)
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
info
,
size
-
1
,
&
size
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
info
,
size
-
1
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %
l
d
\n
"
,
GetLastError
());
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
/* successfully get the inf information */
/* successfully get the inf information */
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
info
,
size
,
&
size
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
info
,
size
,
&
size
);
...
...
dlls/setupapi/tests/stringtable.c
View file @
8e302e15
...
@@ -99,15 +99,15 @@ static void test_StringTableAddString(void)
...
@@ -99,15 +99,15 @@ static void test_StringTableAddString(void)
retval
=
pStringTableAddString
(
table
,
String
,
0
);
retval
=
pStringTableAddString
(
table
,
String
,
0
);
ok
(
retval
!=-
1
,
"Failed to add String to String Table
\n
"
);
ok
(
retval
!=-
1
,
"Failed to add String to String Table
\n
"
);
ok
(
hstring
==
retval
,
"string handle %
lx != String handle %l
x in String Table
\n
"
,
hstring
,
retval
);
ok
(
hstring
==
retval
,
"string handle %
x != String handle %
x in String Table
\n
"
,
hstring
,
retval
);
hfoo
=
pStringTableAddString
(
table
,
foo
,
0
);
hfoo
=
pStringTableAddString
(
table
,
foo
,
0
);
ok
(
hfoo
!=-
1
,
"Failed to add foo to String Table
\n
"
);
ok
(
hfoo
!=-
1
,
"Failed to add foo to String Table
\n
"
);
ok
(
hfoo
!=
hstring
,
"foo and string share the same ID %
l
x in String Table
\n
"
,
hfoo
);
ok
(
hfoo
!=
hstring
,
"foo and string share the same ID %x in String Table
\n
"
,
hfoo
);
/* case sensitive */
/* case sensitive */
hString
=
pStringTableAddString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
hString
=
pStringTableAddString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
ok
(
hstring
!=
hString
,
"String handle and string share same ID %
l
x in Table
\n
"
,
hstring
);
ok
(
hstring
!=
hString
,
"String handle and string share same ID %x in Table
\n
"
,
hstring
);
}
}
static
void
test_StringTableDuplicate
(
void
)
static
void
test_StringTableDuplicate
(
void
)
...
@@ -124,7 +124,7 @@ static void test_StringTableLookUpString(void)
...
@@ -124,7 +124,7 @@ static void test_StringTableLookUpString(void)
retval
=
pStringTableLookUpString
(
table
,
string
,
0
);
retval
=
pStringTableLookUpString
(
table
,
string
,
0
);
ok
(
retval
!=-
1
,
"Failed find string in String Table 1
\n
"
);
ok
(
retval
!=-
1
,
"Failed find string in String Table 1
\n
"
);
ok
(
retval
==
hstring
,
ok
(
retval
==
hstring
,
"Lookup for string (%
lx) does not match previous handle (%l
x) in String Table 1
\n
"
,
"Lookup for string (%
x) does not match previous handle (%
x) in String Table 1
\n
"
,
retval
,
hstring
);
retval
,
hstring
);
retval
=
pStringTableLookUpString
(
table2
,
string
,
0
);
retval
=
pStringTableLookUpString
(
table2
,
string
,
0
);
...
@@ -139,7 +139,7 @@ static void test_StringTableLookUpString(void)
...
@@ -139,7 +139,7 @@ static void test_StringTableLookUpString(void)
retval
=
pStringTableLookUpString
(
table
,
foo
,
0
);
retval
=
pStringTableLookUpString
(
table
,
foo
,
0
);
ok
(
retval
!=-
1
,
"Failed find foo in String Table 1
\n
"
);
ok
(
retval
!=-
1
,
"Failed find foo in String Table 1
\n
"
);
ok
(
retval
==
hfoo
,
ok
(
retval
==
hfoo
,
"Lookup for foo (%
lx) does not match previous handle (%l
x) in String Table 1
\n
"
,
"Lookup for foo (%
x) does not match previous handle (%
x) in String Table 1
\n
"
,
retval
,
hfoo
);
retval
,
hfoo
);
retval
=
pStringTableLookUpString
(
table2
,
foo
,
0
);
retval
=
pStringTableLookUpString
(
table2
,
foo
,
0
);
...
@@ -150,7 +150,7 @@ static void test_StringTableLookUpString(void)
...
@@ -150,7 +150,7 @@ static void test_StringTableLookUpString(void)
retval2
=
pStringTableLookUpString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
retval2
=
pStringTableLookUpString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
ok
(
retval
!=
retval2
,
"Lookup of string equals String in Table 1
\n
"
);
ok
(
retval
!=
retval2
,
"Lookup of string equals String in Table 1
\n
"
);
ok
(
retval2
==
hString
,
ok
(
retval2
==
hString
,
"Lookup for String (%
lx) does not match previous handle (%l
x) in String Table 1
\n
"
,
"Lookup for String (%
x) does not match previous handle (%
x) in String Table 1
\n
"
,
retval
,
hString
);
retval
,
hString
);
}
}
...
...
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