| 716 | } |
| 717 | |
| 718 | void 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 | |