Dmitry Timoshkov : kernel32/tests: Add more directory change notification tests.
Alexandre Julliard
julliard at winehq.org
Mon Nov 5 15:51:52 CST 2018
Module: wine
Branch: master
Commit: c055a274e998e1a8e844a646d44bc6302f85ca4c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c055a274e998e1a8e844a646d44bc6302f85ca4c
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Mon Nov 5 13:47:12 2018 +0300
kernel32/tests: Add more directory change notification tests.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/change.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/change.c b/dlls/kernel32/tests/change.c
index f4abad4..3c8084d 100644
--- a/dlls/kernel32/tests/change.c
+++ b/dlls/kernel32/tests/change.c
@@ -254,11 +254,12 @@ static void test_FindFirstChangeNotification(void)
static void test_ffcn(void)
{
DWORD filter;
- HANDLE handle;
+ HANDLE handle, file;
LONG r;
- WCHAR path[MAX_PATH], subdir[MAX_PATH];
+ WCHAR path[MAX_PATH], subdir[MAX_PATH], filename[MAX_PATH];
static const WCHAR szBoo[] = { '\\','b','o','o',0 };
static const WCHAR szHoo[] = { '\\','h','o','o',0 };
+ static const WCHAR szZoo[] = { '\\','z','o','o',0 };
SetLastError(0xdeadbeef);
r = GetTempPathW( MAX_PATH, path );
@@ -275,6 +276,9 @@ static void test_ffcn(void)
lstrcpyW( subdir, path );
lstrcatW( subdir, szHoo );
+ lstrcpyW( filename, path );
+ lstrcatW( filename, szZoo );
+
RemoveDirectoryW( subdir );
RemoveDirectoryW( path );
@@ -290,6 +294,38 @@ static void test_ffcn(void)
r = WaitForSingleObject( handle, 0 );
ok( r == STATUS_TIMEOUT, "should time out\n");
+ file = CreateFileW( filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
+ CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 );
+ ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() );
+ CloseHandle(file);
+
+ r = WaitForSingleObject( handle, 0 );
+ ok( r == WAIT_OBJECT_0, "should be ready\n");
+
+ r = WaitForSingleObject( handle, 0 );
+ ok( r == WAIT_OBJECT_0, "should be ready\n");
+
+ r = FindNextChangeNotification(handle);
+ ok( r == TRUE, "find next failed\n");
+
+ r = WaitForSingleObject( handle, 0 );
+ ok( r == STATUS_TIMEOUT, "should time out\n");
+
+ r = DeleteFileW( filename );
+ ok( r == TRUE, "failed to remove file\n");
+
+ r = WaitForSingleObject( handle, 0 );
+ ok( r == WAIT_OBJECT_0, "should be ready\n");
+
+ r = WaitForSingleObject( handle, 0 );
+ ok( r == WAIT_OBJECT_0, "should be ready\n");
+
+ r = FindNextChangeNotification(handle);
+ ok( r == TRUE, "find next failed\n");
+
+ r = WaitForSingleObject( handle, 0 );
+ ok( r == STATUS_TIMEOUT, "should time out\n");
+
r = CreateDirectoryW( subdir, NULL );
ok( r == TRUE, "failed to create subdir\n");
More information about the wine-cvs
mailing list