Skip to content

Commit

Permalink
Merge pull request ethereum#7916 from ethereum/fix-testcase-invalid-e…
Browse files Browse the repository at this point in the history
…vmversion-handling

soltest: Improve handling invalid EVMVersion syntax in test files.
  • Loading branch information
erak authored Dec 9, 2019
2 parents 1fe1459 + 48dd1e3 commit d666756
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/TestCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ bool EVMVersionRestrictedTestCase::validateSettings(langutil::EVMVersion _evmVer
versionString = versionString.substr(versionBegin);
std::optional<langutil::EVMVersion> version = langutil::EVMVersion::fromString(versionString);
if (!version)
throw runtime_error("Invalid EVM version: \"" + versionString + "\"");
BOOST_THROW_EXCEPTION(runtime_error{"Invalid EVM version: \"" + versionString + "\""});

if (comparator == ">")
return _evmVersion > version;
Expand All @@ -201,6 +201,5 @@ bool EVMVersionRestrictedTestCase::validateSettings(langutil::EVMVersion _evmVer
else if (comparator == "!")
return !(_evmVersion == version);
else
throw runtime_error("Invalid EVM comparator: \"" + comparator + "\"");
return false; // not reached
BOOST_THROW_EXCEPTION(runtime_error{"Invalid EVM comparator: \"" + comparator + "\""});
}

0 comments on commit d666756

Please sign in to comment.