forked from bblanchon/ArduinoJson
Switched to Google coding style to match cpplint expectations
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
using namespace ArduinoJson;
|
||||
|
||||
class JsonArray_PrettyPrintTo_Tests : public testing::Test {
|
||||
protected:
|
||||
protected:
|
||||
JsonArray array;
|
||||
StaticJsonBuffer<30> json;
|
||||
|
||||
@ -24,7 +24,7 @@ protected:
|
||||
EXPECT_EQ(strlen(expected), n);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
char buffer[256];
|
||||
};
|
||||
|
||||
@ -33,29 +33,32 @@ TEST_F(JsonArray_PrettyPrintTo_Tests, Empty) { outputMustBe("[]"); }
|
||||
TEST_F(JsonArray_PrettyPrintTo_Tests, OneElement) {
|
||||
array.add(1);
|
||||
|
||||
outputMustBe("[\r\n"
|
||||
" 1\r\n"
|
||||
"]");
|
||||
outputMustBe(
|
||||
"[\r\n"
|
||||
" 1\r\n"
|
||||
"]");
|
||||
}
|
||||
|
||||
TEST_F(JsonArray_PrettyPrintTo_Tests, TwoElements) {
|
||||
array.add(1);
|
||||
array.add(2);
|
||||
|
||||
outputMustBe("[\r\n"
|
||||
" 1,\r\n"
|
||||
" 2\r\n"
|
||||
"]");
|
||||
outputMustBe(
|
||||
"[\r\n"
|
||||
" 1,\r\n"
|
||||
" 2\r\n"
|
||||
"]");
|
||||
}
|
||||
|
||||
TEST_F(JsonArray_PrettyPrintTo_Tests, EmptyNestedArrays) {
|
||||
array.createNestedArray();
|
||||
array.createNestedArray();
|
||||
|
||||
outputMustBe("[\r\n"
|
||||
" [],\r\n"
|
||||
" []\r\n"
|
||||
"]");
|
||||
outputMustBe(
|
||||
"[\r\n"
|
||||
" [],\r\n"
|
||||
" []\r\n"
|
||||
"]");
|
||||
}
|
||||
|
||||
TEST_F(JsonArray_PrettyPrintTo_Tests, NestedArrays) {
|
||||
@ -66,13 +69,14 @@ TEST_F(JsonArray_PrettyPrintTo_Tests, NestedArrays) {
|
||||
JsonObject nested2 = array.createNestedObject();
|
||||
nested2["key"] = 3;
|
||||
|
||||
outputMustBe("[\r\n"
|
||||
" [\r\n"
|
||||
" 1,\r\n"
|
||||
" 2\r\n"
|
||||
" ],\r\n"
|
||||
" {\r\n"
|
||||
" \"key\": 3\r\n"
|
||||
" }\r\n"
|
||||
"]");
|
||||
outputMustBe(
|
||||
"[\r\n"
|
||||
" [\r\n"
|
||||
" 1,\r\n"
|
||||
" 2\r\n"
|
||||
" ],\r\n"
|
||||
" {\r\n"
|
||||
" \"key\": 3\r\n"
|
||||
" }\r\n"
|
||||
"]");
|
||||
}
|
Reference in New Issue
Block a user