diff options
author | CJentzsch <jentzsch.software@gmail.com> | 2015-03-12 16:16:32 +0800 |
---|---|---|
committer | CJentzsch <jentzsch.software@gmail.com> | 2015-03-12 16:16:32 +0800 |
commit | cf5f86e384889e21ff6af17ae9dbb222bb047787 (patch) | |
tree | cff998cdaafebe838c94d6deb66c75ff55392cec /TestHelper.cpp | |
parent | 7a769c4a00bdfeca9073be0c5083587c4438cd05 (diff) | |
download | dexon-solidity-cf5f86e384889e21ff6af17ae9dbb222bb047787.tar.gz dexon-solidity-cf5f86e384889e21ff6af17ae9dbb222bb047787.tar.zst dexon-solidity-cf5f86e384889e21ff6af17ae9dbb222bb047787.zip |
create random state tests
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r-- | TestHelper.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index 9ac64107..4d556341 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") ); |