mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Repotting, renaming and reorganisation.
This commit is contained in:
parent
45ed60a2a2
commit
0b6763ddc1
@ -38,7 +38,7 @@ int stateTest()
|
|||||||
|
|
||||||
Defaults::setDBPath(boost::filesystem::temp_directory_path().string());
|
Defaults::setDBPath(boost::filesystem::temp_directory_path().string());
|
||||||
|
|
||||||
Overlay stateDB = State::openDB();
|
OverlayDB stateDB = State::openDB();
|
||||||
BlockChain bc;
|
BlockChain bc;
|
||||||
State s(myMiner.address(), stateDB);
|
State s(myMiner.address(), stateDB);
|
||||||
|
|
||||||
|
26
trie.cpp
26
trie.cpp
@ -63,8 +63,8 @@ BOOST_AUTO_TEST_CASE(trie_tests)
|
|||||||
for (unsigned j = 0; j < eth::test::fac((unsigned)ss.size()); ++j)
|
for (unsigned j = 0; j < eth::test::fac((unsigned)ss.size()); ++j)
|
||||||
{
|
{
|
||||||
next_permutation(ss.begin(), ss.end());
|
next_permutation(ss.begin(), ss.end());
|
||||||
BasicMap m;
|
MemoryDB m;
|
||||||
GenericTrieDB<BasicMap> t(&m);
|
GenericTrieDB<MemoryDB> t(&m);
|
||||||
t.init();
|
t.init();
|
||||||
BOOST_REQUIRE(t.check(true));
|
BOOST_REQUIRE(t.check(true));
|
||||||
for (auto const& k: ss)
|
for (auto const& k: ss)
|
||||||
@ -91,8 +91,8 @@ BOOST_AUTO_TEST_CASE(moreTrieTests)
|
|||||||
#if 0
|
#if 0
|
||||||
// More tests...
|
// More tests...
|
||||||
{
|
{
|
||||||
BasicMap m;
|
MemoryDB m;
|
||||||
GenericTrieDB<BasicMap> t(&m);
|
GenericTrieDB<MemoryDB> t(&m);
|
||||||
t.init(); // initialise as empty tree.
|
t.init(); // initialise as empty tree.
|
||||||
cout << t;
|
cout << t;
|
||||||
cout << m;
|
cout << m;
|
||||||
@ -125,8 +125,8 @@ BOOST_AUTO_TEST_CASE(moreTrieTests)
|
|||||||
cout << hash256(StringMap()) << endl;
|
cout << hash256(StringMap()) << endl;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
BasicMap m;
|
MemoryDB m;
|
||||||
GenericTrieDB<BasicMap> t(&m);
|
GenericTrieDB<MemoryDB> t(&m);
|
||||||
t.init(); // initialise as empty tree.
|
t.init(); // initialise as empty tree.
|
||||||
t.insert(string("a"), string("A"));
|
t.insert(string("a"), string("A"));
|
||||||
t.insert(string("b"), string("B"));
|
t.insert(string("b"), string("B"));
|
||||||
@ -160,8 +160,8 @@ BOOST_AUTO_TEST_CASE(moreTrieTests)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
BasicMap m;
|
MemoryDB m;
|
||||||
GenericTrieDB<BasicMap> d(&m);
|
GenericTrieDB<MemoryDB> d(&m);
|
||||||
d.init(); // initialise as empty tree.
|
d.init(); // initialise as empty tree.
|
||||||
MemTrie t;
|
MemTrie t;
|
||||||
StringMap s;
|
StringMap s;
|
||||||
@ -233,10 +233,10 @@ BOOST_AUTO_TEST_CASE(trieStess)
|
|||||||
{
|
{
|
||||||
cnote << "Stress-testing Trie...";
|
cnote << "Stress-testing Trie...";
|
||||||
{
|
{
|
||||||
BasicMap m;
|
MemoryDB m;
|
||||||
BasicMap dm;
|
MemoryDB dm;
|
||||||
EnforceRefs e(dm, true);
|
EnforceRefs e(dm, true);
|
||||||
GenericTrieDB<BasicMap> d(&dm);
|
GenericTrieDB<MemoryDB> d(&dm);
|
||||||
d.init(); // initialise as empty tree.
|
d.init(); // initialise as empty tree.
|
||||||
MemTrie t;
|
MemTrie t;
|
||||||
BOOST_REQUIRE(d.check(true));
|
BOOST_REQUIRE(d.check(true));
|
||||||
@ -267,9 +267,9 @@ BOOST_AUTO_TEST_CASE(trieStess)
|
|||||||
for (auto i: d)
|
for (auto i: d)
|
||||||
cwarn << i.first.toString() << i.second.toString();
|
cwarn << i.first.toString() << i.second.toString();
|
||||||
|
|
||||||
BasicMap dm2;
|
MemoryDB dm2;
|
||||||
EnforceRefs e2(dm2, true);
|
EnforceRefs e2(dm2, true);
|
||||||
GenericTrieDB<BasicMap> d2(&dm2);
|
GenericTrieDB<MemoryDB> d2(&dm2);
|
||||||
d2.init(); // initialise as empty tree.
|
d2.init(); // initialise as empty tree.
|
||||||
for (auto i: d)
|
for (auto i: d)
|
||||||
d2.insert(i.first, i.second);
|
d2.insert(i.first, i.second);
|
||||||
|
Loading…
Reference in New Issue
Block a user