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

oldstable
Dmitry Timoshkov 2007-09-12 15:06:09 +09:00 committed by Alexandre Julliard
parent 4fb82e3783
commit dbd9c8db51
1 changed files with 11 additions and 1 deletions

View File

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