
Module: ppl/ppl Branch: master Commit: 9a89bb0a926a098a6e06a18c36881786f45d678b URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=9a89bb0a926a0...
Author: Roberto Bagnara bagnara@cs.unipr.it Date: Sat Feb 27 07:33:22 2010 +0100
Exception handling fixed.
---
tests/Polyhedron/watchdog1.cc | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/tests/Polyhedron/watchdog1.cc b/tests/Polyhedron/watchdog1.cc index 5254d53..dd7271e 100644 --- a/tests/Polyhedron/watchdog1.cc +++ b/tests/Polyhedron/watchdog1.cc @@ -81,12 +81,20 @@ timed_compute_open_hypercube_generators(dimension_type dimension, nout << " s" << endl; return false; } +#if !PWL_WATCHDOG_OBJECTS_ARE_SUPPORTED + // If Watchdog objects are not supported, an std::logic_error exception + // will be thrown: this is normal. + catch (const std::logic_error& e) { + nout << "std::logic_error exception caught: \n" << e.what() << std::endl; + exit(0); +} +#endif // !PWL_WATCHDOG_OBJECTS_ARE_SUPPORTED catch (const std::exception& e) { - nout << "unexpected std::exception: \n" << e.what() << endl; + nout << "unexpected std::exception caught: \n" << e.what() << endl; exit(1); } catch (...) { - nout << "unexpected unknown exception" << endl; + nout << "unexpected unknown exception caught" << endl; exit(1); } // Should never get here. @@ -131,13 +139,4 @@ main() TRY {
return 0; } -#if !PWL_WATCHDOG_OBJECTS_ARE_SUPPORTED -// If Watchdog objects are not supported, an exception will be thrown: -// this is normal. -catch (const std::logic_error& e) { - nout << "std::logic_error caught (" << e.what() << ")" - << std::endl; - exit(0); -} -#endif // !PWL_WATCHDOG_OBJECTS_ARE_SUPPORTED CATCH