| 670 | |
| 671 | |
| 672 | void printLastException(std::ostream& out) |
| 673 | { |
| 674 | std::exception_ptr ex = std::current_exception(); |
| 675 | try |
| 676 | { |
| 677 | std::rethrow_exception(ex); |
| 678 | } |
| 679 | catch (::OpenMS::Exception::BaseException& e) |
| 680 | { |
| 681 | TEST::this_test = false; |
| 682 | TEST::test = false; |
| 683 | TEST::all_tests = false; |
| 684 | { |
| 685 | TEST::initialNewline(); |
| 686 | out << "Error: Caught unexpected OpenMS exception of type '" << e.getName() << "'"; |
| 687 | if ((e.getLine() > 0) && std::strcmp(e.getFile(), "")) |
| 688 | { |
| 689 | out << " thrown in line " << e.getLine() << " of file '" << e.getFile() << "' in function '" << e.getFunction() << "'"; |
| 690 | } |
| 691 | out << " - Message: " << e.what() << std::endl; |
| 692 | } |
| 693 | } /* catch std:: exceptions */ |
| 694 | catch (std::exception& e) |
| 695 | { |
| 696 | TEST::this_test = false; |
| 697 | TEST::test = false; |
| 698 | TEST::all_tests = false; |
| 699 | { |
| 700 | TEST::initialNewline(); |
| 701 | out << "Error: Caught unexpected std::exception\n"; |
| 702 | out << " - Message: " << e.what() << std::endl; |
| 703 | } |
| 704 | } /* catch all other exceptions */ |
| 705 | catch (...) |
| 706 | { |
| 707 | TEST::this_test = false; |
| 708 | TEST::test = false; |
| 709 | TEST::all_tests = false; |
| 710 | { |
| 711 | TEST::initialNewline(); |
| 712 | out << "Error: Caught unidentified and unexpected exception - No message." << std::endl; |
| 713 | } |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | int endTestPostProcess(std::ostream& out) |
| 718 | { |
nothing calls this directly
no test coverage detected