Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2019-09-10 22:39:23 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2019-09-10 22:39:23 +0300
commit42c2a4d09add1c0e1c37de0c4036a5ba2a3d6e52 (patch)
tree1d2573fdc188ffdd54766ce39f74b37996135415 /test
parenta302c5ab2f601c0116fb62c6b21dec4a143550e9 (diff)
Fix issue #27 Enumerating empty directories causes infinite loop on Windows
Diffstat (limited to 'test')
-rw-r--r--test/tests/issue0027.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/tests/issue0027.cpp b/test/tests/issue0027.cpp
new file mode 100644
index 00000000..f976d144
--- /dev/null
+++ b/test/tests/issue0027.cpp
@@ -0,0 +1,36 @@
+/* Integration test kernel for issue #27 Enumerating empty directories causes infinite loop
+(C) 2019 Niall Douglas <http://www.nedproductions.biz/> (2 commits)
+File Created: Sept 2019
+
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License in the accompanying file
+Licence.txt or at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file Licence.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include "../test_kernel_decl.hpp"
+
+static inline void TestIssue27()
+{
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ auto dh = llfio::directory({}, "testdir", llfio::directory_handle::mode::write, llfio::directory_handle::creation::if_needed).value();
+ llfio::directory_entry buffer[16];
+ auto contents = dh.read({buffer}).value();
+ BOOST_CHECK_EQUAL(contents.size(), 0);
+}
+
+KERNELTEST_TEST_KERNEL(regression, llfio, issues, 27, "Tests issue #27 Enumerating empty directories causes infinite loop", TestIssue27())