diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-05-11 22:24:04 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-05-11 23:16:52 +0800 |
commit | 23925040a11a7b4dad3286a9832822cae8baeb95 (patch) | |
tree | 2756aa49389c29dbe1134d37f26d6393eba879e5 | |
parent | ccc3d56542d76ce19ce994716e8d7afc339e7472 (diff) | |
download | dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.tar dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.tar.gz dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.tar.bz2 dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.tar.lz dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.tar.xz dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.tar.zst dexon-solidity-23925040a11a7b4dad3286a9832822cae8baeb95.zip |
updated unit test
-rw-r--r-- | libsolidity/SolidityABIJSON.cpp | 55 | ||||
-rw-r--r-- | libsolidity/SolidityNameAndTypeResolution.cpp | 2 |
2 files changed, 27 insertions, 30 deletions
diff --git a/libsolidity/SolidityABIJSON.cpp b/libsolidity/SolidityABIJSON.cpp index 6c1025d6..fe8b791c 100644 --- a/libsolidity/SolidityABIJSON.cpp +++ b/libsolidity/SolidityABIJSON.cpp @@ -499,8 +499,7 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { char const* sourceCode = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } - function test(uint param1, test param2, bool param3, ActionChoices param4) {} + function test(uint param1, test param2, bool param3) {} } )"; @@ -518,10 +517,6 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { "name": "param3", "type": "bool" - }, - { - "name": "param4", - "type": "uint8" } ], "type": "constructor" @@ -545,29 +540,31 @@ BOOST_AUTO_TEST_CASE(return_param_in_abi) } )"; - char const* interface = R"([ - { - "constant" : false, - "inputs" : [], - "name" : "ret", - "outputs" : [ - { - "name" : "", - "type" : "uint8" - } - ], - "type" : "function" - }, - { - "inputs": [ - { - "name": "param", - "type": "uint8" - } - ], - "type": "constructor" - } - ])"; + char const* interface = R"( + [ + { + "constant" : false, + "inputs" : [], + "name" : "ret", + "outputs" : [ + { + "name" : "", + "type" : "uint8" + } + ], + "type" : "function" + }, + { + "inputs": [ + { + "name": "param", + "type": "uint8" + } + ], + "type": "constructor" + } + ] + )"; checkInterface(sourceCode, interface); } diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp index c59c1f56..4ec7b8bd 100644 --- a/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/libsolidity/SolidityNameAndTypeResolution.cpp @@ -516,7 +516,7 @@ BOOST_AUTO_TEST_CASE(enum_external_type) contract Test { enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function boo(ActionChoices enumArg) external returns (uint ret) { - ret = 5; + ret = 5; } })"; ETH_TEST_REQUIRE_NO_THROW(sourceUnit = parseTextAndResolveNames(text), "Parsing and name Resolving failed"); |