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];