diff options
-rw-r--r-- | TestHelper.cpp | 10 | ||||
-rw-r--r-- | libsolidity/Assembly.cpp | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index f7da0238..873ea21e 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -344,6 +344,16 @@ void ImportTest::exportTest(bytes const& _output, State const& _statePost) m_TestObject["out"] = (_output.size() > 4096 && !Options::get().fulloutput) ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); + // compare expected output with post output + if (m_TestObject.count("expectOut") > 0) + { + std::string warning = "Check State: Error! Unexpected output: " + m_TestObject["out"].get_str() + " Expected: " + m_TestObject["expectOut"].get_str(); + if (Options::get().checkState) + BOOST_CHECK_MESSAGE((m_TestObject["out"].get_str() == m_TestObject["expectOut"].get_str()), warning); + else + BOOST_WARN_MESSAGE((m_TestObject["out"].get_str() == m_TestObject["expectOut"].get_str()), warning); + } + // export logs m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries()); diff --git a/libsolidity/Assembly.cpp b/libsolidity/Assembly.cpp index ccc4bf81..fd4bbcf6 100644 --- a/libsolidity/Assembly.cpp +++ b/libsolidity/Assembly.cpp @@ -105,8 +105,8 @@ BOOST_AUTO_TEST_CASE(location_test) shared_ptr<string const> n = make_shared<string>("source"); AssemblyItems items = compileContract(sourceCode); vector<SourceLocation> locations = - vector<SourceLocation>(11, SourceLocation(2, 75, n)) + - vector<SourceLocation>(12, SourceLocation(20, 72, n)) + + vector<SourceLocation>(17, SourceLocation(2, 75, n)) + + vector<SourceLocation>(14, SourceLocation(20, 72, n)) + vector<SourceLocation>{SourceLocation(42, 51, n), SourceLocation(65, 67, n)} + vector<SourceLocation>(4, SourceLocation(58, 67, n)) + vector<SourceLocation>(3, SourceLocation(20, 72, n)); |