]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
for regression tests: if abort() is disabled in assert(), throw the exception instead...
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 15 Feb 2013 05:08:26 +0000 (05:08 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 15 Feb 2013 05:08:26 +0000 (05:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@28399 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/exceptions.h
deal.II/source/base/exceptions.cc

index 822a0f7fe757eb5134fd9d516acec85f53675905..5ef1d87a262b8234129580fd9cb9609e09b378be 100644 (file)
@@ -192,7 +192,9 @@ namespace deal_II_exceptions
 
   /**
    * Calling this function switches off the use of std::abort() when an
-   * exception is created using the Assert() macro. Generally, you want
+   * exception is created using the Assert() macro. Instead, the Exception
+   * will be thrown using 'throw', so it can be caught if desired.
+   *  Generally, you want
    * to abort the execution of a program when Assert() is called, but it
    * needs to be switched off if you want to log all exceptions created,
    * or if you want to test if an assertion is working correctly. This is
index 63bc7dd9ae95e9a738db72cb81ca96fb9c9e7b63..90367a2cd8a4f5c876fb1ac5f8b9a902dd5d21f3 100644 (file)
@@ -428,7 +428,10 @@ namespace deal_II_exceptions
       else if (deal_II_exceptions::abort_on_exception == true)
         std::abort ();
       else
-        --n_treated_exceptions;
+        {
+          --n_treated_exceptions;
+          throw e;
+        }
     }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.