Switched to Google coding style to match cpplint expectations

This commit is contained in:
Benoit Blanchon
2014-10-23 23:13:13 +02:00
parent 5c8283b3e4
commit b43da1e421
47 changed files with 262 additions and 308 deletions

View File

@ -11,7 +11,7 @@
using namespace ArduinoJson;
class JsonObject_PrettyPrintTo_Tests : public testing::Test {
protected:
protected:
JsonObject object;
StaticJsonBuffer<30> json;
@ -23,7 +23,7 @@ protected:
EXPECT_EQ(strlen(expected), n);
}
private:
private:
char buffer[256];
};
@ -32,29 +32,32 @@ TEST_F(JsonObject_PrettyPrintTo_Tests, EmptyObject) { outputMustBe("{}"); }
TEST_F(JsonObject_PrettyPrintTo_Tests, OneMember) {
object["key"] = "value";
outputMustBe("{\r\n"
" \"key\": \"value\"\r\n"
"}");
outputMustBe(
"{\r\n"
" \"key\": \"value\"\r\n"
"}");
}
TEST_F(JsonObject_PrettyPrintTo_Tests, TwoMembers) {
object["key1"] = "value1";
object["key2"] = "value2";
outputMustBe("{\r\n"
" \"key1\": \"value1\",\r\n"
" \"key2\": \"value2\"\r\n"
"}");
outputMustBe(
"{\r\n"
" \"key1\": \"value1\",\r\n"
" \"key2\": \"value2\"\r\n"
"}");
}
TEST_F(JsonObject_PrettyPrintTo_Tests, EmptyNestedContainers) {
object.createNestedObject("key1");
object.createNestedArray("key2");
outputMustBe("{\r\n"
" \"key1\": {},\r\n"
" \"key2\": []\r\n"
"}");
outputMustBe(
"{\r\n"
" \"key1\": {},\r\n"
" \"key2\": []\r\n"
"}");
}
TEST_F(JsonObject_PrettyPrintTo_Tests, NestedContainers) {
@ -64,12 +67,13 @@ TEST_F(JsonObject_PrettyPrintTo_Tests, NestedContainers) {
JsonArray nested2 = object.createNestedArray("key2");
nested2.add(2);
outputMustBe("{\r\n"
" \"key1\": {\r\n"
" \"a\": 1\r\n"
" },\r\n"
" \"key2\": [\r\n"
" 2\r\n"
" ]\r\n"
"}");
outputMustBe(
"{\r\n"
" \"key1\": {\r\n"
" \"a\": 1\r\n"
" },\r\n"
" \"key2\": [\r\n"
" 2\r\n"
" ]\r\n"
"}");
}