From 3f04ac27c300efd59ee4e5ae3eb3a3ce1318dcee Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 15 Jun 2023 12:30:28 -0400 Subject: [PATCH] Try catching correct excpetion type --- tests/petsc/petsc_snes_02.cc | 4 ++++ tests/petsc/petsc_snes_02.output | 11 +---------- tests/petsc/petsc_snes_02.output.clang-16 | 11 ----------- tests/petsc/petsc_ts_01.cc | 4 ++++ tests/petsc/petsc_ts_01.output | 12 +----------- tests/petsc/petsc_ts_01.output.clang-16 | 12 ------------ 6 files changed, 10 insertions(+), 44 deletions(-) delete mode 100644 tests/petsc/petsc_snes_02.output.clang-16 delete mode 100644 tests/petsc/petsc_ts_01.output.clang-16 diff --git a/tests/petsc/petsc_snes_02.cc b/tests/petsc/petsc_snes_02.cc index 7975927d9e..d2edd32ac1 100644 --- a/tests/petsc/petsc_snes_02.cc +++ b/tests/petsc/petsc_snes_02.cc @@ -77,6 +77,10 @@ main(int argc, char **argv) AssertThrow(snes == static_cast(mysolver), ExcInternalError()); mysolver.solve(v, A); } + catch (StandardExceptions::ExcFunctionNotProvided) + { + deallog << "catching expected exception" << std::endl; + } catch (std::exception &exc) { deallog << exc.what() << std::endl; diff --git a/tests/petsc/petsc_snes_02.output b/tests/petsc/petsc_snes_02.output index 7d1d25f3b3..049eb1d7ed 100644 --- a/tests/petsc/petsc_snes_02.output +++ b/tests/petsc/petsc_snes_02.output @@ -1,11 +1,2 @@ -DEAL:: --------------------------------------------------------- -An error occurred in file in function - unsigned int dealii::PETScWrappers::NonlinearSolver::solve(VectorType&) [with VectorType = VectorType; PMatrixType = MatrixType; AMatrixType = MatrixType] -The violated condition was: - residual -Additional information: - Please provide an implementation for the function "residual" --------------------------------------------------------- - +DEAL::catching expected exception diff --git a/tests/petsc/petsc_snes_02.output.clang-16 b/tests/petsc/petsc_snes_02.output.clang-16 deleted file mode 100644 index 24f2ed36f1..0000000000 --- a/tests/petsc/petsc_snes_02.output.clang-16 +++ /dev/null @@ -1,11 +0,0 @@ - -DEAL:: --------------------------------------------------------- -An error occurred in file in function - unsigned int dealii::PETScWrappers::NonlinearSolver::solve(VectorType &) [VectorType = VectorType, PMatrixType = MatrixType, AMatrixType = MatrixType] -The violated condition was: - residual -Additional information: - Please provide an implementation for the function "residual" --------------------------------------------------------- - diff --git a/tests/petsc/petsc_ts_01.cc b/tests/petsc/petsc_ts_01.cc index b106465bde..92f7690b2b 100644 --- a/tests/petsc/petsc_ts_01.cc +++ b/tests/petsc/petsc_ts_01.cc @@ -79,6 +79,10 @@ main(int argc, char **argv) AssertThrow(ts == static_cast(myode), ExcInternalError()); myode.solve(v, A); } + catch (StandardExceptions::ExcFunctionNotProvided) + { + deallog << "catching expected exception" << std::endl; + } catch (std::exception &exc) { deallog << exc.what() << std::endl; diff --git a/tests/petsc/petsc_ts_01.output b/tests/petsc/petsc_ts_01.output index 761c7667f5..049eb1d7ed 100644 --- a/tests/petsc/petsc_ts_01.output +++ b/tests/petsc/petsc_ts_01.output @@ -1,12 +1,2 @@ -DEAL:: --------------------------------------------------------- -An error occurred in file in function - unsigned int dealii::PETScWrappers::TimeStepper::solve(VectorType&) [with VectorType = VectorType; PMatrixType = MatrixType; AMatrixType = MatrixType] -The violated condition was: - explicit_function || implicit_function -Additional information: - Please provide an implementation for the function "explicit_function - || implicit_function" --------------------------------------------------------- - +DEAL::catching expected exception diff --git a/tests/petsc/petsc_ts_01.output.clang-16 b/tests/petsc/petsc_ts_01.output.clang-16 deleted file mode 100644 index 745a0ab852..0000000000 --- a/tests/petsc/petsc_ts_01.output.clang-16 +++ /dev/null @@ -1,12 +0,0 @@ - -DEAL:: --------------------------------------------------------- -An error occurred in file in function - unsigned int dealii::PETScWrappers::TimeStepper::solve(VectorType &) [VectorType = VectorType, PMatrixType = MatrixType, AMatrixType = MatrixType] -The violated condition was: - explicit_function || implicit_function -Additional information: - Please provide an implementation for the function "explicit_function - || implicit_function" --------------------------------------------------------- - -- 2.39.5