mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Test encoder for empty structs.
This commit is contained in:
		
							parent
							
								
									2940964044
								
							
						
					
					
						commit
						acd70557cc
					
				| @ -462,6 +462,28 @@ BOOST_AUTO_TEST_CASE(structs) | ||||
| 	) | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(empty_struct) | ||||
| { | ||||
| 	string sourceCode = R"( | ||||
| 		contract C { | ||||
| 			struct S { } | ||||
| 			S s; | ||||
| 			event e(uint16, S, uint16); | ||||
| 			function f() returns (uint, S, uint) { | ||||
| 				e(7, s, 8); | ||||
| 				return (7, s, 8); | ||||
| 			} | ||||
| 		} | ||||
| 	)"; | ||||
| 
 | ||||
| 	NEW_ENCODER( | ||||
| 		compileAndRun(sourceCode, 0, "C"); | ||||
| 		bytes encoded = encodeArgs(7, 8); | ||||
| 		BOOST_CHECK(callContractFunction("f()") == encoded); | ||||
| 		REQUIRE_LOG_DATA(encoded); | ||||
| 	) | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(structs2) | ||||
| { | ||||
| 	string sourceCode = R"( | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user