Files
ArduinoJson/extras/tests/MsgPackDeserializer/misc.cpp

27 lines
596 B
C++
Raw Normal View History

// ArduinoJson - https://arduinojson.org
2023-02-16 11:45:01 +01:00
// Copyright © 2014-2023, Benoit BLANCHON
2020-09-13 10:27:29 +02:00
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
#include <sstream>
2020-09-13 10:27:29 +02:00
TEST_CASE("deserializeMsgPack() returns EmptyInput") {
StaticJsonDocument<100> doc;
SECTION("from sized buffer") {
DeserializationError err = deserializeMsgPack(doc, "", 0);
REQUIRE(err == DeserializationError::EmptyInput);
}
SECTION("from stream") {
std::istringstream input("");
DeserializationError err = deserializeMsgPack(doc, input);
REQUIRE(err == DeserializationError::EmptyInput);
}
}