From 5ccd10e779cbbc953af640c3db9ba140e62166fb Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 5 May 2018 22:02:31 -0400 Subject: [PATCH] Fix a test to not write past the end of an array. --- tests/matrix_free/matrix_vector_faces_18.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/matrix_free/matrix_vector_faces_18.cc b/tests/matrix_free/matrix_vector_faces_18.cc index f5b5c6ec6c..036731fd68 100644 --- a/tests/matrix_free/matrix_vector_faces_18.cc +++ b/tests/matrix_free/matrix_vector_faces_18.cc @@ -80,13 +80,16 @@ void test () refinements_left[1] = 5; refinements_right[1] = 5; refinements_bottom[1] = 1; - refinements_left[2] = 4; - refinements_right[2] = 4; - refinements_bottom[2] = 4; refinements_left[0] = 10; refinements_right[0] = 20; refinements_bottom[0] = 20; + if (dim == 3) + { + refinements_left[2] = 4; + refinements_right[2] = 4; + refinements_bottom[2] = 4; + } GridGenerator::subdivided_hyper_rectangle(left, refinements_left,left_one,left_two,false); GridGenerator::subdivided_hyper_rectangle(right, refinements_right,right_one,right_two,false); GridGenerator::subdivided_hyper_rectangle(bottom, refinements_bottom,bottom_one,bottom_two,false); -- 2.39.5