diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-21 22:26:05 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-12-05 22:41:37 +0800 |
commit | 01215694f67600f446498f403c3314ef6266a346 (patch) | |
tree | 5ea445822162bdf87e424cd3395c1387aedeb465 /test/libsolidity | |
parent | 34327c5d8ae0cd949bb8848048f520e48c4ee651 (diff) | |
download | dexon-solidity-01215694f67600f446498f403c3314ef6266a346.tar dexon-solidity-01215694f67600f446498f403c3314ef6266a346.tar.gz dexon-solidity-01215694f67600f446498f403c3314ef6266a346.tar.bz2 dexon-solidity-01215694f67600f446498f403c3314ef6266a346.tar.lz dexon-solidity-01215694f67600f446498f403c3314ef6266a346.tar.xz dexon-solidity-01215694f67600f446498f403c3314ef6266a346.tar.zst dexon-solidity-01215694f67600f446498f403c3314ef6266a346.zip |
test: disallow more than one errors in name and type tests
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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> globalContext = make_shared<GlobalContext>(); 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 ( |