mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Implement VariantRefBase with a CRTP
				
					
				
			This commit is contained in:
		| @@ -5,9 +5,7 @@ | ||||
| #include <ArduinoJson.h> | ||||
| #include <catch.hpp> | ||||
|  | ||||
| using namespace ARDUINOJSON_NAMESPACE; | ||||
|  | ||||
| typedef VariantProxy<ElementDataSource<JsonDocument&> > ElementProxy; | ||||
| typedef ARDUINOJSON_NAMESPACE::ElementProxy<JsonDocument&> ElementProxy; | ||||
|  | ||||
| TEST_CASE("ElementProxy::add()") { | ||||
|   DynamicJsonDocument doc(4096); | ||||
|   | ||||
| @@ -5,9 +5,8 @@ | ||||
| #include <ArduinoJson.h> | ||||
| #include <catch.hpp> | ||||
|  | ||||
| using namespace ARDUINOJSON_NAMESPACE; | ||||
|  | ||||
| typedef VariantProxy<MemberDataSource<JsonDocument&, const char*> > MemberProxy; | ||||
| typedef ARDUINOJSON_NAMESPACE::MemberProxy<JsonDocument&, const char*> | ||||
|     MemberProxy; | ||||
|  | ||||
| TEST_CASE("MemberProxy::add()") { | ||||
|   DynamicJsonDocument doc(4096); | ||||
|   | ||||
| @@ -184,13 +184,12 @@ TEST_CASE("Polyfills/type_traits") { | ||||
|     CHECK((is_convertible<VariantRef, JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<VariantConstRef, JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<ArrayRef, JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<VariantProxy<ElementDataSource<ArrayRef> >, | ||||
|                           JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<ElementProxy<ArrayRef>, JsonVariantConst>::value == | ||||
|            true)); | ||||
|     CHECK((is_convertible<ArrayConstRef, JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<ObjectRef, JsonVariantConst>::value == true)); | ||||
|     CHECK( | ||||
|         (is_convertible<VariantProxy<MemberDataSource<ObjectRef, const char*> >, | ||||
|                         JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<MemberProxy<ObjectRef, const char*>, | ||||
|                           JsonVariantConst>::value == true)); | ||||
|     CHECK((is_convertible<ObjectConstRef, JsonVariantConst>::value == true)); | ||||
|     CHECK( | ||||
|         (is_convertible<DynamicJsonDocument, JsonVariantConst>::value == true)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user