Matt Jones : kernel32: Added test for bad arguments to SetThreadPriority, test for correct error value.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 25 07:44:23 CDT 2007


Module: wine
Branch: master
Commit: f204ed1d192655d8443437266af937bd91fe11f1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f204ed1d192655d8443437266af937bd91fe11f1

Author: Matt Jones <mattj at google.com>
Date:   Tue Jul 24 13:20:40 2007 -0700

kernel32: Added test for bad arguments to SetThreadPriority, test for correct error value.

---

 dlls/kernel32/tests/thread.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
index bbda00e..9ba9242 100644
--- a/dlls/kernel32/tests/thread.c
+++ b/dlls/kernel32/tests/thread.c
@@ -588,6 +588,32 @@ static VOID test_thread_priority(void)
        "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);
+   SetLastError(0xdeadbeef);
+   rc = SetThreadPriority(curthread,min_priority-1);
+
+   todo_wine {
+     ok(rc == FALSE, "SetThreadPriority passed with a bad argument\n");
+     ok(GetLastError() == ERROR_INVALID_PARAMETER,
+        "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)\n", GetLastError());
+     ok(GetThreadPriority(curthread)==min_priority,
+        "GetThreadPriority didn't return min_priority\n");
+   }
+
+   SetThreadPriority(curthread,max_priority);
+   SetLastError(0xdeadbeef);
+   rc = SetThreadPriority(curthread,max_priority+1);
+
+   todo_wine {
+     ok(rc == FALSE, "SetThreadPriority passed with a bad argument\n");
+     ok(GetLastError() == ERROR_INVALID_PARAMETER,
+        "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)\n", GetLastError());
+     ok(GetThreadPriority(curthread)==max_priority,
+        "GetThreadPriority didn't return max_priority\n");
+   }
+
 /* Check thread priority boost */
    if (!pGetThreadPriorityBoost || !pSetThreadPriorityBoost) 
      return; /* Win9x */




More information about the wine-cvs mailing list