aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwinsvega <winsvega@mail.ru>2015-04-04 04:40:51 +0800
committerwinsvega <winsvega@mail.ru>2015-04-08 02:32:32 +0800
commitc38c8bb5676d39f52a1aef4f41b01c252a94e5ca (patch)
tree1c7acb6e7e3b0a35cf8cf886bb8665b7a2f3280f
parent923e452846241f9f97b7fb0dc3351c0c479089b6 (diff)
downloaddexon-solidity-c38c8bb5676d39f52a1aef4f41b01c252a94e5ca.tar.gz
dexon-solidity-c38c8bb5676d39f52a1aef4f41b01c252a94e5ca.tar.zst
dexon-solidity-c38c8bb5676d39f52a1aef4f41b01c252a94e5ca.zip
Check State
style changes
-rw-r--r--TestHelper.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 2c6ee8d4..80722465 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -157,7 +157,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state, stateOptio
_state.setStorage(address, toInt(j.first), toInt(j.second));
}
- for (int i=0; i<iNonce; ++i)
+ for (int i=0; i < iNonce; ++i)
_state.noteSending(address);
_state.ensureCached(address, false, false);
@@ -207,11 +207,13 @@ void ImportTest::importTransaction(json_spirit::mObject& _o)
void ImportTest::checkExpectedState(State const& _stateExpect, State const& _statePost, stateOptionsMap const _expectedStateOptions, WhenError _throw)
{
- #define CHECK(a,b) \
- if (_throw == WhenError::Throw) \
- BOOST_CHECK_MESSAGE(a,b); \
- else \
- BOOST_WARN_MESSAGE(a,b);
+ #define CHECK(a,b) \
+ { \
+ if (_throw == WhenError::Throw) \
+ BOOST_CHECK_MESSAGE(a,b); \
+ else \
+ BOOST_WARN_MESSAGE(a,b); \
+ }
for (auto const& a: _stateExpect.addresses())
{
@@ -233,16 +235,12 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta
}
if (addressOptions.m_bHasBalance)
- {
CHECK(_stateExpect.balance(a.first) == _statePost.balance(a.first),
"Check State: " << a.first << ": incorrect balance " << _statePost.balance(a.first) << ", expected " << _stateExpect.balance(a.first));
- }
if (addressOptions.m_bHasNonce)
- {
CHECK(_stateExpect.transactionsFrom(a.first) == _statePost.transactionsFrom(a.first),
"Check State: " << a.first << ": incorrect nonce " << _statePost.transactionsFrom(a.first) << ", expected " << _stateExpect.transactionsFrom(a.first));
- }
if (addressOptions.m_bHasStorage)
{
@@ -259,10 +257,8 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta
}
if (addressOptions.m_bHasCode)
- {
- CHECK(_stateExpect.code(a.first) == _statePost.code(a.first),
+ CHECK(_stateExpect.code(a.first) == _statePost.code(a.first),
"Check State: " << a.first << ": incorrect code '" << toHex(_statePost.code(a.first)) << "', expected '" << toHex(_stateExpect.code(a.first)) << "'");
- }
}
}
}