Check State

style changes
This commit is contained in:
winsvega 2015-04-03 23:40:51 +03:00
parent 923e452846
commit c38c8bb567

View File

@ -208,10 +208,12 @@ 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);
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,13 +257,11 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta
}
if (addressOptions.m_bHasCode)
{
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)) << "'");
}
}
}
}
void ImportTest::exportTest(bytes const& _output, State const& _statePost)
{