From 93b167e358a6651dfe5c5665bfba7d69b9b9a161 Mon Sep 17 00:00:00 2001 From: heister Date: Fri, 15 Feb 2013 22:31:47 +0000 Subject: [PATCH] fix tests (throw in assert change) git-svn-id: https://svn.dealii.org/trunk@28412 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/block_mask_02.cc | 8 +++++++- tests/fe/block_mask_06.cc | 11 +++++++++-- tests/fe/block_mask_06/cmp/generic | 1 - tests/fe/block_mask_07.cc | 23 ++++++++++++++++++----- tests/fe/block_mask_07/cmp/generic | 1 - tests/fe/component_mask_02.cc | 8 +++++++- tests/fe/component_mask_06.cc | 11 +++++++++-- tests/fe/component_mask_06/cmp/generic | 1 - tests/fe/component_mask_07.cc | 21 +++++++++++++++++---- tests/fe/component_mask_07/cmp/generic | 1 - tests/fe/component_mask_14.cc | 8 +++++++- tests/fe/component_mask_14/cmp/generic | 16 ---------------- 12 files changed, 74 insertions(+), 36 deletions(-) diff --git a/tests/fe/block_mask_02.cc b/tests/fe/block_mask_02.cc index 5de1640906..e0f69cf13d 100644 --- a/tests/fe/block_mask_02.cc +++ b/tests/fe/block_mask_02.cc @@ -39,7 +39,13 @@ void test () Assert (m[i] == v[i], ExcInternalError()); // this needs to throw an exception - m[v.size()]; + try + { + m[v.size()]; + } + catch (...) + { + } deallog << "OK" << std::endl; } diff --git a/tests/fe/block_mask_06.cc b/tests/fe/block_mask_06.cc index ae4806ec24..db9d79c139 100644 --- a/tests/fe/block_mask_06.cc +++ b/tests/fe/block_mask_06.cc @@ -44,8 +44,15 @@ void test () // this now must throw an exception, // though: - Assert (BlockMask(12,true).n_selected_blocks(13) == 12, - ExcInternalError()); + try + { + Assert (BlockMask(12,true).n_selected_blocks(13) == 12, + ExcInternalError()); + } + catch (...) + { + } + } diff --git a/tests/fe/block_mask_06/cmp/generic b/tests/fe/block_mask_06/cmp/generic index ad52b7c16b..1d6e01e408 100644 --- a/tests/fe/block_mask_06/cmp/generic +++ b/tests/fe/block_mask_06/cmp/generic @@ -1,4 +1,3 @@ DEAL::OK DEAL::ExcDimensionMismatch((n),(size())) -DEAL::ExcDimensionMismatch((real_n),(block_mask.size())) diff --git a/tests/fe/block_mask_07.cc b/tests/fe/block_mask_07.cc index b8f771bd28..65d3af7b22 100644 --- a/tests/fe/block_mask_07.cc +++ b/tests/fe/block_mask_07.cc @@ -45,11 +45,24 @@ void test () deallog << "OK" << std::endl; // the following should yield an exception: - Assert (BlockMask(12,true).first_selected_block(13) == 0, - ExcInternalError()); - // as should this: - Assert (BlockMask(12,false).first_selected_block() == 0, - ExcInternalError()); + try + { + Assert (BlockMask(12,true).first_selected_block(13) == 0, + ExcInternalError()); + } + catch (...) + { + } + + // as should this: + try + { + Assert (BlockMask(12,false).first_selected_block() == 0, + ExcInternalError()); + } + catch (...) + { + } } diff --git a/tests/fe/block_mask_07/cmp/generic b/tests/fe/block_mask_07/cmp/generic index 52f4cc407b..13c0ee31da 100644 --- a/tests/fe/block_mask_07/cmp/generic +++ b/tests/fe/block_mask_07/cmp/generic @@ -2,4 +2,3 @@ DEAL::OK DEAL::ExcDimensionMismatch((n),(size())) DEAL::ExcMessage ("No block is selected at all!") -DEAL::ExcInternalError() diff --git a/tests/fe/component_mask_02.cc b/tests/fe/component_mask_02.cc index 2a333727b6..f814f7a677 100644 --- a/tests/fe/component_mask_02.cc +++ b/tests/fe/component_mask_02.cc @@ -39,7 +39,13 @@ void test () Assert (m[i] == v[i], ExcInternalError()); // this needs to throw an exception - m[v.size()]; + try + { + m[v.size()]; + } + catch (...) + { + } deallog << "OK" << std::endl; } diff --git a/tests/fe/component_mask_06.cc b/tests/fe/component_mask_06.cc index 4328cd2635..c95d4ffc92 100644 --- a/tests/fe/component_mask_06.cc +++ b/tests/fe/component_mask_06.cc @@ -44,8 +44,15 @@ void test () // this now must throw an exception, // though: - Assert (ComponentMask(12,true).n_selected_components(13) == 12, - ExcInternalError()); + try + { + Assert (ComponentMask(12,true).n_selected_components(13) == 12, + ExcInternalError()); + } + catch (...) + { + } + } diff --git a/tests/fe/component_mask_06/cmp/generic b/tests/fe/component_mask_06/cmp/generic index d6c5311bbc..1d6e01e408 100644 --- a/tests/fe/component_mask_06/cmp/generic +++ b/tests/fe/component_mask_06/cmp/generic @@ -1,4 +1,3 @@ DEAL::OK DEAL::ExcDimensionMismatch((n),(size())) -DEAL::ExcDimensionMismatch((real_n),(component_mask.size())) diff --git a/tests/fe/component_mask_07.cc b/tests/fe/component_mask_07.cc index bc9ae66041..016638bb20 100644 --- a/tests/fe/component_mask_07.cc +++ b/tests/fe/component_mask_07.cc @@ -45,11 +45,24 @@ void test () deallog << "OK" << std::endl; // the following should yield an exception: - Assert (ComponentMask(12,true).first_selected_component(13) == 0, - ExcInternalError()); + try + { + Assert (ComponentMask(12,true).first_selected_component(13) == 0, + ExcInternalError()); + } + catch (...) + { + } + // as should this: - Assert (ComponentMask(12,false).first_selected_component() == 0, - ExcInternalError()); + try + { + Assert (ComponentMask(12,false).first_selected_component() == 0, + ExcInternalError()); + } + catch (...) + { + } } diff --git a/tests/fe/component_mask_07/cmp/generic b/tests/fe/component_mask_07/cmp/generic index 26c4dfbf8a..7e58605874 100644 --- a/tests/fe/component_mask_07/cmp/generic +++ b/tests/fe/component_mask_07/cmp/generic @@ -2,4 +2,3 @@ DEAL::OK DEAL::ExcDimensionMismatch((n),(size())) DEAL::ExcMessage ("No component is selected at all!") -DEAL::ExcInternalError() diff --git a/tests/fe/component_mask_14.cc b/tests/fe/component_mask_14.cc index 49e1259e1c..a7fb80f369 100644 --- a/tests/fe/component_mask_14.cc +++ b/tests/fe/component_mask_14.cc @@ -47,7 +47,13 @@ void test () // now try to convert to a block // mask. this should not always // work - deallog << fe.block_mask (component_mask) << std::endl; + try + { + deallog << fe.block_mask (component_mask) << std::endl; + } + catch (...) + { + } } deallog << "OK" << std::endl; diff --git a/tests/fe/component_mask_14/cmp/generic b/tests/fe/component_mask_14/cmp/generic index 7d18a36dd5..6144c6bab2 100644 --- a/tests/fe/component_mask_14/cmp/generic +++ b/tests/fe/component_mask_14/cmp/generic @@ -1,34 +1,18 @@ DEAL::[false,false] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[true,false] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[false,false] DEAL::[true,false] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[false,true] -DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[true,true] -DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[false,true] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[true,true] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[false,false] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[true,false] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[false,false] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[true,false] DEAL::[false,true] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[true,true] DEAL::ExcMessage ("The component mask argument given to this function " "is not a mask where the individual components belonging " "to one block of the finite element are either all " "selected or not selected. You can't call this function " "with a component mask that splits blocks.") -DEAL::[false,true] DEAL::[true,true] DEAL::OK -- 2.39.5