aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-03-14 03:12:35 +0800
committerGav Wood <g@ethdev.com>2015-03-14 03:12:35 +0800
commit827b1e2b3db4def5a296ad32b264e0a8612df064 (patch)
tree87903cc960f2369bac3240f697f4890d7519728c /TestHelper.cpp
parenta6f328a613718601c3507923996813a9e50988d5 (diff)
parent6243d0048bb9424388bca6970a11a865b18239c3 (diff)
downloaddexon-solidity-827b1e2b3db4def5a296ad32b264e0a8612df064.tar.gz
dexon-solidity-827b1e2b3db4def5a296ad32b264e0a8612df064.tar.zst
dexon-solidity-827b1e2b3db4def5a296ad32b264e0a8612df064.zip
Merge pull request #1295 from CJentzsch/randomStateTests
Random state tests
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index a2e1eaf1..ddc929e4 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -84,12 +84,12 @@ ImportTest::ImportTest(json_spirit::mObject& _o, bool isFiller) : m_statePre(Add
void ImportTest::importEnv(json_spirit::mObject& _o)
{
- BOOST_REQUIRE(_o.count("previousHash") > 0);
- BOOST_REQUIRE(_o.count("currentGasLimit") > 0);
- BOOST_REQUIRE(_o.count("currentDifficulty") > 0);
- BOOST_REQUIRE(_o.count("currentTimestamp") > 0);
- BOOST_REQUIRE(_o.count("currentCoinbase") > 0);
- BOOST_REQUIRE(_o.count("currentNumber") > 0);
+ assert(_o.count("previousHash") > 0);
+ assert(_o.count("currentGasLimit") > 0);
+ assert(_o.count("currentDifficulty") > 0);
+ assert(_o.count("currentTimestamp") > 0);
+ assert(_o.count("currentCoinbase") > 0);
+ assert(_o.count("currentNumber") > 0);
m_environment.previousBlock.hash = h256(_o["previousHash"].get_str());
m_environment.currentBlock.number = toInt(_o["currentNumber"]);
@@ -108,10 +108,10 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
{
json_spirit::mObject o = i.second.get_obj();
- BOOST_REQUIRE(o.count("balance") > 0);
- BOOST_REQUIRE(o.count("nonce") > 0);
- BOOST_REQUIRE(o.count("storage") > 0);
- BOOST_REQUIRE(o.count("code") > 0);
+ assert(o.count("balance") > 0);
+ assert(o.count("nonce") > 0);
+ assert(o.count("storage") > 0);
+ assert(o.count("code") > 0);
if (bigint(o["balance"].get_str()) >= c_max256plus1)
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("State 'balance' is equal or greater than 2**256") );
@@ -144,12 +144,12 @@ void ImportTest::importTransaction(json_spirit::mObject& _o)
{
if (_o.count("secretKey") > 0)
{
- BOOST_REQUIRE(_o.count("nonce") > 0);
- BOOST_REQUIRE(_o.count("gasPrice") > 0);
- BOOST_REQUIRE(_o.count("gasLimit") > 0);
- BOOST_REQUIRE(_o.count("to") > 0);
- BOOST_REQUIRE(_o.count("value") > 0);
- BOOST_REQUIRE(_o.count("data") > 0);
+ assert(_o.count("nonce") > 0);
+ assert(_o.count("gasPrice") > 0);
+ assert(_o.count("gasLimit") > 0);
+ assert(_o.count("to") > 0);
+ assert(_o.count("value") > 0);
+ assert(_o.count("data") > 0);
if (bigint(_o["nonce"].get_str()) >= c_max256plus1)
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("Transaction 'nonce' is equal or greater than 2**256") );