forked from bblanchon/ArduinoJson
serializeMsgPack(doc, p, n) doesn't add terminator anymore (fixes #1545)
This commit is contained in:
@ -39,15 +39,15 @@ void common_tests(StringWriter& sb, const String& output) {
|
||||
}
|
||||
|
||||
TEST_CASE("StaticStringWriter") {
|
||||
char output[20];
|
||||
char output[20] = {0};
|
||||
StaticStringWriter sb(output, sizeof(output));
|
||||
|
||||
common_tests(sb, static_cast<const char*>(output));
|
||||
|
||||
SECTION("OverCapacity") {
|
||||
REQUIRE(19 == print(sb, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
|
||||
REQUIRE(20 == print(sb, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
|
||||
REQUIRE(0 == print(sb, "ABC"));
|
||||
REQUIRE(std::string("ABCDEFGHIJKLMNOPQRS") == output);
|
||||
REQUIRE("ABCDEFGHIJKLMNOPQRST" == std::string(output, 20));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user