47 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// REQUIRES: can-create-symlinks10// UNSUPPORTED: c++03, c++11, c++1411// UNSUPPORTED: no-filesystem12 13// <filesystem>14 15// class recursive_directory_iterator16 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"26namespace fs = std::filesystem;27using namespace fs;28 29// NOTE: The main semantics of disable_recursion_pending are tested30// in the 'recursion_pending()' tests.31static 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 42int main(int, char**) {43 basic_test();44 45 return 0;46}47