From: JINMEI Tatuya Date: Fri, 12 Apr 2013 23:52:33 +0000 (-0700) Subject: [2831] clarified the check after repeated shrinkToFit. X-Git-Tag: bind10-1.2.0beta1-release~457^2~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3877992c69722447eeb9e4819bdadc64fb44754c;p=thirdparty%2Fkea.git [2831] clarified the check after repeated shrinkToFit. --- diff --git a/src/lib/util/tests/memory_segment_mapped_unittest.cc b/src/lib/util/tests/memory_segment_mapped_unittest.cc index e64aed6697..fcb55e7007 100644 --- a/src/lib/util/tests/memory_segment_mapped_unittest.cc +++ b/src/lib/util/tests/memory_segment_mapped_unittest.cc @@ -439,8 +439,11 @@ TEST_F(MemorySegmentMappedTest, shrink) { const size_t shrinked_size = segment_->getSize(); EXPECT_GT(DEFAULT_INITIAL_SIZE, shrinked_size); - // Another shrink shouldn't cause disruption, and the size shouldn't - // change. + // Another shrink shouldn't cause disruption. We expect the size is + // the same so we confirm it. The underlying library doesn't guarantee + // that, so we may have to change it to EXPECT_GE if the test fails + // on that (MemorySegmentMapped class doesn't rely on this expectation, + // so it's okay even if it does not always hold). segment_->shrinkToFit(); EXPECT_EQ(shrinked_size, segment_->getSize());