1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++98, c++03
10 
11 // <filesystem>
12 
13 // class recursive_directory_iterator
14 
15 // void disable_recursion_pending();
16 
17 #include "filesystem_include.h"
18 #include <type_traits>
19 #include <set>
20 #include <cassert>
21 
22 #include "test_macros.h"
23 #include "rapid-cxx-test.h"
24 #include "filesystem_test_helper.h"
25 
26 using namespace fs;
27 
28 TEST_SUITE(recursive_directory_iterator_disable_recursion_pending_tests)
29 
30 // NOTE: The main semantics of disable_recursion_pending are tested
31 // in the 'recursion_pending()' tests.
32 TEST_CASE(basic_test)
33 {
34     recursive_directory_iterator it(StaticEnv::Dir);
35     TEST_REQUIRE(it.recursion_pending() == true);
36     it.disable_recursion_pending();
37     TEST_CHECK(it.recursion_pending() == false);
38     it.disable_recursion_pending();
39     TEST_CHECK(it.recursion_pending() == false);
40 }
41 
42 TEST_SUITE_END()
43