Issue214.cpp 489 B

12345678910111213141516
  1. // Copyright Benoit Blanchon 2014-2017
  2. // MIT License
  3. //
  4. // Arduino JSON library
  5. // https://github.com/bblanchon/ArduinoJson
  6. // If you like this project, please add a star!
  7. #include <ArduinoJson.h>
  8. #include <gtest/gtest.h>
  9. TEST(Issue214, IsBool) {
  10. char json[] = "{\"ota\": {\"enabled\": true}}";
  11. StaticJsonBuffer<JSON_OBJECT_SIZE(1) + JSON_OBJECT_SIZE(1)> jsonBuffer;
  12. JsonObject& parsedJson = jsonBuffer.parseObject(json);
  13. ASSERT_TRUE(parsedJson["ota"]["enabled"].is<bool>());
  14. }