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

Function verify_file

test/copy_test.cpp:40–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void verify_file(fs::path const& ph, std::string const& expected)
41{
42 std::ifstream f(BOOST_FILESYSTEM_C_STR(ph));
43 if (!f)
44 BOOST_THROW_EXCEPTION(std::runtime_error("Failed to open file: " + ph.string()));
45 std::string contents;
46 f >> contents;
47 BOOST_TEST_EQ(contents, expected);
48 if (contents != expected)
49 {
50 BOOST_THROW_EXCEPTION(std::runtime_error("verify_file failed: contents \"" + contents + "\" != \"" + expected + "\" in " + ph.string()));
51 }
52}
53
54fs::path create_tree()
55{

Callers 5

test_copy_file_defaultFunction · 0.70
test_copy_dir_defaultFunction · 0.70
test_copy_dir_default_ecFunction · 0.70
test_copy_dir_recursiveFunction · 0.70
test_copy_file_symlinksFunction · 0.70

Calls 1

stringMethod · 0.80

Tested by

no test coverage detected