From 01215694f67600f446498f403c3314ef6266a346 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Mon, 21 Nov 2016 15:26:05 +0100 Subject: test: disallow more than one errors in name and type tests --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index cf0d41dd..3f8307d9 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -62,7 +62,11 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false, SyntaxChecker syntaxChecker(errors); if (!syntaxChecker.checkSyntax(*sourceUnit)) + { + if (errors.size() > 1) + BOOST_FAIL("Multiple errors found after checking syntax."); return make_pair(sourceUnit, errors.at(0)); + } std::shared_ptr globalContext = make_shared(); NameAndTypeResolver resolver(globalContext->declarations(), errors); @@ -89,8 +93,12 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false, TypeChecker typeChecker(errors); bool success = typeChecker.checkTypeRequirements(*contract); BOOST_CHECK(success || !errors.empty()); + if (errors.size() > 1) + BOOST_FAIL("Multiple errors found after checking type requirements"); } + if (errors.size() > 1) + BOOST_FAIL("Multiple errors found"); for (auto const& currentError: errors) { if ( -- cgit