aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/alloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-10-03 14:16:37 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-10-03 16:52:39 +0000
commitf1eeba4aee1020625205ccf5223128ad8f68265b (patch)
tree02bbe562c1e1c4d4f76e9037a05daf363953f446 /vespalib/src/tests/alloc
parent468fc26fb7f543f4d55e18d381848920047daf75 (diff)
Handle variations to alignment smoother.
Diffstat (limited to 'vespalib/src/tests/alloc')
-rw-r--r--vespalib/src/tests/alloc/alloc_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/vespalib/src/tests/alloc/alloc_test.cpp b/vespalib/src/tests/alloc/alloc_test.cpp
index c1ba982aa32..b16afbcc7a6 100644
--- a/vespalib/src/tests/alloc/alloc_test.cpp
+++ b/vespalib/src/tests/alloc/alloc_test.cpp
@@ -53,7 +53,7 @@ Test::testBasic()
EXPECT_TRUE(h.get() != NULL);
}
{
- EXPECT_EXCEPTION(AlignedHeapAllocFactory::create(100, 0), IllegalArgumentException, "posix_memalign(100, 0) failed with code 22");
+ EXPECT_EXCEPTION(AlignedHeapAllocFactory::create(100, 7), IllegalArgumentException, "AlignedHeapAllocFactory::create(100, 7) does not support 7 alignment");
Alloc h = AlignedHeapAllocFactory::create(100, 1024);
EXPECT_EQUAL(100u, h.size());
EXPECT_TRUE(h.get() != NULL);
@@ -86,13 +86,13 @@ void
Test::testAlignedAllocation()
{
{
- Alloc buf = AutoAllocFactory::create(10, 2048, 1024);
+ Alloc buf = AutoAllocFactory::create(10, MemoryAllocator::HUGEPAGE_SIZE, 1024);
EXPECT_TRUE(reinterpret_cast<ptrdiff_t>(buf.get()) % 1024 == 0);
}
{
// Mmapped pointers are page-aligned, but sanity test anyway.
- Alloc buf = AutoAllocFactory::create(3000, 1024, 512);
+ Alloc buf = AutoAllocFactory::create(3000000, MemoryAllocator::HUGEPAGE_SIZE, 512);
EXPECT_TRUE(reinterpret_cast<ptrdiff_t>(buf.get()) % 512 == 0);
}
}