Added a test that adds a 'false' to an array

This commit is contained in:
Benoit Blanchon
2014-06-24 21:17:12 +02:00
parent a27bb3097a
commit 77a3e1737d
2 changed files with 8 additions and 1 deletions

View File

@ -87,7 +87,7 @@ public:
break; break;
case JSON_BOOLEAN: case JSON_BOOLEAN:
append(buffer, bufferSize, "true"); append(buffer, bufferSize, items[i].value.boolean ? "true" : "false");
break; break;
} }
} }

View File

@ -71,6 +71,13 @@ namespace JsonGeneratorTests
AssertJsonIs("[true]"); AssertJsonIs("[true]");
} }
TEST_METHOD(AddFalse)
{
arr.add(false);
AssertJsonIs("[false]");
}
void AssertJsonIs(const char* expected) void AssertJsonIs(const char* expected)
{ {
char buffer[256]; char buffer[256];