]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust a test.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 2 Feb 2024 18:54:57 +0000 (11:54 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 2 Feb 2024 18:55:12 +0000 (11:55 -0700)
tests/parameter_handler/parameter_handler_25.cc
tests/parameter_handler/parameter_handler_25.output

index ee6aa106e3c670472f4efeb681409ead24fb1e1a..4a2f8769f3348867bb04daa7eebf7c5dcb12d551 100644 (file)
@@ -93,9 +93,17 @@ fail()
     }
   catch (const std::exception &exc)
     {
+      // Print everything after the "violated condition" part
+      // of the error message, assuming the condition is shown.
+      // If it isn't (because the condition was simply 'false' and
+      // so the error printing part suppresses this part), then
+      // show the part after "Additional information":
       std::string error = exc.what();
-      auto        start = error.find("The violated condition was:");
-      if (start != std::string::npos)
+      if (auto start = error.find("The violated condition was:");
+          start != std::string::npos)
+        deallog << error.substr(start) << std::endl;
+      else if (auto start = error.find("Additional information:");
+               start != std::string::npos)
         deallog << error.substr(start) << std::endl;
     }
 
@@ -106,9 +114,13 @@ fail()
     }
   catch (const std::exception &exc)
     {
+      // Same as above:
       std::string error = exc.what();
-      auto        start = error.find("The violated condition was:");
-      if (start != std::string::npos)
+      if (auto start = error.find("The violated condition was:");
+          start != std::string::npos)
+        deallog << error.substr(start) << std::endl;
+      else if (auto start = error.find("Additional information:");
+               start != std::string::npos)
         deallog << error.substr(start) << std::endl;
     }
 }
index d1f6e83ac49774e36b4d3c1b0e979b660a0f8763..fdd698c260e83aafcb5bd8b07a903bed91c81ede 100644 (file)
@@ -1,9 +1,7 @@
 
 DEAL::
 DEAL::successful
-DEAL::The violated condition was: 
-    false
-Additional information: 
+DEAL::Additional information: 
     You can't ask for entry <Precison> you have not yet declared.
 --------------------------------------------------------
 

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.