From: Wolfgang Bangerth Date: Fri, 2 Feb 2024 18:54:57 +0000 (-0700) Subject: Adjust a test. X-Git-Tag: relicensing~74^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d947597c678819ec2a03ffd34c3105f4b3c5f66;p=dealii.git Adjust a test. --- diff --git a/tests/parameter_handler/parameter_handler_25.cc b/tests/parameter_handler/parameter_handler_25.cc index ee6aa106e3..4a2f8769f3 100644 --- a/tests/parameter_handler/parameter_handler_25.cc +++ b/tests/parameter_handler/parameter_handler_25.cc @@ -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; } } diff --git a/tests/parameter_handler/parameter_handler_25.output b/tests/parameter_handler/parameter_handler_25.output index d1f6e83ac4..fdd698c260 100644 --- a/tests/parameter_handler/parameter_handler_25.output +++ b/tests/parameter_handler/parameter_handler_25.output @@ -1,9 +1,7 @@ DEAL:: DEAL::successful -DEAL::The violated condition was: - false -Additional information: +DEAL::Additional information: You can't ask for entry you have not yet declared. --------------------------------------------------------