mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Improved coverage of MemoryPool
This commit is contained in:
		| @@ -48,6 +48,8 @@ typedef BasicJsonDocument<ArmoredAllocator> ShrinkToFitTestDocument; | ||||
|  | ||||
| void testShrinkToFit(ShrinkToFitTestDocument& doc, std::string expected_json, | ||||
|                      size_t expected_size) { | ||||
|   // test twice: shrinkToFit() should be idempotent | ||||
|   for (int i = 0; i < 2; i++) { | ||||
|     doc.shrinkToFit(); | ||||
|  | ||||
|     REQUIRE(doc.capacity() == expected_size); | ||||
| @@ -56,6 +58,7 @@ void testShrinkToFit(ShrinkToFitTestDocument& doc, std::string expected_json, | ||||
|     std::string json; | ||||
|     serializeJson(doc, json); | ||||
|     REQUIRE(json == expected_json); | ||||
|   } | ||||
| } | ||||
|  | ||||
| TEST_CASE("BasicJsonDocument::shrinkToFit()") { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user