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

Function remove_tests

test/operations_test.cpp:1225–1251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1223 // remove_tests --------------------------------------------------------------------//
1224
1225 void remove_tests(const fs::path& dir)
1226 {
1227 cout << "remove_tests..." << endl;
1228
1229 // remove() file
1230 fs::path f1 = dir / "shortlife";
1231 BOOST_TEST(!fs::exists(f1));
1232 create_file(f1, "");
1233 BOOST_TEST(fs::exists(f1));
1234 BOOST_TEST(!fs::is_directory(f1));
1235 BOOST_TEST(fs::remove(f1));
1236 BOOST_TEST(!fs::exists(f1));
1237 BOOST_TEST(!fs::remove("no-such-file"));
1238 BOOST_TEST(!fs::remove("no-such-directory/no-such-file"));
1239
1240 // remove() directory
1241 fs::path d1 = dir / "shortlife_dir";
1242 BOOST_TEST(!fs::exists(d1));
1243 fs::create_directory(d1);
1244 BOOST_TEST(fs::exists(d1));
1245 BOOST_TEST(fs::is_directory(d1));
1246 BOOST_TEST(fs::is_empty(d1));
1247 bad_remove_dir = dir;
1248 BOOST_TEST(CHECK_EXCEPTION(bad_remove, ENOTEMPTY));
1249 BOOST_TEST(fs::remove(d1));
1250 BOOST_TEST(!fs::exists(d1));
1251 }
1252
1253 // remove_symlink_tests ------------------------------------------------------------//
1254

Callers 1

cpp_mainFunction · 0.85

Calls 6

existsFunction · 0.85
create_fileFunction · 0.85
is_directoryFunction · 0.85
removeFunction · 0.50
create_directoryFunction · 0.50
is_emptyFunction · 0.50

Tested by

no test coverage detected