Skip to content

Commit

Permalink
can catch exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoPannetier committed Apr 23, 2024
1 parent 0b36338 commit b94b5e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ int _tmain(int argc, _TCHAR* argv[])
return 1;
# else
assert(0.1 > 0.0); // assert does run correctly
run_unit_tests();
try
{
run_unit_tests();
}
catch (const std::exception& e)
{
cerr << endl << "Error: " << e.what() << endl;
}
cout << "All tests have completed." << endl;
return 0; // if tests succeed, we are happy
# endif // NDEBUG
Expand Down

0 comments on commit b94b5e7

Please sign in to comment.