| 306 | // error_handling_test -------------------------------------------------------------// |
| 307 | |
| 308 | void 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 |
no test coverage detected