TEST_F(StaticJsonBuffer_ParseObject_Tests, TooSmallBufferForObjectWithNestedObject) { StaticJsonBuffer<JSON_OBJECT_SIZE(1) + JSON_ARRAY_SIZE(0) - 1> bufferTooSmall; with(bufferTooSmall); whenInputIs("{\"a\":[]}"); parseMustFail(); }
TEST_F(StaticJsonBuffer_ParseObject_Tests, TooSmallBufferForObjectWithOneValue) { StaticJsonBuffer<JSON_OBJECT_SIZE(1) - 1> bufferTooSmall; with(bufferTooSmall); whenInputIs("{\"a\":1}"); parseMustFail(); }
TEST_F(StaticJsonBuffer_ParseArray_Tests, TooSmallBufferForArrayWithNestedObject) { StaticJsonBuffer<JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(0) - 1> bufferTooSmall; with(bufferTooSmall); whenInputIs("[{}]"); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, ArrayWithNoEnd) { whenInputIs("["); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, MissingOpeningBracket) { whenInputIs("]"); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, AfterClosingStar) { whenInputIs("[/*COMMENT*"); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, EndsInCppComment) { whenInputIs("[//COMMENT"); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, UnfinishedCComment) { whenInputIs("[/*COMMENT]"); parseMustFail(); }
TEST_F(StaticJsonBuffer_ParseArray_Tests, TooSmallBufferForArrayWithOneValue) { StaticJsonBuffer<JSON_ARRAY_SIZE(1) - 1> bufferTooSmall; with(bufferTooSmall); whenInputIs("[1]"); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, ClosingSignleQuoteMissing) { whenInputIs("[\']"); parseMustFail(); }
TEST_F(JsonParser_Object_Test, MissingQuotesAndColonAndValue) { whenInputIs("{key}"); parseMustFail(); }
TEST_F(JsonParser_Object_Test, MissingColonAndValue) { whenInputIs("{\"key\"}"); parseMustFail(); }
TEST_F(JsonParser_Object_Test, MissingClosingBrace) { whenInputIs("{"); parseMustFail(); }
TEST_F(JsonParser_Object_Test, NullForKey) { whenInputIs("null:\"value\"}"); parseMustFail(); }
TEST_F(JsonParser_Object_Test, EndingWithAComma) { whenInputIs("{\"key1\":\"value1\",}"); parseMustFail(); sizeMustBe(0); }
TEST_F(JsonParser_Array_Tests, Garbage) { whenInputIs("%*$£¤"); parseMustFail(); }
TEST_F(StaticJsonBuffer_ParseArray_Tests, TooSmallBufferForEmptyArray) { StaticJsonBuffer<JSON_ARRAY_SIZE(0) - 1> bufferTooSmall; with(bufferTooSmall); whenInputIs("[]"); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, StringWithUnterminatedEscapeSequence) { whenInputIs("\"\\\0\"", 4); parseMustFail(); }
TEST_F(JsonParser_Array_Tests, InvalidComment) { whenInputIs("[/*/\n]"); parseMustFail(); }
TEST_F(StaticJsonBuffer_ParseObject_Tests, TooSmallBufferForEmptyObject) { StaticJsonBuffer<JSON_OBJECT_SIZE(0) - 1> bufferTooSmall; with(bufferTooSmall); whenInputIs("{}"); parseMustFail(); }