From a40dcb95254a14d6117c5bcc0a9bbf58cee55ae8 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Sat, 30 Aug 2014 18:26:57 +0200 Subject: [PATCH] valuetest: always test comparisons with different allocators --- test/unittest/valuetest.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/test/unittest/valuetest.cpp b/test/unittest/valuetest.cpp index 9324813..d57f943 100644 --- a/test/unittest/valuetest.cpp +++ b/test/unittest/valuetest.cpp @@ -105,20 +105,12 @@ TEST(Value, equalto_operator) { TestEqual(x["i"], 123); TestEqual(x["pi"], 3.14); - // Test operator==() -#ifdef RAPIDJSON_COMPARE_DIFFERENT_ALLOCATORS + // Test operator==() (including different allocators) CrtAllocator crtAllocator; GenericValue, CrtAllocator> y; GenericDocument, CrtAllocator> z(&crtAllocator); - CrtAllocator& yAllocator = crtAllocator; -#else - Value::AllocatorType& yAllocator = allocator; - Value y; - Document z; -#endif // RAPIDJSON_COMPARE_DIFFERENT_ALLOCATORS - y.CopyFrom(x, yAllocator); + y.CopyFrom(x, crtAllocator); z.CopyFrom(y, z.GetAllocator()); - TestEqual(x, y); TestEqual(y, z); TestEqual(z, x); @@ -130,7 +122,7 @@ TEST(Value, equalto_operator) { EXPECT_TRUE(z.RemoveMember("t")); TestUnequal(x, z); TestEqual(y, z); - y.AddMember("t", true, yAllocator); + y.AddMember("t", true, crtAllocator); z.AddMember("t", true, z.GetAllocator()); TestEqual(x, y); TestEqual(y, z);