Piotr Caban : user32: Test error returned in out of timers case.
Alexandre Julliard
julliard at winehq.org
Tue Feb 28 03:45:56 CST 2017
Module: wine
Branch: oldstable
Commit: 55f0d15d45d2b43777196fc7d62ae9c3f91b9abf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=55f0d15d45d2b43777196fc7d62ae9c3f91b9abf
Author: Piotr Caban <piotr at codeweavers.com>
Date: Mon Jan 25 09:59:57 2016 +0100
user32: Test error returned in out of timers case.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 7b3c7af8134506479498df8ef343e67fd2e9d919)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/user32/tests/msg.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index c51cb68..d44aca4 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -8627,9 +8627,11 @@ static void test_timers(void)
static void test_timers_no_wnd(void)
{
+ static UINT_PTR ids[0xffff];
UINT_PTR id, id2;
DWORD start;
MSG msg;
+ int i;
count = 0;
id = SetTimer(NULL, 0, 100, callback_count);
@@ -8664,6 +8666,18 @@ static void test_timers_no_wnd(void)
count, TIMER_COUNT_EXPECTED);
KillTimer(NULL, id);
/* Note: SetSystemTimer doesn't support a NULL window, see test_timers */
+
+ /* Check what happens when we're running out of timers */
+ for (i=0; i<sizeof(ids)/sizeof(ids[0]); i++)
+ {
+ SetLastError(0xdeadbeef);
+ ids[i] = SetTimer(NULL, 0, USER_TIMER_MAXIMUM, tfunc);
+ if (!ids[i]) break;
+ }
+ ok(i != sizeof(ids)/sizeof(ids[0]), "all timers were created successfully\n");
+ ok(GetLastError()==ERROR_NO_MORE_USER_HANDLES || broken(GetLastError()==0xdeadbeef),
+ "GetLastError() = %d\n", GetLastError());
+ while (i > 0) KillTimer(NULL, ids[--i]);
}
static void test_timers_exception(DWORD code)
More information about the wine-cvs
mailing list