From cc906541f61ce6d90797338848fe2870da42a490 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 26 Jan 2015 09:48:29 +0100 Subject: [PATCH] Various small fixes for Sol Automatic Accessors --- SolidityNameAndTypeResolution.cpp | 6 +++--- SolidityParser.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index dbb95cf72..3b711bfec 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -645,9 +645,9 @@ BOOST_AUTO_TEST_CASE(state_variable_accessors) BOOST_CHECK((contract = retrieveContract(source, 0)) != nullptr); FunctionDescription function = retrieveFunctionBySignature(contract, "foo()"); BOOST_CHECK_MESSAGE(function.getDeclaration() != nullptr, "Could not find the accessor function"); - // vector const expected({ParamDescription("", "uint256")}); - // BOOST_CHECK_EQUAL_COLLECTIONS(function.getReturnParameters().begin(), function.getReturnParameters().end(), - // expected.begin(), expected.end()); + auto returnParams = function.getReturnParameters(); + BOOST_CHECK_EQUAL(returnParams.at(0).getType(), "uint256"); + BOOST_CHECK(function.isConstant()); } BOOST_AUTO_TEST_CASE(private_state_variable) diff --git a/SolidityParser.cpp b/SolidityParser.cpp index db7806f4d..7bfb4c0c8 100644 --- a/SolidityParser.cpp +++ b/SolidityParser.cpp @@ -204,7 +204,7 @@ BOOST_AUTO_TEST_CASE(multiline_function_documentation) BOOST_REQUIRE_NO_THROW(contract = parseText(text)); auto functions = contract->getDefinedFunctions(); - BOOST_REQUIRE_NO_THROW(function = functions.at(1)); // 1 since, 0 is the index of stateVar accessor + BOOST_REQUIRE_NO_THROW(function = functions.at(0)); checkFunctionNatspec(function, "This is a test function\n" " and it has 2 lines"); }