Implement MsgPackBinary using raw strings and converters

This commit is contained in:
Benoit Blanchon
2024-05-01 19:27:23 +02:00
parent 002b07f0c5
commit 2c670e0148
12 changed files with 130 additions and 133 deletions

View File

@ -189,19 +189,7 @@ static std::string msgPackToJson(const char* input, size_t inputSize) {
return doc.as<std::string>();
}
TEST_CASE("deserializeMsgPack() replaces unsupported types by null") {
SECTION("bin 8") {
REQUIRE(msgPackToJson("\x92\xc4\x01X\x2A", 5) == "[null,42]");
}
SECTION("bin 16") {
REQUIRE(msgPackToJson("\x92\xc5\x00\x01X\x2A", 6) == "[null,42]");
}
SECTION("bin 32") {
REQUIRE(msgPackToJson("\x92\xc6\x00\x00\x00\x01X\x2A", 8) == "[null,42]");
}
TEST_CASE("deserializeMsgPack() replaces ext types by null") {
SECTION("ext 8") {
REQUIRE(msgPackToJson("\x92\xc7\x01\x01\x01\x2A", 6) == "[null,42]");
}