Paul Vriens : advapi32/tests: Fix a test on NT4.

Alexandre Julliard julliard at winehq.org
Wed Jun 18 12:59:16 CDT 2008


Module: wine
Branch: master
Commit: 71c49aac584fbc2c8846530e76d19077ac2460fb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=71c49aac584fbc2c8846530e76d19077ac2460fb

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Fri Jun 13 13:22:54 2008 +0200

advapi32/tests: Fix a test on NT4.

---

 dlls/advapi32/tests/service.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c
index 8ffe2e8..cd6d82c 100644
--- a/dlls/advapi32/tests/service.c
+++ b/dlls/advapi32/tests/service.c
@@ -145,7 +145,17 @@ static void test_open_svc(void)
     GetServiceDisplayNameA(scm_handle, spooler, NULL, &displaysize);
     /* Get the displayname */
     GetServiceDisplayNameA(scm_handle, spooler, displayname, &displaysize);
-    /* Try to open the service with this displayname */
+    /* Try to open the service with this displayname, unless the displayname equals
+     * the servicename as that would defeat the purpose of this test.
+     */
+    if (!lstrcmpi(spooler, displayname))
+    {
+        skip("displayname equals servicename\n");
+        CloseServiceHandle(scm_handle);
+        return;
+    }
+
+    SetLastError(0xdeadbeef);
     svc_handle = OpenServiceA(scm_handle, displayname, GENERIC_READ);
     ok(!svc_handle, "Expected failure\n");
     ok(GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST, "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n", GetLastError());




More information about the wine-cvs mailing list