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.1.0-rc1~1209^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a0601a12a9fbfe3ed1834f795f85c70d275aee1;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);