Browse Source

Merge pull request #2120 from winsvega/issues

stPrecompiledContracts from transaction test
cl-refactor
Gav Wood 10 years ago
parent
commit
dfea88af04
  1. 10
      test/TestHelper.cpp
  2. 5
      test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json
  3. 854
      test/libethereum/StateTestsFiller/stPrecompiledContractsTransactionFiller.json
  4. 5
      test/libethereum/state.cpp

10
test/TestHelper.cpp

@ -344,6 +344,16 @@ void ImportTest::exportTest(bytes const& _output, State const& _statePost)
m_TestObject["out"] = (_output.size() > 4096 && !Options::get().fulloutput) ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add);
// compare expected output with post output
if (m_TestObject.count("expectOut") > 0)
{
std::string warning = "Check State: Error! Unexpected output: " + m_TestObject["out"].get_str() + " Expected: " + m_TestObject["expectOut"].get_str();
if (Options::get().checkState)
BOOST_CHECK_MESSAGE((m_TestObject["out"].get_str() == m_TestObject["expectOut"].get_str()), warning);
else
BOOST_WARN_MESSAGE((m_TestObject["out"].get_str() == m_TestObject["expectOut"].get_str()), warning);
}
// export logs
m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries());

5
test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json

@ -3644,6 +3644,5 @@
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"data" : ""
}
},
}
}
}

854
test/libethereum/StateTestsFiller/stPrecompiledContractsTransactionFiller.json

File diff suppressed because one or more lines are too long

5
test/libethereum/state.cpp

@ -129,6 +129,11 @@ BOOST_AUTO_TEST_CASE(stPreCompiledContracts)
dev::test::executeTests("stPreCompiledContracts", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests);
}
BOOST_AUTO_TEST_CASE(stPrecompiledContractsTransaction)
{
dev::test::executeTests("stPrecompiledContractsTransaction", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests);
}
BOOST_AUTO_TEST_CASE(stLogTests)
{
dev::test::executeTests("stLogTests", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests);

Loading…
Cancel
Save