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

Function error_handling_test

test/operations_unit_test.cpp:308–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306// error_handling_test -------------------------------------------------------------//
307
308void error_handling_test()
309{
310 cout << "error handling test..." << endl;
311
312 bool threw(false);
313 try
314 {
315 file_size("no-such-file");
316 }
317 catch (const boost::filesystem::filesystem_error& ex)
318 {
319 threw = true;
320 cout << "\nas expected, attempt to get size of non-existent file threw a filesystem_error\n"
321 "what() returns "
322 << ex.what() << "\n";
323 }
324 catch (...)
325 {
326 cout << "\nunexpected exception type caught" << endl;
327 }
328
329 CHECK(threw);
330
331 error_code ec;
332 CHECK(!create_directory("/", ec));
333}
334
335} // unnamed namespace
336

Callers 1

cpp_mainFunction · 0.85

Calls 3

whatMethod · 0.80
file_sizeFunction · 0.50
create_directoryFunction · 0.50

Tested by

no test coverage detected