diff options
author | Gav Wood <i@gavwood.com> | 2014-07-14 23:24:07 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2014-07-14 23:24:07 +0800 |
commit | f2524f55781502cb1bd203c31a42184e7294c23b (patch) | |
tree | 73a19bf83940feb52f5212323dc789705c28c445 /vm.cpp | |
parent | b3088a69f3e39eee337b16fd57e587d953fd7085 (diff) | |
download | dexon-solidity-f2524f55781502cb1bd203c31a42184e7294c23b.tar.gz dexon-solidity-f2524f55781502cb1bd203c31a42184e7294c23b.tar.zst dexon-solidity-f2524f55781502cb1bd203c31a42184e7294c23b.zip |
Debugger improvements.
Diffstat (limited to 'vm.cpp')
-rw-r--r-- | vm.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -409,10 +409,7 @@ void doTests(json_spirit::mValue& v, bool _fillin) o["exec"] = mValue(fev.exportExec()); o["post"] = mValue(fev.exportState()); o["callcreates"] = fev.exportCallCreates(); - mArray df; - for (auto const& i: output) - FakeExtVM::push(df, i); - o["out"] = df; + o["out"] = "0x" + toHex(output); fev.push(o, "gas", vm.gas()); } else @@ -426,11 +423,17 @@ void doTests(json_spirit::mValue& v, bool _fillin) test.importState(o["post"].get_obj()); test.importCallCreates(o["callcreates"].get_array()); int i = 0; - for (auto const& d: o["out"].get_array()) - { - BOOST_CHECK_MESSAGE(output[i] == FakeExtVM::toInt(d), "Output byte [" << i << "] different!"); - ++i; - } + if (o["out"].type() == array_type) + for (auto const& d: o["out"].get_array()) + { + BOOST_CHECK_MESSAGE(output[i] == FakeExtVM::toInt(d), "Output byte [" << i << "] different!"); + ++i; + } + else if (o["out"].get_str().find("0x") == 0) + BOOST_CHECK(output == fromHex(o["out"].get_str().substr(2))); + else + BOOST_CHECK(output == fromHex(o["out"].get_str())); + BOOST_CHECK(FakeExtVM::toInt(o["gas"]) == vm.gas()); BOOST_CHECK(test.addresses == fev.addresses); BOOST_CHECK(test.callcreates == fev.callcreates); |