From 74e174537418b6a3c0c8708e444edf45ab491e94 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Wed, 23 Sep 2015 13:38:29 -0700 Subject: [PATCH] [test] TestReshape: check small then large checking large then small can mask failure since the smaller shape memory will fit within the larger shape. --- src/caffe/test/test_net.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.7.4