Alexandre Julliard : kernel32/tests: Fix a couple of failures in the comm tests.

Alexandre Julliard julliard at winehq.org
Thu Sep 24 10:54:05 CDT 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Sep 24 13:10:54 2009 +0200

kernel32/tests: Fix a couple of failures in the comm tests.

---

 dlls/kernel32/tests/comm.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index 3d0d17b..8cb010c 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -684,7 +684,7 @@ static HANDLE test_OpenComm(BOOL doOverlap)
 	if (hcom == INVALID_HANDLE_VALUE)
 	    trace("Could not find a valid COM port.  Skipping test_ReadTimeOut\n");
 	else
-	    trace("Found Com port %s. Connected devices may disturbe results\n", port_name);
+	    trace("Found Com port %s. Connected devices may disturb results\n", port_name);
 	/*shown = TRUE; */
     }
     if (hcom != INVALID_HANDLE_VALUE)
@@ -692,9 +692,12 @@ static HANDLE test_OpenComm(BOOL doOverlap)
         BOOL ret;
 
         ret = ClearCommError(hcom, &errors, &comstat);
-        if (!ret && GetLastError() == ERROR_NOT_READY)
+        if (!ret && (GetLastError() == ERROR_NOT_READY || GetLastError() == ERROR_INVALID_HANDLE))
         {
-            trace("%s doesn't respond, skipping the test\n", port_name);
+            if (GetLastError() == ERROR_NOT_READY)
+                trace("%s doesn't respond, skipping the test\n", port_name);
+            else
+                trace("%s is not a real serial port, skipping the test\n", port_name);
             CloseHandle(hcom);
             return INVALID_HANDLE_VALUE;
         }
@@ -1649,7 +1652,8 @@ static void test_stdio(void)
 
     /* cygwin tries this to determine the stdin handle type */
     ok( !GetCommState( GetStdHandle(STD_INPUT_HANDLE), &dcb ), "GetCommState succeeded on stdin\n" );
-    ok( GetLastError() == ERROR_INVALID_HANDLE, "got error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_INVALID_FUNCTION,
+        "got error %u\n", GetLastError() );
 }
 
 START_TEST(comm)




More information about the wine-cvs mailing list