Merge pull request #6747 from ludv1x:master

pull/6609/merge
Alexander Alekhin 9 years ago
commit e98c1bfb53
  1. 2
      modules/core/include/opencv2/core/utility.hpp
  2. 14
      modules/core/test/test_utils.cpp

@ -817,10 +817,10 @@ AutoBuffer<_Tp, fixed_size>::allocate(size_t _size)
return;
}
deallocate();
sz = _size;
if(_size > fixed_size)
{
ptr = new _Tp[_size];
sz = _size;
}
}

@ -27,6 +27,7 @@ TEST(CommandLineParser, testFailure)
parser.get<bool>("h");
EXPECT_FALSE(parser.check());
}
TEST(CommandLineParser, testHas_noValues)
{
const char* argv[] = {"<bin>", "-h", "--info"};
@ -218,4 +219,17 @@ TEST(CommandLineParser, positional_regression_5074_equal_sign)
EXPECT_TRUE(parser.check());
}
TEST(AutoBuffer, allocate_test)
{
AutoBuffer<int, 5> abuf(2);
EXPECT_EQ(2, abuf.size());
abuf.allocate(4);
EXPECT_EQ(4, abuf.size());
abuf.allocate(6);
EXPECT_EQ(6, abuf.size());
}
} // namespace

Loading…
Cancel
Save