Home | History | Annotate | Download | only in rec.dir.itr.members
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // UNSUPPORTED: c++98, c++03
     11 
     12 // <experimental/filesystem>
     13 
     14 // class recursive_directory_iterator
     15 
     16 // void disable_recursion_pending();
     17 
     18 #include <experimental/filesystem>
     19 #include <type_traits>
     20 #include <set>
     21 #include <cassert>
     22 
     23 #include "test_macros.h"
     24 #include "rapid-cxx-test.hpp"
     25 #include "filesystem_test_helper.hpp"
     26 
     27 using namespace std::experimental::filesystem;
     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