aboutsummaryrefslogtreecommitdiffstats
path: root/state.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-03-12 18:01:06 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-03-12 18:01:06 +0800
commit437e5c222b70f1971d3f8183caa623bc1b4e92d9 (patch)
treed93ef172b36542849a0455c17c25af4911fc75bb /state.cpp
parentcf5f86e384889e21ff6af17ae9dbb222bb047787 (diff)
downloaddexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar
dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.gz
dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.bz2
dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.lz
dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.xz
dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.zst
dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.zip
add check random state test for jit
Diffstat (limited to 'state.cpp')
-rw-r--r--state.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/state.cpp b/state.cpp
index 5202aff2..1c8f4301 100644
--- a/state.cpp
+++ b/state.cpp
@@ -251,6 +251,39 @@ BOOST_AUTO_TEST_CASE(stCreateTest)
}
}
+BOOST_AUTO_TEST_CASE(stRandom)
+{
+ string testPath = dev::test::getTestPath();
+ testPath += "/StateTests/RandomTests";
+
+ vector<boost::filesystem::path> testFiles;
+ boost::filesystem::directory_iterator iterator(testPath);
+ for(; iterator != boost::filesystem::directory_iterator(); ++iterator)
+ if (boost::filesystem::is_regular_file(iterator->path()) && iterator->path().extension() == ".json")
+ testFiles.push_back(iterator->path());
+
+ for (auto& path: testFiles)
+ {
+ try
+ {
+ cnote << "Testing ..." << path.filename();
+ json_spirit::mValue v;
+ string s = asString(dev::contents(path.string()));
+ BOOST_REQUIRE_MESSAGE(s.length() > 0, "Content of " + path.string() + " is empty. Have you cloned the 'tests' repo branch develop and set ETHEREUM_TEST_PATH to its path?");
+ json_spirit::read_string(s, v);
+ dev::test::doStateTests(v, false);
+ }
+ catch (Exception const& _e)
+ {
+ BOOST_ERROR("Failed test with Exception: " << diagnostic_information(_e));
+ }
+ catch (std::exception const& _e)
+ {
+ BOOST_ERROR("Failed test with Exception: " << _e.what());
+ }
+ }
+}
+
BOOST_AUTO_TEST_CASE(userDefinedFileState)
{
dev::test::userDefinedTest("--singletest", dev::test::doStateTests);