diff options
Diffstat (limited to 'test/libsolidity/solidityExecutionFramework.h')
-rw-r--r-- | test/libsolidity/solidityExecutionFramework.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index 3370044c..27dd4fb7 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -67,12 +67,26 @@ public: return m_output; } - template <class Exceptiontype> - void compileRequireThrow(std::string const& _sourceCode) + void compileRequireError(std::string const& _sourceCode, Error::Type _type) { m_compiler.reset(false, m_addStandardSources); m_compiler.addSource("", _sourceCode); - BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), Exceptiontype); + bool foundError = false; + try + { + m_compiler.compile(m_optimize, m_optimizeRuns); + BOOST_REQUIRE(Error::containsErrorOfType(m_compiler.errors(), _type)); + } + catch(Error const& _e) + { + BOOST_REQUIRE(_e.type() == _type); + foundError = true; + } + catch(Exception const& _exception) + { + BOOST_REQUIRE(false); + } + BOOST_REQUIRE(foundError); } bytes const& compileAndRun( |