Module: wine Branch: master Commit: a1edebefdf47cab4effa0324c0d4ea2218b031c4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a1edebefdf47cab4effa0324c0...
Author: Pierre Schweitzer pierre@reactos.org Date: Wed Mar 25 21:25:40 2015 +0100
setupapi/tests: Add tests for the SetupOpenLog(), SetupLogErrorA(), SetupCloseLog() functions.
---
dlls/setupapi/tests/misc.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c index cfe888b..7423738 100644 --- a/dlls/setupapi/tests/misc.c +++ b/dlls/setupapi/tests/misc.c @@ -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(); }