Fix recursive directory watcher test to check for unexpected events.
This commit is contained in:
parent
e154446a9d
commit
7795195ec1
|
@ -35,7 +35,7 @@ void main()
|
||||||
// test non-recursive watcher
|
// test non-recursive watcher
|
||||||
watcher = eventDriver.watchers.watchDirectory(testDir, false, toDelegate(&testCallback));
|
watcher = eventDriver.watchers.watchDirectory(testDir, false, toDelegate(&testCallback));
|
||||||
assert(watcher != WatcherID.invalid);
|
assert(watcher != WatcherID.invalid);
|
||||||
Thread.sleep(1000.msecs); // some watcher implementations need time to initialize
|
Thread.sleep(400.msecs); // some watcher implementations need time to initialize
|
||||||
testFile( "file1.dat");
|
testFile( "file1.dat");
|
||||||
testFile( "file2.dat");
|
testFile( "file2.dat");
|
||||||
testFile( "dira/file1.dat", false);
|
testFile( "dira/file1.dat", false);
|
||||||
|
@ -50,7 +50,7 @@ void main()
|
||||||
// test recursive watcher
|
// test recursive watcher
|
||||||
watcher = eventDriver.watchers.watchDirectory(testDir, true, toDelegate(&testCallback));
|
watcher = eventDriver.watchers.watchDirectory(testDir, true, toDelegate(&testCallback));
|
||||||
assert(watcher != WatcherID.invalid);
|
assert(watcher != WatcherID.invalid);
|
||||||
Thread.sleep(100.msecs); // some watcher implementations need time to initialize
|
Thread.sleep(400.msecs); // some watcher implementations need time to initialize
|
||||||
testFile( "file1.dat");
|
testFile( "file1.dat");
|
||||||
testFile( "file2.dat");
|
testFile( "file2.dat");
|
||||||
testFile( "dira/file1.dat");
|
testFile( "dira/file1.dat");
|
||||||
|
@ -100,6 +100,8 @@ void expectChange(FileChange ch, bool expect_change)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert(expect_change, "Got change although none was expected.");
|
||||||
|
|
||||||
auto pch = pendingChanges[0];
|
auto pch = pendingChanges[0];
|
||||||
|
|
||||||
// adjust for Windows behavior
|
// adjust for Windows behavior
|
||||||
|
|
Loading…
Reference in a new issue