aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-11-29 22:53:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-16 23:28:38 +0000
commit4abf25f3c901016803515771cc19997d9a95bacb (patch)
treed50394f78de54d35af9970c67631dc2a9b63914a /tests
parentMerge pull request #2881 (diff)
downloadmonero-4abf25f3c901016803515771cc19997d9a95bacb.tar.xz
cryptonote_core does not depend on p2p anymore
As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary.
Diffstat (limited to 'tests')
-rw-r--r--tests/core_proxy/core_proxy.cpp2
-rw-r--r--tests/core_tests/chaingen.h2
-rw-r--r--tests/unit_tests/ban.cpp5
-rw-r--r--tests/unit_tests/main.cpp7
4 files changed, 15 insertions, 1 deletions
diff --git a/tests/core_proxy/core_proxy.cpp b/tests/core_proxy/core_proxy.cpp
index fd07a5d2e..d6c89fc39 100644
--- a/tests/core_proxy/core_proxy.cpp
+++ b/tests/core_proxy/core_proxy.cpp
@@ -42,8 +42,10 @@
#include "common/command_line.h"
#include "console_handler.h"
#include "p2p/net_node.h"
+#include "p2p/net_node.inl"
//#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
+#include "cryptonote_protocol/cryptonote_protocol_handler.inl"
#include "core_proxy.h"
#include "version.h"
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h
index 7cad04047..0dcbc7f0c 100644
--- a/tests/core_tests/chaingen.h
+++ b/tests/core_tests/chaingen.h
@@ -467,7 +467,7 @@ inline bool do_replay_events(std::vector<test_event_entry>& events)
// FIXME: make sure that vm has arg_testnet_on set to true or false if
// this test needs for it to be so.
get_test_options<t_test_class> gto;
- if (!c.init(vm, &gto.test_options))
+ if (!c.init(vm, NULL, &gto.test_options))
{
MERROR("Failed to init core");
return false;
diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp
index 242e5fe1c..5af514643 100644
--- a/tests/unit_tests/ban.cpp
+++ b/tests/unit_tests/ban.cpp
@@ -31,7 +31,9 @@
#include "gtest/gtest.h"
#include "cryptonote_core/cryptonote_core.h"
#include "p2p/net_node.h"
+#include "p2p/net_node.inl"
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
+#include "cryptonote_protocol/cryptonote_protocol_handler.inl"
#define MAKE_IPV4_ADDRESS(a,b,c,d) epee::net_utils::ipv4_network_address{MAKE_IP(a,b,c,d),0}
@@ -79,6 +81,7 @@ public:
cryptonote::difficulty_type get_block_cumulative_difficulty(uint64_t height) const { return 0; }
bool fluffy_blocks_enabled() const { return false; }
uint64_t prevalidate_block_hashes(uint64_t height, const std::list<crypto::hash> &hashes) { return 0; }
+ void stop() {}
};
typedef nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<test_core>> Server;
@@ -184,3 +187,5 @@ TEST(ban, add)
ASSERT_TRUE(t >= 4);
}
+namespace nodetool { template class node_server<cryptonote::t_cryptonote_protocol_handler<test_core>>; }
+namespace cryptonote { template class t_cryptonote_protocol_handler<test_core>; }
diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp
index 95ea67410..717a76289 100644
--- a/tests/unit_tests/main.cpp
+++ b/tests/unit_tests/main.cpp
@@ -33,6 +33,10 @@
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
+#include "p2p/net_node.h"
+#include "p2p/net_node.inl"
+#include "cryptonote_protocol/cryptonote_protocol_handler.h"
+#include "cryptonote_protocol/cryptonote_protocol_handler.inl"
#include "include_base_utils.h"
#include "common/command_line.h"
#include "common/util.h"
@@ -42,6 +46,9 @@ namespace po = boost::program_options;
boost::filesystem::path unit_test::data_dir;
+namespace nodetool { template class node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core>>; }
+namespace cryptonote { template class t_cryptonote_protocol_handler<cryptonote::core>; }
+
int main(int argc, char** argv)
{
tools::on_startup();