kernel32/tests: Fix false positive file notification tests.

Michael Moss mmoss at google.com
Tue Mar 18 14:27:34 CDT 2008


Commit 3714a398 reused 'ret' in a way inconsistent with the original meaning of
that variable, allowing tests to pass even when they weren't receiving the
expected notifications. This change adds another variable to restore the
original meaning and make it explicit.
---
 dlls/kernel32/tests/change.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/tests/change.c b/dlls/kernel32/tests/change.c
index bb1f73d..da1b82f 100644
--- a/dlls/kernel32/tests/change.c
+++ b/dlls/kernel32/tests/change.c
@@ -39,20 +39,21 @@
 static DWORD CALLBACK NotificationThread(LPVOID arg)
 {
     HANDLE change = (HANDLE) arg;
+    BOOL notified = FALSE;
     BOOL ret = FALSE;
     DWORD status;
 
     status = WaitForSingleObject(change, 100);
 
     if (status == WAIT_OBJECT_0 ) {
-        ret = FindNextChangeNotification(change);
+        notified = FindNextChangeNotification(change);
     }
 
     ret = FindCloseChangeNotification(change);
     ok( ret, "FindCloseChangeNotification error: %d\n",
        GetLastError());
 
-    ExitThread((DWORD)ret);
+    ExitThread((DWORD)notified);
 }
 
 static HANDLE StartNotificationThread(LPCSTR path, BOOL subtree, DWORD flags)
@@ -150,7 +151,8 @@ static void test_FindFirstChangeNotification(void)
     thread = StartNotificationThread(dirname1, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME);
     ret = MoveFileA(dirname1, dirname2);
     ok(ret, "MoveFileA error: %d\n", GetLastError());
-    ok(FinishNotificationThread(thread), "Missed notification\n");
+    ret = FinishNotificationThread(thread);
+    todo_wine ok(ret, "Missed notification\n");
 
     /* What if we remove the directory we registered notification for? */
     thread = StartNotificationThread(dirname2, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME);
-- 
1.5.3.GIT




More information about the wine-patches mailing list