From 79fa5b45205c7776cb0bfad669115b6ab297c4b7 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 14 Jul 2023 08:45:16 -0400 Subject: [PATCH] Sanitize parameter_handler_25 output --- .../parameter_handler/parameter_handler_25.cc | 10 ++++-- .../parameter_handler_25.output | 12 ++----- .../parameter_handler_25.output.gcc-12 | 31 ------------------- .../parameter_handler_25.output.std | 31 ------------------- .../parameter_handler_25.output2 | 31 ------------------- 5 files changed, 10 insertions(+), 105 deletions(-) delete mode 100644 tests/parameter_handler/parameter_handler_25.output.gcc-12 delete mode 100644 tests/parameter_handler/parameter_handler_25.output.std delete mode 100644 tests/parameter_handler/parameter_handler_25.output2 diff --git a/tests/parameter_handler/parameter_handler_25.cc b/tests/parameter_handler/parameter_handler_25.cc index fe093f58ae..ee6aa106e3 100644 --- a/tests/parameter_handler/parameter_handler_25.cc +++ b/tests/parameter_handler/parameter_handler_25.cc @@ -93,7 +93,10 @@ fail() } catch (const std::exception &exc) { - deallog << exc.what() << std::endl; + std::string error = exc.what(); + auto start = error.find("The violated condition was:"); + if (start != std::string::npos) + deallog << error.substr(start) << std::endl; } // check set status @@ -103,7 +106,10 @@ fail() } catch (const std::exception &exc) { - deallog << exc.what() << std::endl; + std::string error = exc.what(); + auto start = error.find("The violated condition was:"); + if (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 d139d9cf5d..d1f6e83ac4 100644 --- a/tests/parameter_handler/parameter_handler_25.output +++ b/tests/parameter_handler/parameter_handler_25.output @@ -1,21 +1,13 @@ DEAL:: DEAL::successful -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::set(const std::string &, const std::string &) -The violated condition was: +DEAL::The violated condition was: false Additional information: You can't ask for entry you have not yet declared. -------------------------------------------------------- -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::assert_that_entries_have_been_set() const -The violated condition was: +DEAL::The violated condition was: entries_wrongly_not_set.empty() Additional information: Not all entries of the parameter handler that were declared with diff --git a/tests/parameter_handler/parameter_handler_25.output.gcc-12 b/tests/parameter_handler/parameter_handler_25.output.gcc-12 deleted file mode 100644 index 6985ee4ab8..0000000000 --- a/tests/parameter_handler/parameter_handler_25.output.gcc-12 +++ /dev/null @@ -1,31 +0,0 @@ - -DEAL:: -DEAL::successful -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::set(const std::string&, const std::string&) -The violated condition was: - false -Additional information: - You can't ask for entry you have not yet declared. --------------------------------------------------------- - -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::assert_that_entries_have_been_set() const -The violated condition was: - entries_wrongly_not_set.empty() -Additional information: - Not all entries of the parameter handler that were declared with - `has_to_be_set = true` have been set. The following parameters - - General.Precision - General.dim - - have not been set. A possible reason might be that you did not add - these parameter to the input file or that their spelling is not - correct. --------------------------------------------------------- - diff --git a/tests/parameter_handler/parameter_handler_25.output.std b/tests/parameter_handler/parameter_handler_25.output.std deleted file mode 100644 index d139d9cf5d..0000000000 --- a/tests/parameter_handler/parameter_handler_25.output.std +++ /dev/null @@ -1,31 +0,0 @@ - -DEAL:: -DEAL::successful -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::set(const std::string &, const std::string &) -The violated condition was: - false -Additional information: - You can't ask for entry you have not yet declared. --------------------------------------------------------- - -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::assert_that_entries_have_been_set() const -The violated condition was: - entries_wrongly_not_set.empty() -Additional information: - Not all entries of the parameter handler that were declared with - `has_to_be_set = true` have been set. The following parameters - - General.Precision - General.dim - - have not been set. A possible reason might be that you did not add - these parameter to the input file or that their spelling is not - correct. --------------------------------------------------------- - diff --git a/tests/parameter_handler/parameter_handler_25.output2 b/tests/parameter_handler/parameter_handler_25.output2 deleted file mode 100644 index 62165e4aaf..0000000000 --- a/tests/parameter_handler/parameter_handler_25.output2 +++ /dev/null @@ -1,31 +0,0 @@ - -DEAL:: -DEAL::successful -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::set(const std::__cxx11::basic_string, std::allocator> &, const std::__cxx11::basic_string, std::allocator> &) -The violated condition was: - false -Additional information: - You can't ask for entry you have not yet declared. --------------------------------------------------------- - -DEAL:: --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::assert_that_entries_have_been_set() const -The violated condition was: - entries_wrongly_not_set.empty() -Additional information: - Not all entries of the parameter handler that were declared with - `has_to_be_set = true` have been set. The following parameters - - General.Precision - General.dim - - have not been set. A possible reason might be that you did not add - these parameter to the input file or that their spelling is not - correct. --------------------------------------------------------- - -- 2.39.5