mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Change unit tests relying on floating point precision
This commit is contained in:
		| @@ -54,31 +54,31 @@ namespace JsonGeneratorTests | |||||||
|             jsonIs("[\"hello\",\"world\"]"); |             jsonIs("[\"hello\",\"world\"]"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(OneNumber) |         TEST_METHOD(OneInteger) | ||||||
|         { |         { | ||||||
|             addValue(3.14); |             addValue(1); | ||||||
|  |  | ||||||
|             returnValueIs(6); |             returnValueIs(3); | ||||||
|             jsonIs("[3.14]"); |             jsonIs("[1]"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(TwoNumbers) |         TEST_METHOD(TwoIntegers) | ||||||
|         { |         { | ||||||
|             addValue(3.14); |             addValue(1); | ||||||
|             addValue(2.72); |             addValue(2); | ||||||
|  |  | ||||||
|             returnValueIs(11); |             returnValueIs(5); | ||||||
|             jsonIs("[3.14,2.72]"); |             jsonIs("[1,2]"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(OneNumberOverCapacity) |         TEST_METHOD(OneIntegerOverCapacity) | ||||||
|         { |         { | ||||||
|             addValue(3.14); |             addValue(1); | ||||||
|             addValue(2.72); |             addValue(2); | ||||||
|             addValue(1.41); |             addValue(3); | ||||||
|  |  | ||||||
|             returnValueIs(11); |             returnValueIs(5); | ||||||
|             jsonIs("[3.14,2.72]"); |             jsonIs("[1,2]"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(OneTrue) |         TEST_METHOD(OneTrue) | ||||||
| @@ -136,15 +136,15 @@ namespace JsonGeneratorTests | |||||||
|             jsonIs("[{}]"); |             jsonIs("[{}]"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(OneNestedArrayWithOneItem) |         TEST_METHOD(OneNestedArrayWithOneInteger) | ||||||
|         { |         { | ||||||
|             JsonArray<1> nestedArray; |             JsonArray<1> nestedArray; | ||||||
|             nestedArray.add(3.14); |             nestedArray.add(1); | ||||||
|  |  | ||||||
|             addNested(nestedArray); |             addNested(nestedArray); | ||||||
|  |  | ||||||
|             returnValueIs(8); |             returnValueIs(5); | ||||||
|             jsonIs("[[3.14]]"); |             jsonIs("[[1]]"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     private: |     private: | ||||||
|   | |||||||
| @@ -46,12 +46,12 @@ namespace JsonGeneratorTests | |||||||
|             jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}"); |             jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(OneNumber) |         TEST_METHOD(OneInteger) | ||||||
|         { |         { | ||||||
|             addValue("pi", 3.14); |             addValue("key", 1); | ||||||
|  |  | ||||||
|             returnValueIs(11); |             returnValueIs(9); | ||||||
|             jsonIs("{\"pi\":3.14}"); |             jsonIs("{\"key\":1}"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         TEST_METHOD(OneNull) |         TEST_METHOD(OneNull) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user