Dmitry Timoshkov : kernel32/tests: Add a test to show that WaitCommEvent should fail if there is a pending wait .
Alexandre Julliard
julliard at winehq.org
Tue Sep 3 13:38:03 CDT 2013
Module: wine
Branch: master
Commit: 4135900235c58859fffe39290c9089151eeaf666
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4135900235c58859fffe39290c9089151eeaf666
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Mon Sep 2 18:27:01 2013 +0900
kernel32/tests: Add a test to show that WaitCommEvent should fail if there is a pending wait.
---
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 882b652..e54be7a 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -783,7 +783,7 @@ static void test_waittxempty(void)
DWORD before, after, bytes, timediff, evtmask, errors, i;
BOOL res;
DWORD baud = SLOWBAUD;
- OVERLAPPED ovl_write, ovl_wait;
+ OVERLAPPED ovl_write, ovl_wait, ovl_wait2;
COMSTAT stat;
hcom = test_OpenComm(TRUE);
@@ -956,6 +956,16 @@ todo_wine
{
ok(!evtmask, "WaitCommEvent: expected 0, got %#x\n", evtmask);
+ S(U(ovl_wait2)).Offset = 0;
+ S(U(ovl_wait2)).OffsetHigh = 0;
+ ovl_wait2.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ SetLastError(0xdeadbeef);
+ res = WaitCommEvent(hcom, &evtmask, &ovl_wait2);
+ ok(!res, "WaitCommEvent should fail if there is a pending wait\n");
+todo_wine
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ CloseHandle(ovl_wait2.hEvent);
+
/* unblock pending wait */
trace("recovering after WAIT_TIMEOUT...\n");
/* FIXME: Wine fails to unblock with new mask being equal to the old one */
More information about the wine-cvs
mailing list