Author: pschweitzer
Date: Thu Aug 13 09:38:46 2015
New Revision: 68706
URL:
http://svn.reactos.org/svn/reactos?rev=68706&view=rev
Log:
[SETUPAPI_WINETESTS]
Partly sync with Wine 1.7.47:
- Import tests for SetupLogError* functions
CORE-9924
Modified:
trunk/rostests/winetests/setupapi/misc.c
Modified: trunk/rostests/winetests/setupapi/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/misc.c…
==============================================================================
--- trunk/rostests/winetests/setupapi/misc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/setupapi/misc.c [iso-8859-1] Thu Aug 13 09:38:46 2015
@@ -776,6 +776,46 @@
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 @@
win_skip("SetupUninstallOEMInfA is not available\n");
test_defaultcallback();
-}
+
+ test_SetupLogError();
+}