From 54752c4f873e0ef940ede8767cabb9f7445fcb05 Mon Sep 17 00:00:00 2001 From: Dan Hipschman Date: Tue, 29 Jul 2008 14:38:23 -0700 Subject: [PATCH] kernel32/tests: Add tests for undocumented default timer queue "features". --- dlls/kernel32/tests/sync.c | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 2a686ca4e35..02904f72f3b 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -894,6 +894,47 @@ static void test_timer_queue(void) ret = pDeleteTimerQueueTimer(NULL, t1, INVALID_HANDLE_VALUE); ok(ret, "DeleteTimerQueueTimer, default queue\n"); + + /* Try mixing default and non-default queues. Apparently this works. */ + q = pCreateTimerQueue(); + ok(q != NULL, "CreateTimerQueue\n"); + + t1 = NULL; + n1 = 0; + ret = pCreateTimerQueueTimer(&t1, q, timer_queue_cb1, &n1, 1000, + 1000, 0); + ok(ret, "CreateTimerQueueTimer\n"); + ok(t1 != NULL, "CreateTimerQueueTimer\n"); + + t2 = NULL; + n2 = 0; + ret = pCreateTimerQueueTimer(&t2, NULL, timer_queue_cb1, &n2, 1000, + 1000, 0); + ok(ret, "CreateTimerQueueTimer\n"); + ok(t2 != NULL, "CreateTimerQueueTimer\n"); + + ret = pChangeTimerQueueTimer(NULL, t1, 2000, 2000); + ok(ret, "ChangeTimerQueueTimer\n"); + + ret = pChangeTimerQueueTimer(q, t2, 2000, 2000); + ok(ret, "ChangeTimerQueueTimer\n"); + + ret = pDeleteTimerQueueTimer(NULL, t1, INVALID_HANDLE_VALUE); + ok(ret, "DeleteTimerQueueTimer\n"); + + ret = pDeleteTimerQueueTimer(q, t2, INVALID_HANDLE_VALUE); + ok(ret, "DeleteTimerQueueTimer\n"); + + /* Try to delete the default queue? In any case: not allowed. */ + SetLastError(0xdeadbeef); + ret = pDeleteTimerQueueEx(NULL, NULL); + ok(!ret, "DeleteTimerQueueEx\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "DeleteTimerQueueEx\n"); + + SetLastError(0xdeadbeef); + ret = pDeleteTimerQueueEx(q, NULL); + ok(!ret, "DeleteTimerQueueEx\n"); + ok(GetLastError() == ERROR_IO_PENDING, "DeleteTimerQueueEx\n"); } START_TEST(sync)