From b825b8ba3cb0178bd0e4e45031be76817957b4e0 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 25 Jan 2006 13:13:58 +0100 Subject: [PATCH] kernel: Test moving a directory that has a change notification registered for itself. --- dlls/kernel/tests/change.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dlls/kernel/tests/change.c b/dlls/kernel/tests/change.c index 4e0877b29b3..5afe4fef498 100644 --- a/dlls/kernel/tests/change.c +++ b/dlls/kernel/tests/change.c @@ -136,12 +136,21 @@ static void test_FindFirstChangeNotification(void) lstrcpyA(dirname1, filename1); lstrcatA(dirname1, "dir"); + lstrcpyA(dirname2, dirname1); + lstrcatA(dirname2, "new"); + ret = CreateDirectoryA(dirname1, NULL); ok(ret, "CreateDirectoryA error: %ld\n", GetLastError()); - /* What if we remove the directory we registered notification for? */ + /* What if we move the directory we registered notification for? */ thread = StartNotificationThread(dirname1, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); - ret = RemoveDirectoryA(dirname1); + ret = MoveFileA(dirname1, dirname2); + ok(ret, "MoveFileA error: %ld\n", GetLastError()); + ok(FinishNotificationThread(thread), "Missed notification\n"); + + /* What if we remove the directory we registered notification for? */ + thread = StartNotificationThread(dirname2, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); + ret = RemoveDirectoryA(dirname2); ok(ret, "RemoveDirectoryA error: %ld\n", GetLastError()); /* win98 and win2k behave differently here */ @@ -156,9 +165,6 @@ static void test_FindFirstChangeNotification(void) ok(ret, "CreateDirectoryA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n"); - lstrcpyA(dirname2, dirname1); - lstrcatA(dirname2, "new"); - /* Rename a directory */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); ret = MoveFileA(dirname1, dirname2);