kernel32: Skip the comm test if the found com port doesn't respond

Dmitry Timoshkov dmitry at codeweavers.com
Wed Sep 12 01:06:09 CDT 2007


Hello,

this patch makes the comm test pass for me under Ubuntu 7.04 64-bit.

Changelog:
    kernel32: Skip the comm test if the found com port doesn't respond.

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

diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index 01ba2b9..66fc770 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -679,7 +679,17 @@ static HANDLE test_OpenComm(BOOL doOverlap)
     }
     if (hcom != INVALID_HANDLE_VALUE)
     {
-        ok(ClearCommError(hcom,&errors,&comstat), "Unexpected errors on open\n");
+        BOOL ret;
+
+        ret = ClearCommError(hcom, &errors, &comstat);
+        if (!ret && GetLastError() == ERROR_NOT_READY)
+        {
+            trace("%s doesn't respond, skipping the test\n", port_name);
+            CloseHandle(hcom);
+            return INVALID_HANDLE_VALUE;
+        }
+
+        ok(ret, "Unexpected error %u on open\n", GetLastError());
         ok(comstat.cbInQue == 0, "Unexpected %d chars in InQueue\n",comstat.cbInQue);
         ok(comstat.cbOutQue == 0, "Still pending %d charcters in OutQueue\n", comstat.cbOutQue);
         ok(errors == 0, "Unexpected errors 0x%08x\n", errors);
-- 
1.5.3.1






More information about the wine-patches mailing list