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

Function directory_entry_test

test/operations_unit_test.cpp:268–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266// directory_entry_test ------------------------------------------------------------//
267
268void directory_entry_test(path const& temp_dir)
269{
270 cout << "directory_entry test..." << endl;
271
272 create_file(temp_dir / "foo.bar");
273 create_file(temp_dir / "goo.bar");
274 create_directory(temp_dir / "bar.foo");
275
276 directory_entry de(temp_dir / "foo.bar");
277
278 CHECK(de.path() == temp_dir / "foo.bar");
279 CHECK(de.status().type() == regular_file);
280 CHECK(de.symlink_status().type() == regular_file);
281 CHECK(de.is_regular_file());
282 CHECK(de < directory_entry(temp_dir / "goo.bar"));
283 CHECK(de == directory_entry(temp_dir / "foo.bar"));
284 CHECK(de != directory_entry(temp_dir / "goo.bar"));
285 de.replace_filename("bar.foo");
286 CHECK(de.path() == temp_dir / "bar.foo");
287 CHECK(de.is_directory());
288 CHECK(de.status().type() == directory_file);
289 CHECK(de.symlink_status().type() == directory_file);
290
291 boost::filesystem::remove(temp_dir / "bar.foo");
292 boost::filesystem::remove(temp_dir / "goo.bar");
293 boost::filesystem::remove(temp_dir / "foo.bar");
294}
295
296// directory_entry_overload_test ---------------------------------------------------//
297

Callers 1

cpp_mainFunction · 0.85

Calls 9

pathMethod · 0.80
typeMethod · 0.80
statusMethod · 0.80
symlink_statusMethod · 0.80
replace_filenameMethod · 0.80
create_fileFunction · 0.70
create_directoryFunction · 0.50
directory_entryFunction · 0.50
removeFunction · 0.50

Tested by

no test coverage detected