advapi32/tests: Add a test to show that OpenSCManager clears last error on success.
Hans Leidekker
hans at codeweavers.com
Tue Jan 28 06:24:14 CST 2014
---
dlls/advapi32/tests/service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c
index fac6bd9..74cb9a8 100644
--- a/dlls/advapi32/tests/service.c
+++ b/dlls/advapi32/tests/service.c
@@ -101,7 +101,6 @@ static void test_open_scm(void)
CloseServiceHandle(scm_handle); /* Just in case */
/* Proper call with an empty hostname */
- SetLastError(0xdeadbeef);
scm_handle = OpenSCManagerA("", SERVICES_ACTIVE_DATABASEA, SC_MANAGER_CONNECT);
ok(scm_handle != NULL, "Expected success, got error %u\n", GetLastError());
CloseServiceHandle(scm_handle);
@@ -109,6 +108,7 @@ static void test_open_scm(void)
/* Again a correct one */
SetLastError(0xdeadbeef);
scm_handle = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT);
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", GetLastError());
ok(scm_handle != NULL, "Expected success, got error %u\n", GetLastError());
CloseServiceHandle(scm_handle);
}
--
1.8.5.3
More information about the wine-patches
mailing list