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 // FILE_DEPENDENCIES: ../../Inputs/static_test_env 10 // UNSUPPORTED: c++98, c++03 11 12 // <filesystem> 13 14 // class recursive_directory_iterator 15 16 // void disable_recursion_pending(); 17 18 #include "filesystem_include.h" 19 #include <type_traits> 20 #include <set> 21 #include <cassert> 22 23 #include "test_macros.h" 24 #include "rapid-cxx-test.h" 25 #include "filesystem_test_helper.h" 26 27 using namespace fs; 28 29 TEST_SUITE(recursive_directory_iterator_disable_recursion_pending_tests) 30 31 // NOTE: The main semantics of disable_recursion_pending are tested 32 // in the 'recursion_pending()' tests. 33 TEST_CASE(basic_test) 34 { 35 recursive_directory_iterator it(StaticEnv::Dir); 36 TEST_REQUIRE(it.recursion_pending() == true); 37 it.disable_recursion_pending(); 38 TEST_CHECK(it.recursion_pending() == false); 39 it.disable_recursion_pending(); 40 TEST_CHECK(it.recursion_pending() == false); 41 } 42 43 TEST_SUITE_END() 44