mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-19 13:32:24 +02:00
Generator: added a test with two numbers in an array
This commit is contained in:
@ -16,14 +16,14 @@ namespace JsonGeneratorTests
|
||||
AssertJsonIs("[]");
|
||||
}
|
||||
|
||||
TEST_METHOD(OneString)
|
||||
TEST_METHOD(AddOneString)
|
||||
{
|
||||
arr.add("hello");
|
||||
|
||||
AssertJsonIs("['hello']");
|
||||
}
|
||||
|
||||
TEST_METHOD(TwoStrings)
|
||||
TEST_METHOD(AddTwoStrings)
|
||||
{
|
||||
arr.add("hello");
|
||||
arr.add("world");
|
||||
@ -31,7 +31,7 @@ namespace JsonGeneratorTests
|
||||
AssertJsonIs("['hello','world']");
|
||||
}
|
||||
|
||||
TEST_METHOD(OverCapacity)
|
||||
TEST_METHOD(AddOneStringOverCapacity)
|
||||
{
|
||||
arr.add("hello");
|
||||
arr.add("world");
|
||||
@ -40,13 +40,21 @@ namespace JsonGeneratorTests
|
||||
AssertJsonIs("['hello','world']");
|
||||
}
|
||||
|
||||
TEST_METHOD(OneNumber)
|
||||
TEST_METHOD(AddOneNumber)
|
||||
{
|
||||
arr.add(3.14);
|
||||
|
||||
AssertJsonIs("[3.14]");
|
||||
}
|
||||
|
||||
TEST_METHOD(AddTwoNumbers)
|
||||
{
|
||||
arr.add(3.14);
|
||||
arr.add(2.72);
|
||||
|
||||
AssertJsonIs("[3.14,2.72]");
|
||||
}
|
||||
|
||||
void AssertJsonIs(const char* expected)
|
||||
{
|
||||
char buffer[256];
|
||||
|
@ -53,7 +53,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<UseFullPaths>true</UseFullPaths>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
Reference in New Issue
Block a user