mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-15 11:36:36 +02:00
Increased test coverage of MessagePack serialization
This commit is contained in:
@ -21,10 +21,9 @@ static void check(const JsonArray array, const char (&expected_data)[N]) {
|
||||
check(array, expected_data, expected_len);
|
||||
}
|
||||
|
||||
// TODO: this function is used by the commented test
|
||||
// static void check(const JsonArray array, const std::string& expected) {
|
||||
// check(array, expected.data(), expected.length());
|
||||
// }
|
||||
static void check(const JsonArray array, const std::string& expected) {
|
||||
check(array, expected.data(), expected.length());
|
||||
}
|
||||
|
||||
TEST_CASE("serialize MsgPack array") {
|
||||
DynamicJsonDocument doc;
|
||||
@ -49,12 +48,11 @@ TEST_CASE("serialize MsgPack array") {
|
||||
"\x0E\x0F");
|
||||
}
|
||||
|
||||
// TODO: this test is too slow
|
||||
// SECTION("array 32") {
|
||||
// const char* nil = 0;
|
||||
// for (int i = 0; i < 65536; i++) array.add(nil);
|
||||
//
|
||||
// check(array,
|
||||
// std::string("\xDD\x00\x01\x00\x00", 5) + std::string(65536, 0xC0));
|
||||
// }
|
||||
SECTION("array 32") {
|
||||
const char* nil = 0;
|
||||
for (int i = 0; i < 65536; i++) array.add(nil);
|
||||
|
||||
check(array,
|
||||
std::string("\xDD\x00\x01\x00\x00", 5) + std::string(65536, '\xc0'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user