diff options
author | Gav Wood <i@gavwood.com> | 2014-05-28 22:28:41 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2014-05-28 22:28:41 +0800 |
commit | e3934b240108d58108030826d9c21af36498b6df (patch) | |
tree | 5d94cb98f8c76bcab9b8ad501b4efcfed851a018 /main.cpp | |
parent | a418c6c09c7cf6f0dd2f1a9cd0dd7ec9cc121c12 (diff) | |
download | dexon-solidity-e3934b240108d58108030826d9c21af36498b6df.tar.gz dexon-solidity-e3934b240108d58108030826d9c21af36498b6df.tar.zst dexon-solidity-e3934b240108d58108030826d9c21af36498b6df.zip |
Tests updated.
Fixes to executive logging.
Trie testing made considerably more rigourous.
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -42,15 +42,18 @@ using namespace eth; BOOST_AUTO_TEST_CASE(basic_tests) { + cdebug << "Stress-testing Trie..."; { BasicMap m; + EnforceRefs e(m, true); GenericTrieDB<BasicMap> d(&m); d.init(); // initialise as empty tree. MemTrie t; - for (int a = 0; a < 20; ++a) + assert(d.check().empty()); + for (int a = 0; a < 100; ++a) { StringMap m; - for (int i = 0; i < 20; ++i) + for (int i = 0; i < 100; ++i) { auto k = randomWord(); auto v = toString(i); @@ -59,6 +62,7 @@ BOOST_AUTO_TEST_CASE(basic_tests) d.insert(k, v); assert(hash256(m) == t.hash256()); assert(hash256(m) == d.root()); + assert(d.check().empty()); } while (!m.empty()) { @@ -68,6 +72,7 @@ BOOST_AUTO_TEST_CASE(basic_tests) m.erase(k); assert(hash256(m) == t.hash256()); assert(hash256(m) == d.root()); + assert(d.check().empty()); } } } |