capacity.cpp 479 B

12345678910111213141516171819202122
  1. // ArduinoJson - https://arduinojson.org
  2. // Copyright © 2014-2023, Benoit BLANCHON
  3. // MIT License
  4. #include <ArduinoJson.h>
  5. #include <catch.hpp>
  6. TEST_CASE("JsonDocument") {
  7. JsonDocument doc(4096);
  8. SECTION("capacity()") {
  9. SECTION("matches constructor argument") {
  10. JsonDocument doc2(256);
  11. REQUIRE(doc2.capacity() == 256);
  12. }
  13. SECTION("rounds up constructor argument") {
  14. JsonDocument doc2(253);
  15. REQUIRE(doc2.capacity() == 256);
  16. }
  17. }
  18. }