MCPcopy Create free account
hub / github.com/boostorg/filesystem / recursive_directory_iterator_tests

Function recursive_directory_iterator_tests

test/operations_test.cpp:718–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718void recursive_directory_iterator_tests()
719{
720 cout << "recursive_directory_iterator_tests..." << endl;
721 BOOST_TEST_EQ(walk_tree(false), 1);
722 if (create_symlink_ok)
723 BOOST_TEST(walk_tree(true) > 1);
724
725 // test iterator increment with error_code argument
726 cout << " with error_code argument" << endl;
727 boost::system::error_code ec;
728 int d1f1_count = 0;
729 fs::recursive_directory_iterator it(dir, fs::directory_options::none);
730 fs::recursive_directory_iterator it2(it); // test single pass shallow copy semantics
731 for (;
732 it != fs::recursive_directory_iterator();
733 it.increment(ec))
734 {
735 //std::cout << " iterator path: " << it->path().string() << std::endl;
736 if (it->path().filename() == "d1f1")
737 ++d1f1_count;
738 BOOST_TEST(it == it2); // verify single pass shallow copy semantics
739 }
740 if (ec)
741 cout << " iterator increment returned error: " << ec << ", " << ec.message() << endl;
742 BOOST_TEST(!ec);
743 BOOST_TEST_EQ(d1f1_count, 1);
744 BOOST_TEST(it == it2); // verify single pass shallow copy semantics
745
746 cout << " recursive_directory_iterator_tests complete" << endl;
747}
748
749// iterator_status_tests -----------------------------------------------------------//
750

Callers 1

cpp_mainFunction · 0.85

Calls 6

walk_treeFunction · 0.85
filenameMethod · 0.80
pathMethod · 0.80
incrementMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected