From d84c051564b735d438e45f0a0c1657575813c9c8 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Mon, 11 Aug 2014 16:11:57 +0200 Subject: [PATCH] jsoncheckertest: add checks for iterative parser as well --- test/unittest/jsoncheckertest.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/unittest/jsoncheckertest.cpp b/test/unittest/jsoncheckertest.cpp index 75ef3e8..f4169dc 100644 --- a/test/unittest/jsoncheckertest.cpp +++ b/test/unittest/jsoncheckertest.cpp @@ -65,8 +65,11 @@ TEST(JsonChecker, Reader) { } GenericDocument, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak) - if (!document.Parse((const char*)json).HasParseError()) - ADD_FAILURE_AT(filename, document.GetErrorOffset()); + document.Parse((const char*)json); + EXPECT_TRUE(document.HasParseError()); + + document.Parse((const char*)json); + EXPECT_TRUE(document.HasParseError()); free(json); } @@ -87,7 +90,11 @@ TEST(JsonChecker, Reader) { GenericDocument, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak) document.Parse((const char*)json); - EXPECT_TRUE(!document.HasParseError()); + EXPECT_FALSE(document.HasParseError()); + + document.Parse((const char*)json); + EXPECT_FALSE(document.HasParseError()); + free(json); } }