| 311 | } |
| 312 | |
| 313 | void TestFixture::assertNoThrowFail(const char * const filename, const unsigned int linenr, bool bailout) const |
| 314 | { |
| 315 | std::string ex_msg; |
| 316 | |
| 317 | try { |
| 318 | // cppcheck-suppress rethrowNoCurrentException |
| 319 | throw; |
| 320 | } |
| 321 | catch (const AssertFailedError&) { |
| 322 | return; |
| 323 | } |
| 324 | catch (const InternalError& e) { |
| 325 | ex_msg = e.errorMessage; |
| 326 | } |
| 327 | catch (const std::exception& e) { |
| 328 | ex_msg = e.what(); |
| 329 | } |
| 330 | catch (...) { |
| 331 | ex_msg = "unknown exception"; |
| 332 | } |
| 333 | |
| 334 | ++fails_counter; |
| 335 | errmsg << getLocationStr(filename, linenr) << ": Assertion failed. " |
| 336 | << "Unexpected exception was thrown: " << ex_msg << std::endl << "_____" << std::endl; |
| 337 | if (bailout) |
| 338 | throw AssertFailedError(); |
| 339 | } |
| 340 | |
| 341 | void TestFixture::printHelp() |
| 342 | { |
nothing calls this directly
no test coverage detected