From b4d2ead1b86623c2b1ecf60d0c42a4c9e39f8789 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 23 Apr 2015 14:45:50 +0200 Subject: [PATCH 1/2] Use non-implemented functions for solidity interface output. --- libsolidity/SolidityInterface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libsolidity/SolidityInterface.cpp b/libsolidity/SolidityInterface.cpp index c8f74e3aa..9c9373f04 100644 --- a/libsolidity/SolidityInterface.cpp +++ b/libsolidity/SolidityInterface.cpp @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(single_function) "}\n"); BOOST_REQUIRE_EQUAL(1, contract.getDefinedFunctions().size()); BOOST_CHECK_EQUAL(getSourcePart(*contract.getDefinedFunctions().front()), - "function f(uint256 a)returns(uint256 d){}"); + "function f(uint256 a)returns(uint256 d);"); } BOOST_AUTO_TEST_CASE(single_constant_function) @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(single_constant_function) "contract test { function f(uint a) constant returns(bytes1 x) { 1==2; } }"); BOOST_REQUIRE_EQUAL(1, contract.getDefinedFunctions().size()); BOOST_CHECK_EQUAL(getSourcePart(*contract.getDefinedFunctions().front()), - "function f(uint256 a)constant returns(bytes1 x){}"); + "function f(uint256 a)constant returns(bytes1 x);"); } BOOST_AUTO_TEST_CASE(multiple_functions) @@ -97,8 +97,8 @@ BOOST_AUTO_TEST_CASE(multiple_functions) " function g(uint b) returns(uint e) { return b * 8; }\n" "}\n"; ContractDefinition const& contract = checkInterface(sourceCode); - set expectation({"function f(uint256 a)returns(uint256 d){}", - "function g(uint256 b)returns(uint256 e){}"}); + set expectation({"function f(uint256 a)returns(uint256 d);", + "function g(uint256 b)returns(uint256 e);"}); BOOST_REQUIRE_EQUAL(2, contract.getDefinedFunctions().size()); BOOST_CHECK(expectation == set({getSourcePart(*contract.getDefinedFunctions().at(0)), getSourcePart(*contract.getDefinedFunctions().at(1))})); @@ -135,8 +135,8 @@ BOOST_AUTO_TEST_CASE(inheritance) " event derivedEvent(uint indexed evtArgDerived); \n" " }"; ContractDefinition const& contract = checkInterface(sourceCode); - set expectedFunctions({"function baseFunction(uint256 p)returns(uint256 i){}", - "function derivedFunction(bytes32 p)returns(bytes32 i){}"}); + set expectedFunctions({"function baseFunction(uint256 p)returns(uint256 i);", + "function derivedFunction(bytes32 p)returns(bytes32 i);"}); BOOST_REQUIRE_EQUAL(2, contract.getDefinedFunctions().size()); BOOST_CHECK(expectedFunctions == set({getSourcePart(*contract.getDefinedFunctions().at(0)), getSourcePart(*contract.getDefinedFunctions().at(1))})); From 25450daf2cf84088647599455ecf0f067369f41c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 23 Apr 2015 17:55:40 +0200 Subject: [PATCH 2/2] More logging stuff. Fixes #1680