Michael Moss : kernel32/tests: Fix false positive file notification tests.
Alexandre Julliard
julliard at winehq.org
Thu Mar 20 09:48:32 CDT 2008
Module: wine
Branch: master
Commit: ef7c4a8b6daf783773a9ca0f29602d3afab13abf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ef7c4a8b6daf783773a9ca0f29602d3afab13abf
Author: Michael Moss <mmoss at google.com>
Date: Wed Mar 19 15:09:41 2008 -0700
kernel32/tests: Fix false positive file notification tests.
---
dlls/kernel32/tests/change.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/change.c b/dlls/kernel32/tests/change.c
index bb1f73d..b698eaa 100644
--- a/dlls/kernel32/tests/change.c
+++ b/dlls/kernel32/tests/change.c
@@ -39,12 +39,14 @@
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 ) {
+ notified = TRUE;
ret = FindNextChangeNotification(change);
}
@@ -52,7 +54,7 @@ static DWORD CALLBACK NotificationThread(LPVOID arg)
ok( ret, "FindCloseChangeNotification error: %d\n",
GetLastError());
- ExitThread((DWORD)ret);
+ ExitThread((DWORD)notified);
}
static HANDLE StartNotificationThread(LPCSTR path, BOOL subtree, DWORD flags)
@@ -150,7 +152,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);
+ ok(!ret, "Unexpected notification\n");
/* What if we remove the directory we registered notification for? */
thread = StartNotificationThread(dirname2, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME);
More information about the wine-cvs
mailing list