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

Function query_test

test/operations_unit_test.cpp:87–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 // query_test ----------------------------------------------------------------------//
86
87 void query_test()
88 {
89 cout << "query test..." << endl;
90
91 error_code ec;
92
93 CHECK(file_size("no-such-file", ec) == static_cast<boost::uintmax_t>(-1));
94 CHECK(ec == errc::no_such_file_or_directory);
95
96 CHECK(status("no-such-file") == file_status(file_not_found, no_perms));
97
98 CHECK(exists("/"));
99 CHECK(is_directory("/"));
100 CHECK(!exists("no-such-file"));
101
102 exists("/", ec);
103 if (ec)
104 {
105 cout << "exists(\"/\", ec) resulted in non-zero ec.value()" << endl;
106 cout << "ec value: " << ec.value() << ", message: "<< ec.message() << endl;
107 }
108 CHECK(!ec);
109
110 CHECK(exists("/"));
111 CHECK(is_directory("/"));
112 CHECK(!is_regular_file("/"));
113 CHECK(!boost::filesystem::is_empty("/"));
114 CHECK(!is_other("/"));
115 }
116
117 // directory_iterator_test -----------------------------------------------//
118

Callers 1

cpp_mainFunction · 0.85

Calls 9

file_sizeFunction · 0.85
statusFunction · 0.85
file_statusFunction · 0.85
existsFunction · 0.85
is_directoryFunction · 0.85
is_regular_fileFunction · 0.85
is_otherFunction · 0.85
messageMethod · 0.80
is_emptyFunction · 0.50

Tested by

no test coverage detected