From 77a3e1737df31be8f726ea43e709645dab0f582f Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Tue, 24 Jun 2014 21:17:12 +0200 Subject: [PATCH] Added a test that adds a 'false' to an array --- JsonGeneratorTests/JsonArray.h | 2 +- JsonGeneratorTests/JsonArrayTests.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/JsonGeneratorTests/JsonArray.h b/JsonGeneratorTests/JsonArray.h index f670e983..9b86d980 100644 --- a/JsonGeneratorTests/JsonArray.h +++ b/JsonGeneratorTests/JsonArray.h @@ -87,7 +87,7 @@ public: break; case JSON_BOOLEAN: - append(buffer, bufferSize, "true"); + append(buffer, bufferSize, items[i].value.boolean ? "true" : "false"); break; } } diff --git a/JsonGeneratorTests/JsonArrayTests.cpp b/JsonGeneratorTests/JsonArrayTests.cpp index 03400c5f..298e4094 100644 --- a/JsonGeneratorTests/JsonArrayTests.cpp +++ b/JsonGeneratorTests/JsonArrayTests.cpp @@ -71,6 +71,13 @@ namespace JsonGeneratorTests AssertJsonIs("[true]"); } + TEST_METHOD(AddFalse) + { + arr.add(false); + + AssertJsonIs("[false]"); + } + void AssertJsonIs(const char* expected) { char buffer[256];