mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-22 23:07:29 +02:00
committed by
Benoit Blanchon
parent
cd4bf33132
commit
18a9a5b590
@ -3,6 +3,7 @@
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <array>
|
||||
#include <catch.hpp>
|
||||
|
||||
template <typename T>
|
||||
@ -146,6 +147,17 @@ TEST_CASE("serialize MsgPack value") {
|
||||
checkVariant(serialized("\xDB\x00\x01\x00\x00", 5), "\xDB\x00\x01\x00\x00");
|
||||
}
|
||||
|
||||
SECTION("bin 8") {
|
||||
auto str = std::string(1, 1);
|
||||
checkVariant(MsgPackBinary(str.data(), str.size()), "\xC4\x01\x01");
|
||||
}
|
||||
|
||||
SECTION("bin 16") {
|
||||
auto str = std::string(256, 1);
|
||||
checkVariant(MsgPackBinary(str.data(), str.size()),
|
||||
std::string("\xC5\x01\x00", 3) + str);
|
||||
}
|
||||
|
||||
SECTION("serialize round double as integer") { // Issue #1718
|
||||
checkVariant(-32768.0, "\xD1\x80\x00");
|
||||
checkVariant(-129.0, "\xD1\xFF\x7F");
|
||||
|
Reference in New Issue
Block a user