=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: ntdll/tests: Don' t test function directly when reporting GetLastError().

Alexandre Julliard julliard at winehq.org
Mon Sep 26 16:15:13 CDT 2011


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Sep 25 20:30:40 2011 +0200

ntdll/tests: Don't test function directly when reporting GetLastError().

---

 dlls/ntdll/tests/pipe.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index 8f7bd8f..6909882 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -238,8 +238,10 @@ static DWORD WINAPI thread(PVOID main_thread)
     Sleep(400);
 
     if (main_thread) {
+        DWORD ret;
         userapc_called = FALSE;
-        ok(pQueueUserAPC(&userapc, main_thread, 0), "can't queue user apc, GetLastError: %x\n", GetLastError());
+        ret = pQueueUserAPC(&userapc, main_thread, 0);
+        ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
         CloseHandle(main_thread);
     }
 
@@ -264,6 +266,7 @@ static void test_alertable(void)
     HANDLE hPipe;
     NTSTATUS res;
     HANDLE hThread;
+    DWORD ret;
 
     memset(&iosb, 0x55, sizeof(iosb));
 
@@ -275,7 +278,8 @@ static void test_alertable(void)
 
 /* queue an user apc before calling listen */
     userapc_called = FALSE;
-    ok(pQueueUserAPC(&userapc, GetCurrentThread(), 0), "can't queue user apc, GetLastError: %x\n", GetLastError());
+    ret = pQueueUserAPC(&userapc, GetCurrentThread(), 0);
+    ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
 
     res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
     todo_wine ok(res == STATUS_CANCELLED, "NtFsControlFile returned %x\n", res);
@@ -332,6 +336,7 @@ static void test_nonalertable(void)
     HANDLE hPipe;
     NTSTATUS res;
     HANDLE hThread;
+    DWORD ret;
 
     memset(&iosb, 0x55, sizeof(iosb));
 
@@ -345,7 +350,8 @@ static void test_nonalertable(void)
     ok(hThread != INVALID_HANDLE_VALUE, "can't create thread, GetLastError: %x\n", GetLastError());
 
     userapc_called = FALSE;
-    ok(pQueueUserAPC(&userapc, GetCurrentThread(), 0), "can't queue user apc, GetLastError: %x\n", GetLastError());
+    ret = pQueueUserAPC(&userapc, GetCurrentThread(), 0);
+    ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
 
     res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
     todo_wine ok(!res, "NtFsControlFile returned %x\n", res);




More information about the wine-cvs mailing list