From 5dde9ae45e79d9a27c4d89225990001afc6f9ebc Mon Sep 17 00:00:00 2001 From: miloyip Date: Tue, 14 Apr 2015 09:49:55 +0800 Subject: [PATCH] Cover MemoryPoolAllocator::Capacity() --- test/unittest/documenttest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unittest/documenttest.cpp b/test/unittest/documenttest.cpp index 7adf9b9..6e8370e 100644 --- a/test/unittest/documenttest.cpp +++ b/test/unittest/documenttest.cpp @@ -243,6 +243,10 @@ TEST(Document, UserBuffer) { EXPECT_FALSE(doc.HasParseError()); EXPECT_LE(valueAllocator.Size(), sizeof(valueBuffer)); EXPECT_LE(parseAllocator.Size(), sizeof(parseBuffer)); + + // Cover MemoryPool::Capacity() + EXPECT_LE(valueAllocator.Size(), valueAllocator.Capacity()); + EXPECT_LE(parseAllocator.Size(), parseAllocator.Capacity()); } // Issue 226: Value of string type should not point to NULL