forked from bblanchon/ArduinoJson
RawJson()
accepts any kind of string and obeys to duplication rules
This commit is contained in:
@ -84,7 +84,7 @@ TEST_CASE("JsonArray::add()") {
|
||||
REQUIRE(expectedSize == _jsonBuffer.size());
|
||||
}
|
||||
|
||||
SECTION("should duplicate char*") {
|
||||
SECTION("should duplicate char*") {
|
||||
_array.add(const_cast<char*>("world"));
|
||||
const size_t expectedSize = JSON_ARRAY_SIZE(1) + 6;
|
||||
REQUIRE(expectedSize == _jsonBuffer.size());
|
||||
@ -95,4 +95,16 @@ TEST_CASE("JsonArray::add()") {
|
||||
const size_t expectedSize = JSON_ARRAY_SIZE(1) + 6;
|
||||
REQUIRE(expectedSize == _jsonBuffer.size());
|
||||
}
|
||||
|
||||
SECTION("should not duplicate RawJson(const char*)") {
|
||||
_array.add(RawJson("{}"));
|
||||
const size_t expectedSize = JSON_ARRAY_SIZE(1);
|
||||
REQUIRE(expectedSize == _jsonBuffer.size());
|
||||
}
|
||||
|
||||
SECTION("should duplicate RawJson(char*)") {
|
||||
_array.add(RawJson(const_cast<char*>("{}")));
|
||||
const size_t expectedSize = JSON_ARRAY_SIZE(1) + 3;
|
||||
REQUIRE(expectedSize == _jsonBuffer.size());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user