From 1d4219d43d2839c41e56307f9db04cc23d4741e5 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 15 Oct 2015 18:14:14 +0200 Subject: Some fixes taking other pull requests into account. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 12 ++++-------- test/libsolidity/SolidityParser.cpp | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 0b5a86d7..5002cc4f 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -109,13 +109,9 @@ ASTPointer parseAndAnalyse(string const& _source) return sourceAndError.first; } -bool success(std::string const& _source) +bool success(string const& _source) { - auto sourceAndError = parseAnalyseAndReturnError(_source); - - if (sourceAndError.second && *sourceAndError.second == Error::Type::TypeError) - return false; - return true; + return !parseAnalyseAndReturnError(_source).second; } Error::Type expectError(std::string const& _source, bool _warning = false) @@ -2472,7 +2468,7 @@ BOOST_AUTO_TEST_CASE(tuples) } } )"; - BOOST_CHECK_NO_THROW(parseAndAnalyse(text)); + BOOST_CHECK(success(text)); } BOOST_AUTO_TEST_CASE(tuples_empty_components) @@ -2484,7 +2480,7 @@ BOOST_AUTO_TEST_CASE(tuples_empty_components) } } )"; - SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError); + BOOST_CHECK(expectError(text) == Error::Type::TypeError); } BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_5) diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 9aa4a8ef..c181ae7e 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -1012,7 +1012,7 @@ BOOST_AUTO_TEST_CASE(tuples) } } )"; - BOOST_CHECK_NO_THROW(parseText(text)); + BOOST_CHECK(successParse(text)); } BOOST_AUTO_TEST_SUITE_END() -- cgit