misc.cpp 596 B

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