If we have no named pipes support, don't test the API.

Jakob Eriksson jakov at vmlinux.org
Mon Mar 21 08:47:30 CST 2005



Abort if we can't create a named pipe at all.



-------------- next part --------------
Index: dlls/kernel/tests/pipe.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/pipe.c,v
retrieving revision 1.14
diff -u -r1.14 pipe.c
--- dlls/kernel/tests/pipe.c	13 Dec 2004 21:19:02 -0000	1.14
+++ dlls/kernel/tests/pipe.c	21 Mar 2005 14:45:56 -0000
@@ -700,7 +700,7 @@
     trace("test_NamedPipe_2 returning\n");
 }
 
-static void test_DisconnectNamedPipe(void)
+static int test_DisconnectNamedPipe(void)
 {
     HANDLE hnp;
     HANDLE hFile;
@@ -715,7 +715,10 @@
         /* nInBufSize */ 1024,
         /* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT,
         /* lpSecurityAttrib */ NULL);
-    ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
+    if (INVALID_HANDLE_VALUE == hnp) {
+        trace ("Seems we have no named pipes.\n");
+        return 1;
+    }
 
     ok(WriteFile(hnp, obuf, sizeof(obuf), &written, NULL) == 0
         && GetLastError() == ERROR_PIPE_LISTENING, "WriteFile to not-yet-connected pipe\n");
@@ -745,12 +748,14 @@
 
     ok(CloseHandle(hnp), "CloseHandle\n");
 
+    return 0;
 }
 
 START_TEST(pipe)
 {
     trace("test 1 of 4:\n");
-    test_DisconnectNamedPipe();
+    if (test_DisconnectNamedPipe())
+        return;
     trace("test 2 of 4:\n");
     test_CreateNamedPipe_instances_must_match();
     trace("test 3 of 4:\n");
@@ -761,3 +766,4 @@
     test_CreateNamedPipe(PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE);
     trace("all tests done\n");
 }
+


More information about the wine-patches mailing list