test: Improve handling invalid EVMVersion syntax in test cases.

This commit is contained in:
Christian Parpart 2019-12-06 12:33:05 +01:00
parent 1fe1459b7d
commit 48dd1e398d

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