From 5d85ab49b9da3bd577a670156de6110995338629 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 15 May 2019 12:24:23 +0200 Subject: [PATCH] Allow the constructor to revert. --- test/libsolidity/SemanticTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index c057941df..f7d08e67c 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -65,7 +65,7 @@ TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePref { if (&test == &m_tests.front()) if (test.call().isConstructor) - soltestAssert(deploy("", 0, test.call().arguments.rawBytes()), "Failed to deploy contract with additional constructor arguments."); + deploy("", 0, test.call().arguments.rawBytes()); else soltestAssert(deploy("", 0, bytes()), "Failed to deploy contract."); else @@ -73,7 +73,10 @@ TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePref if (test.call().isConstructor) { - test.setFailure(false); + if (m_transactionSuccessful == test.call().expectations.failure) + success = false; + + test.setFailure(!m_transactionSuccessful); test.setRawBytes(bytes()); } else