mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Organized test files in subfolders
This commit is contained in:
		
							
								
								
									
										36
									
								
								test/Misc/deprecated.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								test/Misc/deprecated.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| // Copyright Benoit Blanchon 2014-2017 | ||||
| // MIT License | ||||
| // | ||||
| // Arduino JSON library | ||||
| // https://bblanchon.github.io/ArduinoJson/ | ||||
| // If you like this project, please add a star! | ||||
|  | ||||
| #define ARDUINOJSON_ENABLE_DEPRECATED 1 | ||||
|  | ||||
| #include <ArduinoJson.h> | ||||
| #include <gtest/gtest.h> | ||||
|  | ||||
| #if defined(__clang__) | ||||
| #pragma clang diagnostic ignored "-Wdeprecated-declarations" | ||||
| #elif defined(__GNUC__) | ||||
| #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||||
| #elif defined(_MSC_VER) | ||||
| #pragma warning(disable : 4996) | ||||
| #endif | ||||
|  | ||||
| TEST(Deprecated, asArray) { | ||||
|   DynamicJsonBuffer jsonBuffer; | ||||
|   JsonVariant variant = jsonBuffer.createArray(); | ||||
|   ASSERT_TRUE(variant.asArray().success()); | ||||
| } | ||||
|  | ||||
| TEST(Deprecated, asObject) { | ||||
|   DynamicJsonBuffer jsonBuffer; | ||||
|   JsonVariant variant = jsonBuffer.createObject(); | ||||
|   ASSERT_TRUE(variant.asObject().success()); | ||||
| } | ||||
|  | ||||
| TEST(Deprecated, asString) { | ||||
|   JsonVariant variant = "hello"; | ||||
|   ASSERT_STREQ("hello", variant.asString()); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user