aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-03-03 04:19:36 +0800
committerGav Wood <i@gavwood.com>2015-03-06 19:19:43 +0800
commit39916e99cce9c76e8770a41f13798380c9cca555 (patch)
tree274fdbc2a9183b0ae67f36bd3aff726563f21c2c
parente043f63819953dd00a3ed9d403d7d5d29fa8b148 (diff)
downloaddexon-solidity-39916e99cce9c76e8770a41f13798380c9cca555.tar.gz
dexon-solidity-39916e99cce9c76e8770a41f13798380c9cca555.tar.zst
dexon-solidity-39916e99cce9c76e8770a41f13798380c9cca555.zip
add memory tests
-rw-r--r--TestHelper.cpp2
-rw-r--r--stMemoryTestFiller.json4
-rw-r--r--state.cpp68
3 files changed, 37 insertions, 37 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index ea44111c..1d544304 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -203,6 +203,8 @@ void ImportTest::exportTest(bytes _output, State& _statePost)
}
m_TestObject["post"] = json_spirit::mValue(postState);
+ m_TestObject["postStateRoot"] = toHex(_statePost.rootHash().asBytes());
+
// export pre state
json_spirit::mObject preState;
diff --git a/stMemoryTestFiller.json b/stMemoryTestFiller.json
index e2b3b95a..eac2d587 100644
--- a/stMemoryTestFiller.json
+++ b/stMemoryTestFiller.json
@@ -1459,7 +1459,5 @@
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"data" : "0xff55883355001144bbccddffeeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
- },
-
-
+ }
}
diff --git a/state.cpp b/state.cpp
index 37ffa7f8..85bc7530 100644
--- a/state.cpp
+++ b/state.cpp
@@ -91,7 +91,6 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
// check addresses
#if ETH_FATDB
- cout << "fatDB is defined\n";
auto expectedAddrs = importer.m_statePost.addresses();
auto resultAddrs = theState.addresses();
for (auto& expectedPair : expectedAddrs)
@@ -171,50 +170,51 @@ BOOST_AUTO_TEST_CASE(stBlockHashTest)
BOOST_AUTO_TEST_CASE(stQuadraticComplexityTest)
{
- for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
- {
- string arg = boost::unit_test::framework::master_test_suite().argv[i];
- if (arg == "--quadratic" || arg == "--all")
- {
- auto start = chrono::steady_clock::now();
-
- dev::test::executeTests("stQuadraticComplexityTest", "/StateTests", dev::test::doStateTests);
-
- auto end = chrono::steady_clock::now();
- auto duration(chrono::duration_cast<chrono::milliseconds>(end - start));
- cnote << "test duration: " << duration.count() << " milliseconds.\n";
- }
- }
+ for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
+ {
+ string arg = boost::unit_test::framework::master_test_suite().argv[i];
+ if (arg == "--quadratic" || arg == "--all")
+ {
+ auto start = chrono::steady_clock::now();
+
+ dev::test::executeTests("stQuadraticComplexityTest", "/StateTests", dev::test::doStateTests);
+
+ auto end = chrono::steady_clock::now();
+ auto duration(chrono::duration_cast<chrono::milliseconds>(end - start));
+ cnote << "test duration: " << duration.count() << " milliseconds.\n";
+ }
+ }
}
BOOST_AUTO_TEST_CASE(stMemoryStressTest)
{
- for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
- {
- string arg = boost::unit_test::framework::master_test_suite().argv[i];
- if (arg == "--memory" || arg == "--all")
- {
- auto start = chrono::steady_clock::now();
-
- dev::test::executeTests("stMemoryStressTest", "/StateTests", dev::test::doStateTests);
-
- auto end = chrono::steady_clock::now();
- auto duration(chrono::duration_cast<chrono::milliseconds>(end - start));
- cnote << "test duration: " << duration.count() << " milliseconds.\n";
- }
- }
+ for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
+ {
+ string arg = boost::unit_test::framework::master_test_suite().argv[i];
+ if (arg == "--memory" || arg == "--all")
+ {
+ auto start = chrono::steady_clock::now();
+
+ dev::test::executeTests("stMemoryStressTest", "/StateTests", dev::test::doStateTests);
+
+ auto end = chrono::steady_clock::now();
+ auto duration(chrono::duration_cast<chrono::milliseconds>(end - start));
+ cnote << "test duration: " << duration.count() << " milliseconds.\n";
+ }
+ }
}
-BOOST_AUTO_TEST_CASE(stSolidityTest)
-{
- dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests);
-}
+ BOOST_AUTO_TEST_CASE(stSolidityTest)
+ {
+ dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests);
+ }
BOOST_AUTO_TEST_CASE(stMemoryTest)
{
- dev::test::executeTests("stMemoryTest", "/StateTests", dev::test::doStateTests);
+ dev::test::executeTests("stMemoryTest", "/StateTests", dev::test::doStateTests);
}
+
BOOST_AUTO_TEST_CASE(stCreateTest)
{
for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)