From: David Wells Date: Sun, 6 May 2018 02:02:31 +0000 (-0400) Subject: Fix a test to not write past the end of an array. X-Git-Tag: v9.0.0-rc3~9^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ccd10e779cbbc953af640c3db9ba140e62166fb;p=dealii.git Fix a test to not write past the end of an array. --- 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);