diff options
author | winsvega <winsvega@mail.ru> | 2015-03-28 05:48:51 +0800 |
---|---|---|
committer | winsvega <winsvega@mail.ru> | 2015-04-08 02:32:32 +0800 |
commit | 2e71a91323124df1ecc7ca2e201f0b64ac9ef892 (patch) | |
tree | a9fdee4c7c29665d248c4698771c525c0e69268c /TestHelper.cpp | |
parent | adba4fb9a136ec27d6fc3e295c43a6f0f04ae865 (diff) | |
download | dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.tar dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.tar.gz dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.tar.bz2 dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.tar.lz dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.tar.xz dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.tar.zst dexon-solidity-2e71a91323124df1ecc7ca2e201f0b64ac9ef892.zip |
Check State
State tests with expect section
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r-- | TestHelper.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index a830636d..0061b2ee 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -170,9 +170,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state) stateOptionsMap importedMap; importState(_o, _state, importedMap); for (auto& stateOptionMap: importedMap) - { assert(stateOptionMap.second.isAllSet()); //check that every parameter was declared in state object - } } void ImportTest::importTransaction(json_spirit::mObject& _o) @@ -256,10 +254,14 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta { map<u256, u256> stateStorage = _statePost.storage(a.first); for (auto const& s: _stateExpect.storage(a.first)) - { CHECK(stateStorage[s.first] == s.second, "Check State: " << a.first << ": incorrect storage [" << s.first << "] = " << toHex(stateStorage[s.first]) << ", expected [" << s.first << "] = " << toHex(s.second)); - } + + //Check for unexpected storage values + stateStorage = _stateExpect.storage(a.first); + for (auto const& s: _statePost.storage(a.first)) + CHECK(stateStorage[s.first] == s.second, + "Check State: " << a.first << ": incorrect storage [" << s.first << "] = " << toHex(s.second) << ", expected [" << s.first << "] = " << toHex(stateStorage[s.first])); } if (addressOptions.m_bHasCode) |