From 0bdec847eda5bb34e930c2c6a6878891976c571d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 1 Nov 2018 10:21:59 -0600 Subject: [PATCH] Remove try-catch blocks in tests. --- .../dynamic_sparsity_pattern_iterator_01.cc | 31 +--------------- .../dynamic_sparsity_pattern_iterator_02.cc | 31 +--------------- .../dynamic_sparsity_pattern_iterator_03.cc | 31 +--------------- .../dynamic_sparsity_pattern_iterator_04.cc | 31 +--------------- .../dynamic_sparsity_pattern_iterator_05.cc | 37 ++----------------- .../dynamic_sparsity_pattern_iterator_06.cc | 33 +---------------- .../dynamic_sparsity_pattern_iterator_07.cc | 31 +--------------- .../dynamic_sparsity_pattern_iterator_08.cc | 31 +--------------- .../sparsity/sparsity_pattern_iterator_01.cc | 31 +--------------- .../sparsity/sparsity_pattern_iterator_07.cc | 31 +--------------- .../sparsity/sparsity_pattern_iterator_08.cc | 31 +--------------- 11 files changed, 15 insertions(+), 334 deletions(-) diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_01.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_01.cc index a301e4059a..f43b0415f7 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_01.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_01.cc @@ -46,34 +46,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_02.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_02.cc index 5e1f7e519b..fc0d721546 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_02.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_02.cc @@ -49,34 +49,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_03.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_03.cc index d455f2984a..82aeb94cf1 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_03.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_03.cc @@ -54,34 +54,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_04.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_04.cc index ee30a64cb6..664db7f0b7 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_04.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_04.cc @@ -116,34 +116,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_05.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_05.cc index 79d0a2969e..ef6ef4b8d3 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_05.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_05.cc @@ -50,37 +50,8 @@ main() { initlog(); - try - { - test(false, false); - test(true, false); - test(false, true); - test(true, true); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(false, false); + test(true, false); + test(false, true); + test(true, true); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_06.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_06.cc index c28ce80206..8ee4e18ee9 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_06.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_06.cc @@ -49,35 +49,6 @@ main() { initlog(); - try - { - test(false); - test(true); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(false); + test(true); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_07.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_07.cc index 94e3af2216..14bedad286 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_07.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_07.cc @@ -44,34 +44,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/dynamic_sparsity_pattern_iterator_08.cc b/tests/sparsity/dynamic_sparsity_pattern_iterator_08.cc index 288d6000e6..64018e8f1e 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_iterator_08.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_iterator_08.cc @@ -44,34 +44,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/sparsity_pattern_iterator_01.cc b/tests/sparsity/sparsity_pattern_iterator_01.cc index f511bacfc0..b585a3eb0e 100644 --- a/tests/sparsity/sparsity_pattern_iterator_01.cc +++ b/tests/sparsity/sparsity_pattern_iterator_01.cc @@ -46,34 +46,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/sparsity_pattern_iterator_07.cc b/tests/sparsity/sparsity_pattern_iterator_07.cc index 350812553b..269c8f0175 100644 --- a/tests/sparsity/sparsity_pattern_iterator_07.cc +++ b/tests/sparsity/sparsity_pattern_iterator_07.cc @@ -46,34 +46,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } diff --git a/tests/sparsity/sparsity_pattern_iterator_08.cc b/tests/sparsity/sparsity_pattern_iterator_08.cc index 1461a11a67..7edb136d13 100644 --- a/tests/sparsity/sparsity_pattern_iterator_08.cc +++ b/tests/sparsity/sparsity_pattern_iterator_08.cc @@ -44,34 +44,5 @@ main() { initlog(); - try - { - test(); - } - catch (std::exception &exc) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - deallog << std::endl - << std::endl - << "----------------------------------------------------" - << std::endl; - deallog << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; + test(); } -- 2.39.5