aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/alloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-04 17:34:38 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-01-04 17:34:38 +0100
commitf2e6790f4db230e61fbd2e433cf5b07a14a73d1e (patch)
treeb943f01effbea3ce9c691db79f0fd0e0af49bd5d /vespalib/src/tests/alloc
parent5742e7a4501b283b09270224c48cdcef3dfa58e0 (diff)
Update comment according to @geirst's comments.
Add test as suggested by @vekterli.
Diffstat (limited to 'vespalib/src/tests/alloc')
-rw-r--r--vespalib/src/tests/alloc/alloc_test.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/vespalib/src/tests/alloc/alloc_test.cpp b/vespalib/src/tests/alloc/alloc_test.cpp
index f614ca79f04..5da06091796 100644
--- a/vespalib/src/tests/alloc/alloc_test.cpp
+++ b/vespalib/src/tests/alloc/alloc_test.cpp
@@ -158,8 +158,6 @@ TEST("auto alloced mmap alloc can not be extended if no room") {
// Normally mmapping starts at the top and grows down in address space.
// Then there is no room to extend the last mapping.
- // So in order to verify this we first mmap a reserved area that we unmap
- // before we test extension.
EXPECT_GREATER(reserved.get(), buf.get());
EXPECT_EQUAL(reserved.get(), static_cast<const char *>(buf.get()) + buf.size());
@@ -197,8 +195,6 @@ TEST("mmap alloc can not be extended if no room") {
// Normally mmapping starts at the top and grows down in address space.
// Then there is no room to extend the last mapping.
- // So in order to verify this we first mmap a reserved area that we unmap
- // before we test extension.
EXPECT_GREATER(reserved.get(), buf.get());
EXPECT_EQUAL(reserved.get(), static_cast<const char *>(buf.get()) + buf.size());
@@ -257,6 +253,9 @@ TEST("auto alloced mmap alloc can not be shrinked below HUGEPAGE_SIZE/2 + 1 ") {
EXPECT_FALSE(buf.resize_inplace(SZ/2));
EXPECT_EQUAL(oldPtr, buf.get());
EXPECT_EQUAL(SZ, buf.size());
+ EXPECT_TRUE(buf.resize_inplace(SZ));
+ EXPECT_EQUAL(oldPtr, buf.get());
+ EXPECT_EQUAL(SZ, buf.size());
}
TEST_MAIN() { TEST_RUN_ALL(); }