mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-23 23:37:37 +02:00
Test: split JsonDocument.cpp
into multiple files
This commit is contained in:
22
extras/tests/JsonDocument/capacity.cpp
Normal file
22
extras/tests/JsonDocument/capacity.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright © 2014-2023, Benoit BLANCHON
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("JsonDocument") {
|
||||
JsonDocument doc(4096);
|
||||
|
||||
SECTION("capacity()") {
|
||||
SECTION("matches constructor argument") {
|
||||
JsonDocument doc2(256);
|
||||
REQUIRE(doc2.capacity() == 256);
|
||||
}
|
||||
|
||||
SECTION("rounds up constructor argument") {
|
||||
JsonDocument doc2(253);
|
||||
REQUIRE(doc2.capacity() == 256);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user