Merge pull request #7916 from ethereum/fix-testcase-invalid-evmversion-handling

soltest: Improve handling invalid EVMVersion syntax in test files.
This commit is contained in:
Erik K 2019-12-09 10:51:08 +01:00 committed by GitHub
commit d66675602e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
@ -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 + "\""});
}