From 3fe922b5f552e697e20c5156dd20205af248fe6f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 18 Dec 2014 18:44:41 +0100 Subject: [PATCH] Added test for server-Unexpected_Wakeup patch. --- debian/changelog | 1 + patches/Makefile | 4 +- ...epeat-test-for-SignalObjectAndWait-m.patch | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch diff --git a/debian/changelog b/debian/changelog index 5243b3af..fd4613a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ wine-staging (1.7.34) UNRELEASED; urgency=low * Added patch to fix handling of subdirectory in FtpFindFirstFile. * Added patch to return proper charcount for GetLocaleInfo with LOCALE_IFIRSTDAYOFWEEK. * Added patch to ensure X11 input events are handled even without explicit message loop. + * Added test for server-Unexpected_Wakeup patch. * Removed patch to implement combase HSTRING objects (accepted upstream). * Removed patch to add fake ProductId to registry (accepted upstream). * Removed patch to implement stubs for MFStartup and MFShutdown (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index 337de12a..ceba369d 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -1456,13 +1456,15 @@ server-Stored_ACLs.ok: ntdll-DOS_Attributes.ok # Patchset server-Unexpected_Wakeup # | # | Modified files: -# | * server/thread.c +# | * dlls/kernel32/tests/sync.c, server/thread.c # | .INTERMEDIATE: server-Unexpected_Wakeup.ok server-Unexpected_Wakeup.ok: $(call APPLY_FILE,server-Unexpected_Wakeup/0001-server-Avoid-sending-unexpected-wakeup-with-uninitia.patch) + $(call APPLY_FILE,server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch) @( \ echo '+ { "Sebastian Lackner", "server: Avoid sending unexpected wakeup with uninitialized cookie value.", 1 },'; \ + echo '+ { "Sebastian Lackner", "kernel32/tests: Repeat test for SignalObjectAndWait multiple times to test wineserver wakeup cookie management.", 1 },'; \ ) > server-Unexpected_Wakeup.ok # Patchset setupapi-SetupPromptForDisk diff --git a/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch b/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch new file mode 100644 index 00000000..3718e5d5 --- /dev/null +++ b/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch @@ -0,0 +1,42 @@ +From e8a0619c85e774abd866e3882038dee563007c77 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 16 Dec 2014 06:23:15 +0100 +Subject: 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 cbe0acb..668b92d 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.1.3 +