Browse Source

Fix random test generator

cl-refactor
Paweł Bylica 10 years ago
parent
commit
6c5a84cbc1
  1. 7
      test/createRandomTest.cpp

7
test/createRandomTest.cpp

@ -31,6 +31,7 @@
#include <json_spirit/json_spirit_writer_template.h> #include <json_spirit/json_spirit_writer_template.h>
#include <libdevcore/CommonIO.h> #include <libdevcore/CommonIO.h>
#include <libdevcore/CommonData.h> #include <libdevcore/CommonData.h>
#include <libethereum/VMFactory.h>
#include <libevmcore/Instruction.h> #include <libevmcore/Instruction.h>
#include <libevm/VM.h> #include <libevm/VM.h>
#include "vm.h" #include "vm.h"
@ -128,6 +129,9 @@ void doMyTests(json_spirit::mValue& v)
assert(o.count("pre") > 0); assert(o.count("pre") > 0);
assert(o.count("exec") > 0); assert(o.count("exec") > 0);
auto vmObj = eth::VMFactory::create(eth::VMFactory::Interpreter);
auto& vm = *vmObj;
dev::test::FakeExtVM fev; dev::test::FakeExtVM fev;
fev.importEnv(o["env"].get_obj()); fev.importEnv(o["env"].get_obj());
fev.importState(o["pre"].get_obj()); fev.importState(o["pre"].get_obj());
@ -141,9 +145,8 @@ void doMyTests(json_spirit::mValue& v)
fev.code = fev.thisTxCode; fev.code = fev.thisTxCode;
} }
vm.reset(fev.gas);
bytes output; bytes output;
eth::VM vm(fev.gas);
u256 gas; u256 gas;
bool vmExceptionOccured = false; bool vmExceptionOccured = false;
try try

Loading…
Cancel
Save