mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Test casting a JsonValue to a bool
This commit is contained in:
		| @@ -59,6 +59,11 @@ namespace ArduinoJson | ||||
|                 content.asDouble = value; | ||||
|             } | ||||
|  | ||||
|             operator bool() | ||||
|             { | ||||
|                 return content.asBool; | ||||
|             } | ||||
|  | ||||
|             operator const char*() | ||||
|             { | ||||
|                 return ""; | ||||
|   | ||||
| @@ -34,6 +34,12 @@ namespace JsonGeneratorTests | ||||
|             setValueAndCheckCast(42L); | ||||
|         } | ||||
|  | ||||
|         TEST_METHOD(Bool) | ||||
|         { | ||||
|             setValueAndCheckCast(true); | ||||
|             setValueAndCheckCast(false); | ||||
|         } | ||||
|  | ||||
|     private: | ||||
|  | ||||
|         template<typename T> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user