From 7a121c38b818449d4bb664277dfc15cdbf168b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 20 Nov 2014 20:13:28 +0100 Subject: [PATCH] Do not catch OutOfGas exception in tests separately --- test/vm.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/test/vm.cpp b/test/vm.cpp index 03e03566c..3f8e0a233 100644 --- a/test/vm.cpp +++ b/test/vm.cpp @@ -306,7 +306,6 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) auto vm = VMFace::create(vmKind, fev.gas); bytes output; - auto outOfGas = false; auto startTime = std::chrono::high_resolution_clock::now(); u256 gas; @@ -316,11 +315,6 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) output = vm->go(fev, fev.simpleTrace()).toVector(); gas = vm->gas(); } - catch (OutOfGas const&) - { - outOfGas = true; - gas = 0; - } catch (VMException const& _e) { cnote << "VM did throw an exception: " << diagnostic_information(_e); @@ -373,11 +367,11 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) o["exec"] = mValue(fev.exportExec()); if (!vmExceptionOccured) { - o["post"] = mValue(fev.exportState()); - o["callcreates"] = fev.exportCallCreates(); - o["out"] = "0x" + toHex(output); - fev.push(o, "gas", gas); - } + o["post"] = mValue(fev.exportState()); + o["callcreates"] = fev.exportCallCreates(); + o["out"] = "0x" + toHex(output); + fev.push(o, "gas", gas); + } } else { @@ -397,10 +391,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) checkOutput(output, o); BOOST_CHECK_EQUAL(toInt(o["gas"]), gas); - - if (outOfGas) - BOOST_CHECK_MESSAGE(gas == 0, "Remaining gas not 0 in out-of-gas state"); - + auto& expectedAddrs = test.addresses; auto& resultAddrs = fev.addresses; for (auto&& expectedPair : expectedAddrs)