From f49612f10c522622d67f212df71250c3d0bbb441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 22 Oct 2014 16:52:47 +0200 Subject: [PATCH] Update VM test engine to use VMFace interface --- test/vm.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/vm.cpp b/test/vm.cpp index 179a47b91..4671a92b6 100644 --- a/test/vm.cpp +++ b/test/vm.cpp @@ -517,16 +517,13 @@ void doTests(json_spirit::mValue& v, bool _fillin) auto argv = boost::unit_test::framework::master_test_suite().argv; auto useJit = argc >= 2 && std::string(argv[1]) == "--jit"; - jit::VM jit(fev.gas); - VM interpreter(fev.gas); + auto vm = useJit ? std::unique_ptr(new jit::VM) : std::unique_ptr(new VM); + vm->reset(fev.gas); bytes output; auto outOfGas = false; try { - if (useJit) - output = jit.go(fev).toVector(); - else - output = interpreter.go(fev).toVector(); + output = vm->go(fev).toVector(); } catch (OutOfGas const&) { @@ -540,7 +537,7 @@ void doTests(json_spirit::mValue& v, bool _fillin) { cnote << "VM did throw an exception: " << _e.what(); } - auto gas = useJit ? jit.gas() : interpreter.gas(); + auto gas = vm->gas(); // delete null entries in storage for the sake of comparison