mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Removed the copy-constructor of JsonDocument (issue #1189)
This commit is contained in:
		| @@ -20,23 +20,35 @@ set_target_properties(MiscTests PROPERTIES UNITY_BUILD OFF) | ||||
|  | ||||
| add_test(Misc MiscTests) | ||||
|  | ||||
| macro(build_should_fail target) | ||||
| 	set_target_properties(${target} | ||||
| 		PROPERTIES | ||||
| 	    	EXCLUDE_FROM_ALL TRUE | ||||
| 	        EXCLUDE_FROM_DEFAULT_BUILD TRUE | ||||
| 	) | ||||
| 	add_test( | ||||
| 		NAME | ||||
| 			${target} | ||||
| 	    COMMAND | ||||
| 	    	${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION> | ||||
| 	    WORKING_DIRECTORY | ||||
| 	    	${CMAKE_BINARY_DIR} | ||||
| 	) | ||||
| 	set_tests_properties(${target}  | ||||
|  | ||||
|  | ||||
|  | ||||
| 		PROPERTIES | ||||
| 			WILL_FAIL TRUE) | ||||
| endmacro() | ||||
|  | ||||
|  | ||||
| add_executable(Issue978 | ||||
| 	Issue978.cpp | ||||
| ) | ||||
| set_target_properties(Issue978 | ||||
| 	PROPERTIES | ||||
|     	EXCLUDE_FROM_ALL TRUE | ||||
|         EXCLUDE_FROM_DEFAULT_BUILD TRUE | ||||
| build_should_fail(Issue978) | ||||
|  | ||||
| add_executable(Issue1189 | ||||
| 	Issue1189.cpp | ||||
| ) | ||||
| add_test( | ||||
| 	NAME | ||||
| 		Issue978 | ||||
|     COMMAND | ||||
|     	${CMAKE_COMMAND} --build . --target Issue978 --config $<CONFIGURATION> | ||||
|     WORKING_DIRECTORY | ||||
|     	${CMAKE_BINARY_DIR} | ||||
| ) | ||||
| set_tests_properties(Issue978  | ||||
| 	PROPERTIES | ||||
| 		WILL_FAIL TRUE) | ||||
| build_should_fail(Issue1189) | ||||
|   | ||||
							
								
								
									
										13
									
								
								extras/tests/Misc/Issue1189.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								extras/tests/Misc/Issue1189.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| // ArduinoJson - arduinojson.org | ||||
| // Copyright Benoit Blanchon 2014-2020 | ||||
| // MIT License | ||||
|  | ||||
| #include <ArduinoJson.h> | ||||
|  | ||||
| // a function should not be able to get a JsonDocument by value | ||||
| void f(JsonDocument) {} | ||||
|  | ||||
| int main() { | ||||
|   DynamicJsonDocument doc(1024); | ||||
|   f(doc); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user