aboutsummaryrefslogtreecommitdiffstats
path: root/TestUtils.cpp
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-26 02:51:08 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-26 02:51:08 +0800
commit9a032ef39fba817c965f3850aacafecb8f89cf7a (patch)
treea071e2b7dbbf970177499d4852fe2f842a0f1488 /TestUtils.cpp
parentac558b0377ae30223347dae215b823b6b55e5046 (diff)
downloaddexon-solidity-9a032ef39fba817c965f3850aacafecb8f89cf7a.tar.gz
dexon-solidity-9a032ef39fba817c965f3850aacafecb8f89cf7a.tar.zst
dexon-solidity-9a032ef39fba817c965f3850aacafecb8f89cf7a.zip
fixes for test/TestUtils.h
Diffstat (limited to 'TestUtils.cpp')
-rw-r--r--TestUtils.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/TestUtils.cpp b/TestUtils.cpp
index 71eeadb3..6222955d 100644
--- a/TestUtils.cpp
+++ b/TestUtils.cpp
@@ -19,8 +19,6 @@
* @date 2015
*/
-#include <ctime>
-#include <random>
#include <thread>
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
@@ -28,10 +26,6 @@
#include <libtestutils/FixedClient.h>
#include "TestUtils.h"
-// used methods from TestHelper:
-// getTestPath
-#include "TestHelper.h"
-
using namespace std;
using namespace dev;
using namespace dev::eth;
@@ -73,19 +67,12 @@ std::string dev::test::getCommandLineArgument(string const& _name, bool _require
return "";
}
-bool LoadTestFileFixture::m_loaded = false;
-Json::Value LoadTestFileFixture::m_json;
-
LoadTestFileFixture::LoadTestFileFixture()
{
- if (!m_loaded)
- {
- m_json = loadJsonFromFile(toTestFilePath(getCommandLineArgument("--eth_testfile")));
- m_loaded = true;
- }
+ m_json = loadJsonFromFile(toTestFilePath(getCommandLineArgument("--eth_testfile")));
}
-void ParallelFixture::enumerateThreads(std::function<void()> callback)
+void ParallelFixture::enumerateThreads(std::function<void()> callback) const
{
size_t threadsCount = std::stoul(getCommandLineArgument("--eth_threads"), nullptr, 10);
@@ -99,7 +86,7 @@ void ParallelFixture::enumerateThreads(std::function<void()> callback)
});
}
-void BlockChainFixture::enumerateBlockchains(std::function<void(Json::Value const&, dev::eth::BlockChain&, State state)> callback)
+void BlockChainFixture::enumerateBlockchains(std::function<void(Json::Value const&, dev::eth::BlockChain const&, State state)> callback) const
{
for (string const& name: m_json.getMemberNames())
{
@@ -108,16 +95,16 @@ void BlockChainFixture::enumerateBlockchains(std::function<void(Json::Value cons
}
}
-void ClientBaseFixture::enumerateClients(std::function<void(Json::Value const&, dev::eth::ClientBase&)> callback)
+void ClientBaseFixture::enumerateClients(std::function<void(Json::Value const&, dev::eth::ClientBase&)> callback) const
{
- enumerateBlockchains([&callback](Json::Value const& _json, BlockChain& _bc, State _state) -> void
+ enumerateBlockchains([&callback](Json::Value const& _json, BlockChain const& _bc, State _state) -> void
{
FixedClient client(_bc, _state);
callback(_json, client);
});
}
-void ParallelClientBaseFixture::enumerateClients(std::function<void(Json::Value const&, dev::eth::ClientBase&)> callback)
+void ParallelClientBaseFixture::enumerateClients(std::function<void(Json::Value const&, dev::eth::ClientBase&)> callback) const
{
ClientBaseFixture::enumerateClients([this, &callback](Json::Value const& _json, dev::eth::ClientBase& _client) -> void
{