mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Inverted dependency between MemoryPool and string adapters.
Inserted a null after each raw string in the pool.
This commit is contained in:
		| @@ -36,6 +36,6 @@ TEST_CASE("StringBuilder") { | ||||
|     str.append('h'); | ||||
|     str.complete(); | ||||
|  | ||||
|     REQUIRE(JSON_STRING_SIZE(2) == pool.size()); | ||||
|     REQUIRE(JSON_STRING_SIZE(1) == pool.size()); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -30,19 +30,19 @@ TEST_CASE("MemoryPool::size()") { | ||||
|   SECTION("Decreases after freezeString()") { | ||||
|     StringSlot a = pool.allocExpandableString(); | ||||
|     pool.freezeString(a, 1); | ||||
|     REQUIRE(pool.size() == JSON_STRING_SIZE(1)); | ||||
|     REQUIRE(pool.size() == 1); | ||||
|  | ||||
|     StringSlot b = pool.allocExpandableString(); | ||||
|     pool.freezeString(b, 1); | ||||
|     REQUIRE(pool.size() == 2 * JSON_STRING_SIZE(1)); | ||||
|     REQUIRE(pool.size() == 2); | ||||
|   } | ||||
|  | ||||
|   SECTION("Increases after allocFrozenString()") { | ||||
|     pool.allocFrozenString(0); | ||||
|     REQUIRE(pool.size() == JSON_STRING_SIZE(0)); | ||||
|     pool.allocFrozenString(1); | ||||
|     REQUIRE(pool.size() == 1); | ||||
|  | ||||
|     pool.allocFrozenString(0); | ||||
|     REQUIRE(pool.size() == 2 * JSON_STRING_SIZE(0)); | ||||
|     pool.allocFrozenString(2); | ||||
|     REQUIRE(pool.size() == 3); | ||||
|   } | ||||
|  | ||||
|   SECTION("Doesn't grow when memory pool is full") { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user