From 4ccdc0c03681dbdf4dd5239a923764f7555e2da4 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 15 Jul 2015 06:20:08 +0200 Subject: [PATCH] kernel32/tests: Repeat test for SignalObjectAndWait multiple times to test wineserver wakeup cookie management. --- dlls/kernel32/tests/sync.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index cbe0acb4b61..a9d2377a105 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -64,6 +64,7 @@ static void test_signalandwait(void) HMODULE kernel32; DWORD r; HANDLE event[2], semaphore[2], file; + int i; kernel32 = GetModuleHandleA("kernel32.dll"); pSignalObjectAndWait = (void*) GetProcAddress(kernel32, "SignalObjectAndWait"); @@ -96,9 +97,13 @@ static void test_signalandwait(void) r = pSignalObjectAndWait(event[0], event[1], 0, FALSE); ok( r == WAIT_OBJECT_0, "should succeed\n"); - /* event[0] is now signalled */ - r = pSignalObjectAndWait(event[0], event[0], 0, FALSE); - ok( r == WAIT_OBJECT_0, "should succeed\n"); + /* event[0] is now signalled - we repeat this test multiple times + * to ensure that the wineserver handles this situation properly. */ + for (i = 0; i < 10000; i++) + { + r = pSignalObjectAndWait(event[0], event[0], 0, FALSE); + ok(r == WAIT_OBJECT_0, "should succeed\n"); + } /* event[0] is not signalled */ r = WaitForSingleObject(event[0], 0); -- 2.11.4.GIT