aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.h
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-06-18 10:31:41 +0800
committerGav Wood <g@ethdev.com>2015-06-18 10:31:41 +0800
commit6c27ef73670185e5adf8f84c4bcfbf9ce860defd (patch)
tree86f1910387e6f85a9dbf0c4034c8137978b76b58 /TestHelper.h
parent81b6590c7ef56bd4fa6547d09c64d1ba969cf8fb (diff)
parent1a88eaa6bd657290f764ed064ea948d7905c0311 (diff)
downloaddexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.tar
dexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.tar.gz
dexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.tar.bz2
dexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.tar.lz
dexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.tar.xz
dexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.tar.zst
dexon-solidity-6c27ef73670185e5adf8f84c4bcfbf9ce860defd.zip
Merge pull request #2075 from winsvega/fuzz
FuzzTests
Diffstat (limited to 'TestHelper.h')
-rw-r--r--TestHelper.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/TestHelper.h b/TestHelper.h
index 8f0c73bf..df33c00d 100644
--- a/TestHelper.h
+++ b/TestHelper.h
@@ -31,6 +31,26 @@
#include <libevm/ExtVMFace.h>
#include <libtestutils/Common.h>
+#ifdef NOBOOST
+ #define TBOOST_THROW_EXCEPTION(arg) throw dev::Exception();
+ #define TBOOST_REQUIRE(arg) if(arg == false) throw dev::Exception();
+ #define TBOOST_REQUIRE_EQUAL(arg1, arg2) if(arg1 != arg2) throw dev::Exception();
+ #define TBOOST_CHECK_EQUAL(arg1, arg2) if(arg1 != arg2) throw dev::Exception();
+ #define TBOOST_CHECK(arg) if(arg == false) throw dev::Exception();
+ #define TBOOST_CHECK_MESSAGE(arg1, arg2) if(arg1 == false) throw dev::Exception();
+ #define TBOOST_WARN_MESSAGE(arg1, arg2) throw dev::Exception();
+ #define TBOOST_ERROR(arg) throw dev::Exception();
+#else
+ #define TBOOST_THROW_EXCEPTION(arg) BOOST_THROW_EXCEPTION(arg)
+ #define TBOOST_REQUIRE(arg) BOOST_REQUIRE(arg)
+ #define TBOOST_REQUIRE_EQUAL(arg1, arg2) BOOST_REQUIRE_EQUAL(arg1, arg2)
+ #define TBOOST_CHECK(arg) BOOST_CHECK(arg)
+ #define TBOOST_CHECK_EQUAL(arg1, arg2) BOOST_CHECK_EQUAL(arg1, arg2)
+ #define TBOOST_CHECK_MESSAGE(arg1, arg2) BOOST_CHECK_MESSAGE(arg1, arg2)
+ #define TBOOST_WARN_MESSAGE(arg1, arg2) BOOST_WARN_MESSAGE(arg1, arg2)
+ #define TBOOST_ERROR(arg) BOOST_ERROR(arg)
+#endif
+
namespace dev
{
namespace eth
@@ -163,6 +183,12 @@ eth::LastHashes lastHashes(u256 _currentBlockNumber);
json_spirit::mObject fillJsonWithState(eth::State _state);
json_spirit::mObject fillJsonWithTransaction(eth::Transaction _txn);
+//Fill Test Functions
+void doTransactionTests(json_spirit::mValue& _v, bool _fillin);
+void doStateTests(json_spirit::mValue& v, bool _fillin);
+void doVMTests(json_spirit::mValue& v, bool _fillin);
+void doBlockchainTests(json_spirit::mValue& _v, bool _fillin);
+
template<typename mapType>
void checkAddresses(mapType& _expectedAddrs, mapType& _resultAddrs)
{
@@ -171,9 +197,9 @@ void checkAddresses(mapType& _expectedAddrs, mapType& _resultAddrs)
auto& resultAddr = resultPair.first;
auto expectedAddrIt = _expectedAddrs.find(resultAddr);
if (expectedAddrIt == _expectedAddrs.end())
- BOOST_ERROR("Missing result address " << resultAddr);
+ TBOOST_ERROR("Missing result address " << resultAddr);
}
- BOOST_CHECK(_expectedAddrs == _resultAddrs);
+ TBOOST_CHECK((_expectedAddrs == _resultAddrs));
}
class Options