Cleanup Comm Test
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Wed Jun 29 16:20:31 CDT 2005
Changelog:
wine/dll/kernel/tests/comm.c:
WaitcCommEvent is broken, so don't even call it
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/kernel/tests/comm.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/comm.c,v
retrieving revision 1.5
diff -u -w -r1.5 comm.c
--- wine/dlls/kernel/tests/comm.c 27 Jun 2005 19:49:07 -0000 1.5
+++ wine/dlls/kernel/tests/comm.c 29 Jun 2005 21:16:09 -0000
@@ -38,6 +38,8 @@
#define LOOPBACK_DTR_RING FALSE /* Sub-D 9: Short 4-9 */
#define LOOPBACK_DTR_DCD FALSE /* Sub-D 9: Short 4-1 */
+#define WAITCOMMEVENT_BROKEN TRUE
+
/* SETBREAK seems to give instable results, MSDN mentions possible problems
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedebug5/\
* html/wce50conSerialPortDriverTest.asp
@@ -430,6 +432,18 @@
pdcb->wReserved1 & 0xffff );
} */
+static BOOL Internal_WaitCommEvent( HANDLE hFile, LPDWORD lpEvtMask, LPOVERLAPPED lpOverlapped)
+{
+ BOOL WaitCommEvent_Broken= WAITCOMMEVENT_BROKEN;
+ if (!WaitCommEvent_Broken)
+ return WaitCommEvent( hFile, lpEvtMask, lpOverlapped);
+ else
+ {
+ todo_wine ok(FALSE, "WaitCommEvent_Broken\n");
+ return FALSE;
+ }
+}
+
static void check_result(const char *function, TEST *ptest, int initial_value, BOOL result)
{
DWORD LastError = GetLastError();
@@ -758,7 +772,7 @@
after - before, sizeof(tbuf), baud);
before = GetTickCount();
- res = WaitCommEvent(hcom, &evtmask, NULL);
+ res = Internal_WaitCommEvent(hcom, &evtmask, NULL);
after = GetTickCount();
todo_wine ok(res == TRUE, "WaitCommEvent failed\n");
@@ -819,7 +833,7 @@
written, sizeof(tbuf));
/* make sure all bytes are written, so Readfile will succeed in one call*/
- todo_wine ok(WaitCommEvent(hcom, &evtmask, NULL), "WaitCommEvent failed\n");
+ todo_wine ok(Internal_WaitCommEvent(hcom, &evtmask, NULL), "WaitCommEvent failed\n");
todo_wine ok(evtmask == EV_TXEMPTY,
"WaitCommEvent: Unexpected EvtMask 0x%08lx, expected 0x%08x\n",
evtmask, EV_TXEMPTY);
@@ -845,7 +859,7 @@
ok(written == sizeof(tbuf),"WriteFile %ld bytes written, expected %d\n",
written, sizeof(tbuf));
- todo_wine ok(WaitCommEvent(hcom, &evtmask, NULL), "WaitCommEvent failed\n");
+ todo_wine ok(Internal_WaitCommEvent(hcom, &evtmask, NULL), "WaitCommEvent failed\n");
todo_wine ok(evtmask == EV_RXCHAR, "WaitCommEvent: Unexpected EvtMask 0x%08lx, expected 0x%08x\n",
evtmask, EV_RXCHAR);
@@ -1043,7 +1057,7 @@
overlapped_w.hEvent = hComWriteEvent;
before = GetTickCount();
- todo_wine {success_wait = WaitCommEvent(hcom, &evtmask, &overlapped);}
+ todo_wine {success_wait = Internal_WaitCommEvent(hcom, &evtmask, &overlapped);}
err_wait = GetLastError();
after = GetTickCount();
trace("Success 0x%08lx err 0x%08lx evtmask 0x%08lx\n", success_wait, err_wait, evtmask);
@@ -1151,7 +1165,7 @@
ZeroMemory( &overlapped, sizeof(overlapped));
overlapped.hEvent = hComPortEvent;
before = GetTickCount();
- success = WaitCommEvent(hcom, &evtmask, &overlapped);
+ success = Internal_WaitCommEvent(hcom, &evtmask, &overlapped);
err = GetLastError();
after = GetTickCount();
@@ -1220,7 +1234,7 @@
ZeroMemory( &overlapped, sizeof(overlapped));
overlapped.hEvent = hComPortEvent;
before = GetTickCount();
- success = WaitCommEvent(hcom, &evtmask, &overlapped);
+ success = Internal_WaitCommEvent(hcom, &evtmask, &overlapped);
err = GetLastError();
after = GetTickCount();
@@ -1289,7 +1303,7 @@
ZeroMemory( &overlapped, sizeof(overlapped));
overlapped.hEvent = hComPortEvent;
before = GetTickCount();
- success = WaitCommEvent(hcom, &evtmask, &overlapped);
+ success = Internal_WaitCommEvent(hcom, &evtmask, &overlapped);
err = GetLastError();
after = GetTickCount();
@@ -1358,7 +1372,7 @@
ZeroMemory( &overlapped, sizeof(overlapped));
overlapped.hEvent = hComPortEvent;
before = GetTickCount();
- success = WaitCommEvent(hcom, &evtmask, &overlapped);
+ success = Internal_WaitCommEvent(hcom, &evtmask, &overlapped);
err = GetLastError();
after = GetTickCount();
@@ -1409,7 +1423,7 @@
ZeroMemory( &overlapped, sizeof(overlapped));
overlapped.hEvent = hComPortEvent;
before = GetTickCount();
- success = WaitCommEvent(hcom, &evtmask, &overlapped);
+ success = Internal_WaitCommEvent(hcom, &evtmask, &overlapped);
err = GetLastError();
after = GetTickCount();
@@ -1458,7 +1472,6 @@
BOOL loopback_dtr_dcd = LOOPBACK_DTR_DCD;
BOOL broken_setbreak = BROKEN_SETBREAK;
-#if 1
test_BuildCommDCB();
hcom = test_OpenComm(FALSE);
if (hcom != INVALID_HANDLE_VALUE)
@@ -1499,13 +1512,11 @@
test_LoopbackDtrDcd(hcom);
CloseHandle(hcom);
}
-#endif
if((loopback_txd_rxd) && ((hcom = test_OpenComm(TRUE))!=INVALID_HANDLE_VALUE))
{
test_WaitRx(hcom);
CloseHandle(hcom);
}
-#if 1
if((loopback_rts_cts) && ((hcom = test_OpenComm(TRUE))!=INVALID_HANDLE_VALUE))
{
test_WaitCts(hcom);
@@ -1531,5 +1542,4 @@
test_WaitBreak(hcom);
CloseHandle(hcom);
}
-#endif
}
More information about the wine-patches
mailing list