Skip to content

Commit

Permalink
Throw exception for invalid test options.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Mar 5, 2018
1 parent 6d77b4e commit 19df28f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/TestHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dev::solidity::EVMVersion Options::evmVersion() const
// We do this check as opposed to in the constructor because the BOOST_REQUIRE
// macros cannot yet be used in the constructor.
auto version = solidity::EVMVersion::fromString(evmVersionString);
BOOST_REQUIRE_MESSAGE(version, "Invalid EVM version: " + evmVersionString);
assertThrow(version, InvalidTestOptions, "Invalid EVM version: " + evmVersionString);
return *version;
}
else
Expand Down
4 changes: 4 additions & 0 deletions test/TestHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <libsolidity/interface/EVMVersion.h>

#include <libdevcore/Assertions.h>

#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
#include <boost/version.hpp>
Expand All @@ -32,6 +34,8 @@ namespace dev
namespace test
{

DEV_SIMPLE_EXCEPTION(InvalidTestOptions);

struct Options: boost::noncopyable
{
std::string ipcPath;
Expand Down

0 comments on commit 19df28f

Please sign in to comment.