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:45:24 +0800
commit4dfa99b753b0792b0e688767785b5827a62e591a (patch)
tree65523c2b4c7c08207f249a29876af4ce7d89d001
parent0fa6b05a5a389e35e316b8c572c47a603c468e94 (diff)
downloaddexon-solidity-4dfa99b753b0792b0e688767785b5827a62e591a.tar.gz
dexon-solidity-4dfa99b753b0792b0e688767785b5827a62e591a.tar.zst
dexon-solidity-4dfa99b753b0792b0e688767785b5827a62e591a.zip
add memory tests
-rw-r--r--state.cpp39
1 files changed, 34 insertions, 5 deletions
diff --git a/state.cpp b/state.cpp
index f94d834b..d82b86b6 100644
--- a/state.cpp
+++ b/state.cpp
@@ -92,7 +92,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)
@@ -206,16 +205,46 @@ BOOST_AUTO_TEST_CASE(stMemoryStressTest)
}
}
- BOOST_AUTO_TEST_CASE(stSolidityTest)
- {
- dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests);
- }
+BOOST_AUTO_TEST_CASE(stSolidityTest)
+{
+ 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(stMemoryTest)
{
dev::test::executeTests("stMemoryTest", "/StateTests", dev::test::doStateTests);
}
+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";
+ }
+ }
+}
BOOST_AUTO_TEST_CASE(stCreateTest)
{