aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2014-12-12 06:36:23 +0800
committerCJentzsch <jentzsch.software@gmail.com>2014-12-12 06:36:23 +0800
commit473e10e0dc58b81905e5dfa6945e1926af54c015 (patch)
tree371525397b3f8d03b9f27b504225e94f88ce8a1a
parent98722ae8e842f54ff1dd67756cfeae7177431665 (diff)
downloaddexon-solidity-473e10e0dc58b81905e5dfa6945e1926af54c015.tar.gz
dexon-solidity-473e10e0dc58b81905e5dfa6945e1926af54c015.tar.zst
dexon-solidity-473e10e0dc58b81905e5dfa6945e1926af54c015.zip
fix trie test#
-rw-r--r--trie.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/trie.cpp b/trie.cpp
index 67f70691..e2117228 100644
--- a/trie.cpp
+++ b/trie.cpp
@@ -67,9 +67,14 @@ BOOST_AUTO_TEST_CASE(trie_tests)
cnote << i.first;
js::mObject& o = i.second.get_obj();
vector<pair<string, string>> ss;
- for (auto i: o["in"].get_obj())
+ for (auto i: o["in"].get_array())
{
- ss.push_back(make_pair(i.first, i.second.get_str()));
+ vector<string> values;
+ for (auto s: i.get_array())
+ values.push_back(s.get_str());
+
+ assert(values.size() == 2);
+ ss.push_back(make_pair(values[0], values[1]));
if (!ss.back().first.find("0x"))
ss.back().first = asString(fromHex(ss.back().first.substr(2)));
if (!ss.back().second.find("0x"))
@@ -88,7 +93,9 @@ BOOST_AUTO_TEST_CASE(trie_tests)
BOOST_REQUIRE(t.check(true));
}
BOOST_REQUIRE(!o["root"].is_null());
- BOOST_CHECK_EQUAL(o["root"].get_str(), toHex(t.root().asArray()));
+ BOOST_CHECK_EQUAL(o["root"].get_str(), "0x" + toHex(t.root().asArray()));
+ if (o["root"].get_str() != "0x" + toHex(t.root().asArray()))
+ break;
}
}
}