diff options
author | Gav Wood <g@ethdev.com> | 2015-05-21 04:07:31 +0800 |
---|---|---|
committer | Gav Wood <g@ethdev.com> | 2015-05-21 04:07:31 +0800 |
commit | a97a326ffe08e7304d4a0e0d2d879d3baef8bb20 (patch) | |
tree | 59aa52393acbf73ff5708f688ea3eaddd0b33113 | |
parent | e5a4a8fca4832dff79227dc6ed667b7f1c879faf (diff) | |
parent | 8971baec8fcf70b1b5eba285e9bfdb05bddddc97 (diff) | |
download | dexon-solidity-a97a326ffe08e7304d4a0e0d2d879d3baef8bb20.tar.gz dexon-solidity-a97a326ffe08e7304d4a0e0d2d879d3baef8bb20.tar.zst dexon-solidity-a97a326ffe08e7304d4a0e0d2d879d3baef8bb20.zip |
Merge pull request #1980 from CJentzsch/shaingTestOutput
handle output larger than 4069 bytes in test
-rw-r--r-- | TestHelper.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index aada8304..476d1ecf 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -327,7 +327,8 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta void ImportTest::exportTest(bytes const& _output, State const& _statePost) { // export output - m_TestObject["out"] = toHex(_output, 2, HexPrefix::Add); + + m_TestObject["out"] = _output.size() > 4096 ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); // export logs m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries()); @@ -489,7 +490,11 @@ LogEntries importLog(json_spirit::mArray& _a) void checkOutput(bytes const& _output, json_spirit::mObject& _o) { int j = 0; - if (_o["out"].type() == json_spirit::array_type) + + if (_o["out"].get_str().find("#") == 0) + BOOST_CHECK((u256)_output.size() == toInt(_o["out"].get_str().substr(1))); + + else if (_o["out"].type() == json_spirit::array_type) for (auto const& d: _o["out"].get_array()) { BOOST_CHECK_MESSAGE(_output[j] == toInt(d), "Output byte [" << j << "] different!"); |