[PATCH] localui/tests: Do not fail, when the spooler service was stopped

Detlef Riekenberg wine.dev at web.de
Tue Jun 5 15:59:53 CDT 2012


--
By by ... Detlef
---
 dlls/localui/tests/localui.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/localui/tests/localui.c b/dlls/localui/tests/localui.c
index 59ac3b5..b3422aa 100644
--- a/dlls/localui/tests/localui.c
+++ b/dlls/localui/tests/localui.c
@@ -71,7 +71,11 @@ static PORT_INFO_2W * find_portinfo2(LPWSTR pPort)
 
     if (!pi_buffer) {
         res = EnumPortsW(NULL, 2, NULL, 0, &pi_needed, &pi_numports);
-        ok(!res, "EnumPorts failed: got %d\n", res);
+        if (!res && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) {
+            win_skip("The Service 'Spooler' is required for many test\n");
+            return NULL;
+        }
+        ok(!res, "EnumPorts succeeded: got %d\n", res);
         pi_buffer = HeapAlloc(GetProcessHeap(), 0, pi_needed);
         res = EnumPortsW(NULL, 2, pi_buffer, pi_needed, &pi_needed, &pi_numports);
         ok(res == 1, "EnumPorts failed: got %d\n", res);
@@ -295,6 +299,12 @@ START_TEST(localui)
 
     /* find installed Ports */
 
+    /* "FILE:" */
+    file_present = find_portinfo2(portname_fileW);
+
+    if (!pi_numports)   /* Nothing to test without a port */
+        return;
+
     id = 0;
     /* "LPT1:" - "LPT9:" */
     while (((lpt_present == NULL) || (lpt_absent == NULL)) && id < 9) {
@@ -317,9 +327,6 @@ START_TEST(localui)
         if (!pi2 && (com_absent == NULL)) com_absent = strdupW(bufferW);
     }
 
-    /* "FILE:" */
-    file_present = find_portinfo2(portname_fileW);
-
     test_AddPortUI();
     test_ConfigurePortUI();
 
-- 
1.7.5.4




More information about the wine-patches mailing list