From 51de8068d602109b71f5f1f01ea10301fec9636b Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 20 Jul 2007 11:24:01 -0700 Subject: [PATCH] kernel32: Additional SetThreadPriorityTest, Try 4 Added test for error value, as per comment by Alexandre Julliard --- dlls/kernel32/tests/thread.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index bbda00e..ff53d2e 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -588,6 +588,30 @@ #endif "GetThreadPriority Failed\n"); ok(SetThreadPriority(curthread,0)!=0,"SetThreadPriority Failed\n"); +/* Check that the thread priority is not changed if SetThreadPriority + is called with a value outside of the max/min range */ + SetThreadPriority(curthread,min_priority); + SetThreadPriority(curthread,min_priority-1); + exitCode = GetLastError(); + + todo_wine { + ok(exitCode == ERROR_INVALID_PARAMETER, + "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)", exitCode); + ok(GetThreadPriority(curthread)==min_priority, + "GetThreadPriority didn't return min_priority\n"); + } + + SetThreadPriority(curthread,max_priority); + SetThreadPriority(curthread,max_priority+1); + SetThreadPriority(curthread,min_priority-1); + exitCode = GetLastError(); + todo_wine { + ok(exitCode == ERROR_INVALID_PARAMETER, + "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)", exitCode); + ok(GetThreadPriority(curthread)==max_priority, + "GetThreadPriority didn't return max_priority\n"); + } + /* Check thread priority boost */ if (!pGetThreadPriorityBoost || !pSetThreadPriorityBoost) return; /* Win9x */ -- 1.4.1