aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-05-28 22:28:41 +0800
committerGav Wood <i@gavwood.com>2014-05-28 22:28:41 +0800
commite3934b240108d58108030826d9c21af36498b6df (patch)
tree5d94cb98f8c76bcab9b8ad501b4efcfed851a018 /main.cpp
parenta418c6c09c7cf6f0dd2f1a9cd0dd7ec9cc121c12 (diff)
downloaddexon-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.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 35e56d19..42e67344 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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());
}
}
}