mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Generator: added a test of an array with 2 strings
This commit is contained in:
		| @@ -28,8 +28,11 @@ public: | ||||
|  | ||||
|         for (int i = 0; i < itemCount; i++) | ||||
|         { | ||||
|             if (i>0) | ||||
|                 append(",", buffer, bufferSize); | ||||
|  | ||||
|             append("'", buffer, bufferSize); | ||||
|             append(items[i], buffer, bufferSize); | ||||
|             append(items[i], buffer, bufferSize);            | ||||
|             append("'", buffer, bufferSize); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ namespace JsonGeneratorTests | ||||
| {		 | ||||
|     TEST_CLASS(JsonArrayTests) | ||||
|     { | ||||
|         JsonArray<32> arr; | ||||
|         JsonArray<3> arr; | ||||
|          | ||||
|     public: | ||||
|          | ||||
| @@ -23,6 +23,14 @@ namespace JsonGeneratorTests | ||||
|             AssertJsonIs("['hello']"); | ||||
|         } | ||||
|  | ||||
|         TEST_METHOD(TwoStrings) | ||||
|         { | ||||
|             arr.add("hello"); | ||||
|             arr.add("world"); | ||||
|  | ||||
|             AssertJsonIs("['hello','world']"); | ||||
|         } | ||||
|  | ||||
|         void AssertJsonIs(const char* expected) | ||||
|         {       | ||||
|             char buffer[256]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user