From: Evan Shelhamer Date: Wed, 23 Sep 2015 20:38:29 +0000 (-0700) Subject: [test] TestReshape: check small then large X-Git-Tag: submit/tizen/20180823.020014~351^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74e174537418b6a3c0c8708e444edf45ab491e94;p=platform%2Fupstream%2Fcaffeonacl.git [test] TestReshape: check small then large checking large then small can mask failure since the smaller shape memory will fit within the larger shape. --- diff --git a/src/caffe/test/test_net.cpp b/src/caffe/test/test_net.cpp index 12998d8..ec01053 100644 --- a/src/caffe/test/test_net.cpp +++ b/src/caffe/test/test_net.cpp @@ -2269,8 +2269,10 @@ TYPED_TEST(NetTest, TestReshape) { FillerParameter filler_param; filler_param.set_std(1); GaussianFiller filler(filler_param); - Blob blob1(4, 3, 9, 11); - Blob blob2(2, 3, 12, 10); + // Check smaller shape first as larger first could hide realloc failures. + Blob blob1(2, 3, 12, 10); + Blob blob2(4, 3, 9, 11); + ASSERT_LT(blob1.count(), blob2.count()); filler.Fill(&blob1); filler.Fill(&blob2);