setupapi/tests: Don't test function directly when reporting GetLastError().
This commit is contained in:
parent
b9b0bcbf3f
commit
c7cb92f1f2
@ -132,7 +132,7 @@ static BOOL remove_device(void)
|
|||||||
{
|
{
|
||||||
HDEVINFO set;
|
HDEVINFO set;
|
||||||
SP_DEVINFO_DATA devInfo = { sizeof(devInfo), { 0 } };
|
SP_DEVINFO_DATA devInfo = { sizeof(devInfo), { 0 } };
|
||||||
BOOL ret;
|
BOOL ret, retval;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
set = pSetupDiGetClassDevsA(&guid, NULL, 0, 0);
|
set = pSetupDiGetClassDevsA(&guid, NULL, 0, 0);
|
||||||
@ -140,23 +140,23 @@ static BOOL remove_device(void)
|
|||||||
GetLastError());
|
GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ok(pSetupDiEnumDeviceInfo(set, 0, &devInfo),
|
ret = pSetupDiEnumDeviceInfo(set, 0, &devInfo);
|
||||||
"SetupDiEnumDeviceInfo failed: %08x\n", GetLastError());
|
ok(ret, "SetupDiEnumDeviceInfo failed: %08x\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = pSetupDiCallClassInstaller(DIF_REMOVE, set, &devInfo);
|
retval = pSetupDiCallClassInstaller(DIF_REMOVE, set, &devInfo);
|
||||||
if(is_wow64)
|
if(is_wow64)
|
||||||
todo_wine ok(!ret && GetLastError() == ERROR_IN_WOW64,
|
todo_wine ok(!retval && GetLastError() == ERROR_IN_WOW64,
|
||||||
"SetupDiCallClassInstaller(DIF_REMOVE...) succeeded: %08x\n", GetLastError());
|
"SetupDiCallClassInstaller(DIF_REMOVE...) succeeded: %08x\n", GetLastError());
|
||||||
else
|
else
|
||||||
todo_wine ok(ret,
|
todo_wine ok(retval,
|
||||||
"SetupDiCallClassInstaller(DIF_REMOVE...) failed: %08x\n", GetLastError());
|
"SetupDiCallClassInstaller(DIF_REMOVE...) failed: %08x\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ok(pSetupDiDestroyDeviceInfoList(set),
|
ret = pSetupDiDestroyDeviceInfoList(set);
|
||||||
"SetupDiDestroyDeviceInfoList failed: %08x\n", GetLastError());
|
ok(ret, "SetupDiDestroyDeviceInfoList failed: %08x\n", GetLastError());
|
||||||
|
|
||||||
return ret;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RegDeleteTreeW from dlls/advapi32/registry.c */
|
/* RegDeleteTreeW from dlls/advapi32/registry.c */
|
||||||
|
@ -120,12 +120,14 @@ static void test_cmdline(void)
|
|||||||
{
|
{
|
||||||
static const char infwithspaces[] = "test file.inf";
|
static const char infwithspaces[] = "test file.inf";
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
create_inf_file(inffile, cmdline_inf);
|
create_inf_file(inffile, cmdline_inf);
|
||||||
sprintf(path, "%s\\%s", CURR_DIR, inffile);
|
sprintf(path, "%s\\%s", CURR_DIR, inffile);
|
||||||
run_cmdline("DefaultInstall", 128, path);
|
run_cmdline("DefaultInstall", 128, path);
|
||||||
ok_registry(TRUE);
|
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 */
|
/* Test handling of spaces in path, unquoted and quoted */
|
||||||
create_inf_file(infwithspaces, cmdline_inf);
|
create_inf_file(infwithspaces, cmdline_inf);
|
||||||
@ -138,7 +140,8 @@ static void test_cmdline(void)
|
|||||||
run_cmdline("DefaultInstall", 128, path);
|
run_cmdline("DefaultInstall", 128, path);
|
||||||
ok_registry(FALSE);
|
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"
|
static const char *cmdline_inf_reg = "[Version]\n"
|
||||||
@ -153,6 +156,7 @@ static void test_registry(void)
|
|||||||
HKEY key;
|
HKEY key;
|
||||||
LONG res;
|
LONG res;
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
/* First create a registry structure we would like to be deleted */
|
/* First create a registry structure we would like to be deleted */
|
||||||
ok(!RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest\\setupapitest", &key),
|
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\\setupapitest");
|
||||||
RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\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)
|
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) */
|
/* Check if pInstallHinfSectionA sets last error or is a stub (as on WinXP) */
|
||||||
static const char *minimal_inf = "[Version]\nSignature=\"$Chicago$\"\n";
|
static const char *minimal_inf = "[Version]\nSignature=\"$Chicago$\"\n";
|
||||||
char cmdline[MAX_PATH*2];
|
char cmdline[MAX_PATH*2];
|
||||||
|
BOOL ret;
|
||||||
create_inf_file(inffile, minimal_inf);
|
create_inf_file(inffile, minimal_inf);
|
||||||
sprintf(cmdline, "DefaultInstall 128 %s\\%s", CURR_DIR, inffile);
|
sprintf(cmdline, "DefaultInstall 128 %s\\%s", CURR_DIR, inffile);
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
@ -733,7 +739,8 @@ START_TEST(install)
|
|||||||
skip("InstallHinfSectionA is broken (stub)\n");
|
skip("InstallHinfSectionA is broken (stub)\n");
|
||||||
pInstallHinfSectionA = NULL;
|
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)
|
if (!pInstallHinfSectionW && !pInstallHinfSectionA)
|
||||||
win_skip("InstallHinfSectionA and InstallHinfSectionW are not available\n");
|
win_skip("InstallHinfSectionA and InstallHinfSectionW are not available\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user