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

Function status_of_nonexistent_tests

test/operations_test.cpp:1323–1351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321// status_of_nonexistent_tests -----------------------------------------------------//
1322
1323void status_of_nonexistent_tests()
1324{
1325 cout << "status_of_nonexistent_tests..." << endl;
1326 fs::path p("nosuch");
1327 BOOST_TEST(!fs::exists(p));
1328 BOOST_TEST(!fs::is_regular_file(p));
1329 BOOST_TEST(!fs::is_directory(p));
1330 BOOST_TEST(!fs::is_symlink(p));
1331 BOOST_TEST(!fs::is_other(p));
1332
1333 fs::file_status s = fs::status(p);
1334 BOOST_TEST(!fs::exists(s));
1335 BOOST_TEST_EQ(s.type(), fs::file_not_found);
1336 BOOST_TEST(fs::type_present(s));
1337 BOOST_TEST(!fs::is_regular_file(s));
1338 BOOST_TEST(!fs::is_directory(s));
1339 BOOST_TEST(!fs::is_symlink(s));
1340 BOOST_TEST(!fs::is_other(s));
1341
1342 // ticket #12574 was just user confusion, but are the tests are worth keeping
1343 error_code ec;
1344 BOOST_TEST(!fs::is_directory(dir / "no-such-directory", ec));
1345 BOOST_TEST(ec);
1346 //cout << "error_code value: " << ec.value() << endl;
1347 ec.clear();
1348 BOOST_TEST(!fs::is_directory(dir / "no-such-directory" / "bar", ec));
1349 BOOST_TEST(ec);
1350 //cout << "error_code value: " << ec.value() << endl;
1351}
1352
1353// status_error_reporting_tests ----------------------------------------------------//
1354

Callers 1

cpp_mainFunction · 0.85

Calls 9

typeMethod · 0.80
clearMethod · 0.80
existsFunction · 0.50
is_regular_fileFunction · 0.50
is_directoryFunction · 0.50
is_symlinkFunction · 0.50
is_otherFunction · 0.50
statusFunction · 0.50
type_presentFunction · 0.50

Tested by

no test coverage detected