Changed BasicJsonDocument's copy-constructor to copy the capacity

This commit is contained in:
Benoit Blanchon
2020-03-02 12:31:36 +01:00
parent c1b3705df1
commit 0853b04589
5 changed files with 71 additions and 36 deletions

View File

@ -91,7 +91,7 @@ TEST_CASE("DynamicJsonDocument constructor") {
REQUIRE_JSON(doc2, "{\"hello\":\"world\"}");
REQUIRE(doc2.capacity() == addPadding(doc1.memoryUsage()));
REQUIRE(doc2.capacity() == doc1.capacity());
}
SECTION("Construct from StaticJsonDocument") {
@ -101,7 +101,7 @@ TEST_CASE("DynamicJsonDocument constructor") {
DynamicJsonDocument doc2 = doc1;
REQUIRE_JSON(doc2, "{\"hello\":\"world\"}");
REQUIRE(doc2.capacity() == addPadding(doc1.memoryUsage()));
REQUIRE(doc2.capacity() == doc1.capacity());
}
SECTION("Construct from JsonObject") {