aboutsummaryrefslogtreecommitdiffstats
path: root/state.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-03-15 02:59:17 +0800
committerGav Wood <i@gavwood.com>2015-03-15 02:59:17 +0800
commit65f2df15df85203993674a7c961599c525d7e36f (patch)
treecc89f196e8345d63c2414d9bc3ca2fcb266092c5 /state.cpp
parent1b09e5debba1e04627474ba8ec3b2b7d5bcd1fd6 (diff)
parentf15e1ef250dc9c2c32a2857d36920369ac5e62ce (diff)
downloaddexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.tar
dexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.tar.gz
dexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.tar.bz2
dexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.tar.lz
dexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.tar.xz
dexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.tar.zst
dexon-solidity-65f2df15df85203993674a7c961599c525d7e36f.zip
Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop
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 2f9ad628..d6790029 100644
--- a/state.cpp
+++ b/state.cpp
@@ -248,6 +248,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);