diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 5ace49e5d..793e05652 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -588,7 +588,7 @@ void userDefinedTest(std::function doTests) oSingleTest[pos->first] = pos->second; json_spirit::mValue v_singleTest(oSingleTest); - doTests(v_singleTest, false); + doTests(v_singleTest, test::Options::get().fillTests); } catch (Exception const& _e) { diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index d0cd82c01..d533ac2da 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -226,31 +226,33 @@ void doStateTests(json_spirit::mValue& _v) assert(o.count("pre") > 0); assert(o.count("transaction") > 0); bytes output; - eth::State theState; try { test::ImportTest importer(o, true); eth::State theState = importer.m_statePre; - output = theState.execute(test::lastHashes(importer.m_environment.currentBlock.number), importer.m_transaction).output; - #if ETH_FATDB - importer.exportTest(output, theState); - #else - cout << "You can not fill tests when FATDB is switched off"; - #endif - } - catch (Exception const& _e) - { - cnote << "state execution did throw an exception: " << diagnostic_information(_e); - theState.commit(); - } - catch (std::exception const& _e) - { - cnote << "state execution did throw an exception: " << _e.what(); + try + { + output = theState.execute(test::lastHashes(importer.m_environment.currentBlock.number), importer.m_transaction).output; + } + catch (Exception const& _e) + { + cnote << "state execution did throw an exception: " << diagnostic_information(_e); + theState.commit(); + } + catch (std::exception const& _e) + { + cnote << "state execution did throw an exception: " << _e.what(); + } +#if ETH_FATDB + importer.exportTest(output, theState); +#else + cout << "You can not fill tests when FATDB is switched off"; +#endif } - catch (...) + catch(...) { - cnote << "state execution did throw an exception!"; + cnote << "Error filling test, probably..."; } } } diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index b4905709e..4ddd30c0f 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -128,7 +128,7 @@ std::string RandomCode::fillArguments(dev::eth::Instruction opcode, RandomCodeOp std::string code; bool smart = false; unsigned num = info.args; - int rand = randOpCodeGen() % 100; + int rand = randUniIntGen() % 100; if (rand < options.smartCodeProbability) smart = true;