mirror of
https://github.com/reactos/reactos.git
synced 2025-02-21 16:04:57 +00:00
[SETUPAPI_WINETESTS]
Partly sync with Wine 1.7.47: - Import tests for SetupLogError* functions CORE-9924 svn path=/trunk/; revision=68706
This commit is contained in:
parent
1f86353d60
commit
0303c3abbe
1 changed files with 42 additions and 0 deletions
|
@ -776,6 +776,46 @@ static void test_defaultcallback(void)
|
|||
SetupTermDefaultQueueCallback(ctxt);
|
||||
}
|
||||
|
||||
static void test_SetupLogError(void)
|
||||
{
|
||||
BOOL ret;
|
||||
DWORD error;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = SetupLogErrorA("Test without opening\r\n", LogSevInformation);
|
||||
error = GetLastError();
|
||||
ok(!ret, "SetupLogError succeeded\n");
|
||||
ok(error == ERROR_FILE_INVALID, "got wrong error: %d\n", error);
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = SetupOpenLog(FALSE);
|
||||
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
|
||||
{
|
||||
win_skip("SetupOpenLog() failed on insufficient permissions\n");
|
||||
return;
|
||||
}
|
||||
ok(ret, "SetupOpenLog failed, error %d\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = SetupLogErrorA("Test with wrong log severity\r\n", LogSevMaximum);
|
||||
error = GetLastError();
|
||||
ok(!ret, "SetupLogError succeeded\n");
|
||||
ok(error == 0xdeadbeef, "got wrong error: %d\n", error);
|
||||
ret = SetupLogErrorA("Test without EOL", LogSevInformation);
|
||||
ok(ret, "SetupLogError failed\n");
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = SetupLogErrorA(NULL, LogSevInformation);
|
||||
ok(ret || broken(!ret && GetLastError() == ERROR_INVALID_PARAMETER /* Win Vista+ */),
|
||||
"SetupLogError failed: %08x\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = SetupOpenLog(FALSE);
|
||||
ok(ret, "SetupOpenLog failed, error %d\n", GetLastError());
|
||||
|
||||
SetupCloseLog();
|
||||
}
|
||||
|
||||
START_TEST(misc)
|
||||
{
|
||||
HMODULE hsetupapi = GetModuleHandleA("setupapi.dll");
|
||||
|
@ -807,4 +847,6 @@ START_TEST(misc)
|
|||
win_skip("SetupUninstallOEMInfA is not available\n");
|
||||
|
||||
test_defaultcallback();
|
||||
|
||||
test_SetupLogError();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue