aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Support/AllocatorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Support/AllocatorTest.cpp')
-rw-r--r--unittests/Support/AllocatorTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/unittests/Support/AllocatorTest.cpp b/unittests/Support/AllocatorTest.cpp
index cb9fa43..bcf6bf1 100644
--- a/unittests/Support/AllocatorTest.cpp
+++ b/unittests/Support/AllocatorTest.cpp
@@ -33,7 +33,7 @@ TEST(AllocatorTest, Basics) {
// Allocate enough bytes to create three slabs.
TEST(AllocatorTest, ThreeSlabs) {
- BumpPtrAllocator Alloc(4096, 4096);
+ BumpPtrAllocator Alloc;
Alloc.Allocate(3000, 0);
EXPECT_EQ(1U, Alloc.GetNumSlabs());
Alloc.Allocate(3000, 0);
@@ -45,7 +45,7 @@ TEST(AllocatorTest, ThreeSlabs) {
// Allocate enough bytes to create two slabs, reset the allocator, and do it
// again.
TEST(AllocatorTest, TestReset) {
- BumpPtrAllocator Alloc(4096, 4096);
+ BumpPtrAllocator Alloc;
Alloc.Allocate(3000, 0);
EXPECT_EQ(1U, Alloc.GetNumSlabs());
Alloc.Allocate(3000, 0);
@@ -81,7 +81,7 @@ TEST(AllocatorTest, TestAlignment) {
// Test allocating just over the slab size. This tests a bug where before the
// allocator incorrectly calculated the buffer end pointer.
TEST(AllocatorTest, TestOverflow) {
- BumpPtrAllocator Alloc(4096, 4096);
+ BumpPtrAllocator Alloc;
// Fill the slab right up until the end pointer.
Alloc.Allocate(4096 - sizeof(MemSlab), 0);
@@ -94,9 +94,9 @@ TEST(AllocatorTest, TestOverflow) {
// Test allocating with a size larger than the initial slab size.
TEST(AllocatorTest, TestSmallSlabSize) {
- BumpPtrAllocator Alloc(128);
+ BumpPtrAllocator Alloc;
- Alloc.Allocate(200, 0);
+ Alloc.Allocate(8000, 0);
EXPECT_EQ(2U, Alloc.GetNumSlabs());
}
@@ -141,7 +141,7 @@ public:
// will not.
TEST(AllocatorTest, TestBigAlignment) {
MockSlabAllocator SlabAlloc;
- BumpPtrAllocator Alloc(4096, 4096, SlabAlloc);
+ BumpPtrAllocator Alloc(SlabAlloc);
uintptr_t Ptr = (uintptr_t)Alloc.Allocate(3000, 2048);
MemSlab *Slab = SlabAlloc.GetLastSlab();
EXPECT_LE(Ptr + 3000, ((uintptr_t)Slab) + Slab->Size);