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

This commit is contained in:
Alexandre Julliard 2009-09-24 13:10:54 +02:00
parent 9f28d9a171
commit b9251bcdbf
1 changed files with 8 additions and 4 deletions

View File

@ -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)