summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-03-30 11:36:32 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-03-30 11:36:32 +0000
commit0331a894cdf46d8186e74cf855dab19775695adc (patch)
treeb35aa2fa35360cabc8aac2c284b8aa247820172f /unittests
parent7c5042f86b4ad7d3fce819dbf9f6a215bef852c5 (diff)
downloadllvm-0331a894cdf46d8186e74cf855dab19775695adc.tar.gz
llvm-0331a894cdf46d8186e74cf855dab19775695adc.tar.bz2
llvm-0331a894cdf46d8186e74cf855dab19775695adc.tar.xz
[Allocator] Simplify unittests by using the default size parameters in
more places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/AllocatorTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/unittests/Support/AllocatorTest.cpp b/unittests/Support/AllocatorTest.cpp
index cb9fa43036..4cd0163f2f 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());
}