From 8c258405f239aabcb0f62129710922700002bcef Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Mon, 11 May 2015 11:03:50 +0800 Subject: [PATCH] Fix Document.UserBuffer test --- test/unittest/documenttest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unittest/documenttest.cpp b/test/unittest/documenttest.cpp index a6cf8d9..2ee6b10 100644 --- a/test/unittest/documenttest.cpp +++ b/test/unittest/documenttest.cpp @@ -238,10 +238,10 @@ TEST(Document, AcceptWriter) { TEST(Document, UserBuffer) { typedef GenericDocument, MemoryPoolAllocator<>, MemoryPoolAllocator<> > DocumentType; char valueBuffer[4096]; - char parseBuffer[2048]; + char parseBuffer[1024]; MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer)); MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer)); - DocumentType doc(&valueAllocator, sizeof(parseBuffer), &parseAllocator); + DocumentType doc(&valueAllocator, sizeof(parseBuffer) / 2, &parseAllocator); doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } "); EXPECT_FALSE(doc.HasParseError()); EXPECT_LE(valueAllocator.Size(), sizeof(valueBuffer));