From 48dd1e398d6e954198a3732775027bcfad77db0b Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Fri, 6 Dec 2019 12:33:05 +0100 Subject: [PATCH] test: Improve handling invalid EVMVersion syntax in test cases. --- test/TestCase.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/TestCase.cpp b/test/TestCase.cpp index c264da100..a9f4e6252 100644 --- a/test/TestCase.cpp +++ b/test/TestCase.cpp @@ -186,7 +186,7 @@ bool EVMVersionRestrictedTestCase::validateSettings(langutil::EVMVersion _evmVer versionString = versionString.substr(versionBegin); std::optional 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 + "\""}); }