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
c7cb92f1
Commit
c7cb92f1
authored
Dec 29, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Dec 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Don't test function directly when reporting GetLastError().
parent
b9b0bcbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
devinst.c
dlls/setupapi/tests/devinst.c
+9
-9
install.c
dlls/setupapi/tests/install.c
+11
-4
No files found.
dlls/setupapi/tests/devinst.c
View file @
c7cb92f1
...
...
@@ -132,7 +132,7 @@ static BOOL remove_device(void)
{
HDEVINFO
set
;
SP_DEVINFO_DATA
devInfo
=
{
sizeof
(
devInfo
),
{
0
}
};
BOOL
ret
;
BOOL
ret
,
retval
;
SetLastError
(
0xdeadbeef
);
set
=
pSetupDiGetClassDevsA
(
&
guid
,
NULL
,
0
,
0
);
...
...
@@ -140,23 +140,23 @@ static BOOL remove_device(void)
GetLastError
());
SetLastError
(
0xdeadbeef
);
ok
(
pSetupDiEnumDeviceInfo
(
set
,
0
,
&
devInfo
),
"SetupDiEnumDeviceInfo failed: %08x
\n
"
,
GetLastError
());
ret
=
pSetupDiEnumDeviceInfo
(
set
,
0
,
&
devInfo
);
ok
(
ret
,
"SetupDiEnumDeviceInfo failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiCallClassInstaller
(
DIF_REMOVE
,
set
,
&
devInfo
);
ret
val
=
pSetupDiCallClassInstaller
(
DIF_REMOVE
,
set
,
&
devInfo
);
if
(
is_wow64
)
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_IN_WOW64
,
todo_wine
ok
(
!
ret
val
&&
GetLastError
()
==
ERROR_IN_WOW64
,
"SetupDiCallClassInstaller(DIF_REMOVE...) succeeded: %08x
\n
"
,
GetLastError
());
else
todo_wine
ok
(
ret
,
todo_wine
ok
(
ret
val
,
"SetupDiCallClassInstaller(DIF_REMOVE...) failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ok
(
pSetupDiDestroyDeviceInfoList
(
set
),
"SetupDiDestroyDeviceInfoList failed: %08x
\n
"
,
GetLastError
());
ret
=
pSetupDiDestroyDeviceInfoList
(
set
);
ok
(
ret
,
"SetupDiDestroyDeviceInfoList failed: %08x
\n
"
,
GetLastError
());
return
ret
;
return
ret
val
;
}
/* RegDeleteTreeW from dlls/advapi32/registry.c */
...
...
dlls/setupapi/tests/install.c
View file @
c7cb92f1
...
...
@@ -120,12 +120,14 @@ static void test_cmdline(void)
{
static
const
char
infwithspaces
[]
=
"test file.inf"
;
char
path
[
MAX_PATH
];
BOOL
ret
;
create_inf_file
(
inffile
,
cmdline_inf
);
sprintf
(
path
,
"%s
\\
%s"
,
CURR_DIR
,
inffile
);
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
ok_registry
(
TRUE
);
ok
(
DeleteFile
(
inffile
),
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
ret
=
DeleteFile
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
/* Test handling of spaces in path, unquoted and quoted */
create_inf_file
(
infwithspaces
,
cmdline_inf
);
...
...
@@ -138,7 +140,8 @@ static void test_cmdline(void)
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
ok_registry
(
FALSE
);
ok
(
DeleteFile
(
infwithspaces
),
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
ret
=
DeleteFile
(
infwithspaces
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
static
const
char
*
cmdline_inf_reg
=
"[Version]
\n
"
...
...
@@ -153,6 +156,7 @@ static void test_registry(void)
HKEY
key
;
LONG
res
;
char
path
[
MAX_PATH
];
BOOL
ret
;
/* First create a registry structure we would like to be deleted */
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest
\\
setupapitest"
,
&
key
),
...
...
@@ -176,7 +180,8 @@ static void test_registry(void)
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest
\\
setupapitest"
);
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest"
);
}
ok
(
DeleteFile
(
inffile
),
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
ret
=
DeleteFile
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
static
void
test_install_svc_from
(
void
)
...
...
@@ -724,6 +729,7 @@ START_TEST(install)
/* Check if pInstallHinfSectionA sets last error or is a stub (as on WinXP) */
static
const
char
*
minimal_inf
=
"[Version]
\n
Signature=
\"
$Chicago$
\"\n
"
;
char
cmdline
[
MAX_PATH
*
2
];
BOOL
ret
;
create_inf_file
(
inffile
,
minimal_inf
);
sprintf
(
cmdline
,
"DefaultInstall 128 %s
\\
%s"
,
CURR_DIR
,
inffile
);
SetLastError
(
0xdeadbeef
);
...
...
@@ -733,7 +739,8 @@ START_TEST(install)
skip
(
"InstallHinfSectionA is broken (stub)
\n
"
);
pInstallHinfSectionA
=
NULL
;
}
ok
(
DeleteFile
(
inffile
),
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
ret
=
DeleteFile
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
if
(
!
pInstallHinfSectionW
&&
!
pInstallHinfSectionA
)
win_skip
(
"InstallHinfSectionA and InstallHinfSectionW are not available
\n
"
);
...
...
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