diff --git a/CMakeLists.txt b/CMakeLists.txt index be6e1f92d..7e49a51ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,8 @@ link_directories(../libethereum) add_executable(testeth ${SRC_LIST}) +FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS unit_test_framework) + if (${TARGET_PLATFORM} STREQUAL "w64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") target_link_libraries(testeth gcc) diff --git a/trie.cpp b/trie.cpp index 1ba698333..51735ed90 100644 --- a/trie.cpp +++ b/trie.cpp @@ -55,13 +55,18 @@ BOOST_AUTO_TEST_CASE(trie_tests) js::read_string(s, v); for (auto& i: v.get_obj()) { + cnote << i.first; js::mObject& o = i.second.get_obj(); -// cnote << i.first; vector<pair<string, string>> ss; - for (auto& i: o["in"].get_obj()) + for (auto i: o["in"].get_obj()) + { ss.push_back(make_pair(i.first, i.second.get_str())); - cnote << ss; - for (unsigned j = 0; j < eth::test::fac((unsigned)ss.size()); ++j) + if (!ss.back().first.find("0x")) + ss.back().first = asString(fromHex(ss.back().first.substr(2))); + if (!ss.back().second.find("0x")) + ss.back().second = asString(fromHex(ss.back().second.substr(2))); + } + for (unsigned j = 0; j < min(1000u, eth::test::fac((unsigned)ss.size())); ++j) { next_permutation(ss.begin(), ss.end()); MemoryDB m; @@ -70,7 +75,6 @@ BOOST_AUTO_TEST_CASE(trie_tests) BOOST_REQUIRE(t.check(true)); for (auto const& k: ss) { -// cdebug << k.first << k.second; t.insert(k.first, k.second); BOOST_REQUIRE(t.check(true)); }