Debian Codegraph @

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp

raw
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 // REQUIRES: can-create-symlinks
10 // UNSUPPORTED: c++03, c++11, c++14
11 // UNSUPPORTED: no-filesystem
12
13 // <filesystem>
14
15 // class recursive_directory_iterator
16
17 // void disable_recursion_pending();
18
19 #include <filesystem>
20 #include <type_traits>
21 #include <set>
22 #include <cassert>
23
24 #include "test_macros.h"
25 #include "filesystem_test_helper.h"
26 namespace fs = std::filesystem;
27 using namespace fs;
28
29 // NOTE: The main semantics of disable_recursion_pending are tested
30 // in the 'recursion_pending()' tests.
31 static void basic_test()
32 {
33 static_test_env static_env;
34 recursive_directory_iterator it(static_env.Dir);
35 assert(it.recursion_pending() == true);
36 it.disable_recursion_pending();
37 assert(it.recursion_pending() == false);
38 it.disable_recursion_pending();
39 assert(it.recursion_pending() == false);
40 }
41
42 int main(int, char**) {
43 basic_test();
44
45 return 0;
46 }