Added test for server-Unexpected_Wakeup patch.

This commit is contained in:
Sebastian Lackner 2014-12-18 18:44:41 +01:00
parent dd5e8aebb1
commit 3fe922b5f5
3 changed files with 46 additions and 1 deletions

1
debian/changelog vendored
View File

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

View File

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

View File

@ -0,0 +1,42 @@
From e8a0619c85e774abd866e3882038dee563007c77 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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