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++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. TEST_CASE(basic_test)32TEST_CASE(basic_test) 33 { 34 static_test_env static_env; 35 recursive_directory_iterator it(static_env.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