Commit a1edebef authored by Pierre Schweitzer's avatar Pierre Schweitzer Committed by Alexandre Julliard

setupapi/tests: Add tests for the SetupOpenLog(), SetupLogErrorA(), SetupCloseLog() functions.

parent a851aaa4
......@@ -776,6 +776,39 @@ 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);
ret = SetupOpenLog(FALSE);
ok(ret, "SetupOpenLog failed\n");
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());
ret = SetupOpenLog(FALSE);
ok(ret, "SetupOpenLog failed\n");
SetupCloseLog();
}
START_TEST(misc)
{
HMODULE hsetupapi = GetModuleHandleA("setupapi.dll");
......@@ -807,4 +840,6 @@ START_TEST(misc)
win_skip("SetupUninstallOEMInfA is not available\n");
test_defaultcallback();
test_SetupLogError();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment