misc.cpp 576 B

123456789101112131415161718192021222324
  1. // ArduinoJson - https://arduinojson.org
  2. // Copyright © 2014-2022, Benoit BLANCHON
  3. // MIT License
  4. #include <ArduinoJson.h>
  5. #include <catch.hpp>
  6. TEST_CASE("deserializeMsgPack() returns EmptyInput") {
  7. StaticJsonDocument<100> doc;
  8. SECTION("from sized buffer") {
  9. DeserializationError err = deserializeMsgPack(doc, "", 0);
  10. REQUIRE(err == DeserializationError::EmptyInput);
  11. }
  12. SECTION("from stream") {
  13. std::istringstream input("");
  14. DeserializationError err = deserializeMsgPack(doc, input);
  15. REQUIRE(err == DeserializationError::EmptyInput);
  16. }
  17. }