From f6cdf1eacd05eef254988353e62f7209ebc259d5 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Sun, 13 Jun 2021 15:29:03 +0200 Subject: [PATCH] Moving nano::system out of the node library and in to the test_core library since it is a testing class. Also renaming file from testing.c/hpp to system.c/hpp to better represent what the file contains. --- CMakeLists.txt | 1 + nano/core_test/active_transactions.cpp | 2 +- nano/core_test/block_store.cpp | 2 +- nano/core_test/bootstrap.cpp | 2 +- nano/core_test/confirmation_height.cpp | 2 +- nano/core_test/confirmation_solicitor.cpp | 2 +- nano/core_test/conflicts.cpp | 2 +- nano/core_test/difficulty.cpp | 2 +- nano/core_test/distributed_work.cpp | 2 +- nano/core_test/election.cpp | 2 +- nano/core_test/election_scheduler.cpp | 2 +- nano/core_test/frontiers_confirmation.cpp | 2 +- nano/core_test/gap_cache.cpp | 2 +- nano/core_test/ipc.cpp | 2 +- nano/core_test/ledger.cpp | 2 +- nano/core_test/message_parser.cpp | 2 +- nano/core_test/network.cpp | 2 +- nano/core_test/node.cpp | 2 +- nano/core_test/peer_container.cpp | 2 +- nano/core_test/request_aggregator.cpp | 2 +- nano/core_test/socket.cpp | 2 +- nano/core_test/telemetry.cpp | 2 +- nano/core_test/vote_processor.cpp | 2 +- nano/core_test/voting.cpp | 2 +- nano/core_test/wallet.cpp | 2 +- nano/core_test/wallets.cpp | 2 +- nano/core_test/websocket.cpp | 2 +- nano/node/CMakeLists.txt | 2 -- nano/node/node.cpp | 4 ++-- nano/node/vote_processor.hpp | 1 + nano/qt_system/entry.cpp | 2 +- nano/qt_test/qt.cpp | 2 +- nano/rpc_test/rpc.cpp | 2 +- nano/slow_test/node.cpp | 2 +- nano/test_common/CMakeLists.txt | 11 +++++++++-- nano/test_common/network.cpp | 2 +- nano/{node/testing.cpp => test_common/system.cpp} | 2 +- nano/{node/testing.hpp => test_common/system.hpp} | 0 nano/test_common/testutil.cpp | 2 +- 39 files changed, 46 insertions(+), 39 deletions(-) rename nano/{node/testing.cpp => test_common/system.cpp} (99%) rename nano/{node/testing.hpp => test_common/system.hpp} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70384f03..4c86e995 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -610,6 +610,7 @@ if(NANO_GUI OR RAIBLOCKS_GUI) node secure nano_lib + test_common libminiupnpc-static Qt5::Gui Qt5::Widgets) diff --git a/nano/core_test/active_transactions.cpp b/nano/core_test/active_transactions.cpp index 51395967..9e889ad5 100644 --- a/nano/core_test/active_transactions.cpp +++ b/nano/core_test/active_transactions.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/nano/core_test/block_store.cpp b/nano/core_test/block_store.cpp index 7f6c857e..7da7c92b 100644 --- a/nano/core_test/block_store.cpp +++ b/nano/core_test/block_store.cpp @@ -7,10 +7,10 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/nano/core_test/bootstrap.cpp b/nano/core_test/bootstrap.cpp index 6433dad4..98bc0bd5 100644 --- a/nano/core_test/bootstrap.cpp +++ b/nano/core_test/bootstrap.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/nano/core_test/confirmation_height.cpp b/nano/core_test/confirmation_height.cpp index 311e7646..ba0d5361 100644 --- a/nano/core_test/confirmation_height.cpp +++ b/nano/core_test/confirmation_height.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/nano/core_test/confirmation_solicitor.cpp b/nano/core_test/confirmation_solicitor.cpp index 907ef5fe..b32ee2ea 100644 --- a/nano/core_test/confirmation_solicitor.cpp +++ b/nano/core_test/confirmation_solicitor.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/nano/core_test/conflicts.cpp b/nano/core_test/conflicts.cpp index 1bbb1a8c..33940bab 100644 --- a/nano/core_test/conflicts.cpp +++ b/nano/core_test/conflicts.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/nano/core_test/difficulty.cpp b/nano/core_test/difficulty.cpp index 1f9e8e2e..83cd5d38 100644 --- a/nano/core_test/difficulty.cpp +++ b/nano/core_test/difficulty.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include diff --git a/nano/core_test/distributed_work.cpp b/nano/core_test/distributed_work.cpp index 91a054e9..9cf30333 100644 --- a/nano/core_test/distributed_work.cpp +++ b/nano/core_test/distributed_work.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/nano/core_test/election.cpp b/nano/core_test/election.cpp index 0dabbdec..941fc618 100644 --- a/nano/core_test/election.cpp +++ b/nano/core_test/election.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/nano/core_test/election_scheduler.cpp b/nano/core_test/election_scheduler.cpp index c95dc392..12cb23de 100644 --- a/nano/core_test/election_scheduler.cpp +++ b/nano/core_test/election_scheduler.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/nano/core_test/frontiers_confirmation.cpp b/nano/core_test/frontiers_confirmation.cpp index 120a71bc..faa6edea 100644 --- a/nano/core_test/frontiers_confirmation.cpp +++ b/nano/core_test/frontiers_confirmation.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/nano/core_test/gap_cache.cpp b/nano/core_test/gap_cache.cpp index d87a0712..966df140 100644 --- a/nano/core_test/gap_cache.cpp +++ b/nano/core_test/gap_cache.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/nano/core_test/ipc.cpp b/nano/core_test/ipc.cpp index 012a2e56..a12ce3e7 100644 --- a/nano/core_test/ipc.cpp +++ b/nano/core_test/ipc.cpp @@ -2,8 +2,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/nano/core_test/ledger.cpp b/nano/core_test/ledger.cpp index df136786..d2990d8c 100644 --- a/nano/core_test/ledger.cpp +++ b/nano/core_test/ledger.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/nano/core_test/message_parser.cpp b/nano/core_test/message_parser.cpp index 20fc2e6c..5d54e173 100644 --- a/nano/core_test/message_parser.cpp +++ b/nano/core_test/message_parser.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/nano/core_test/network.cpp b/nano/core_test/network.cpp index 600fdac1..6b17ef89 100644 --- a/nano/core_test/network.cpp +++ b/nano/core_test/network.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include #include #include diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 47d6c853..8ebf3d95 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -1,8 +1,8 @@ #include #include -#include #include #include +#include #include #include diff --git a/nano/core_test/peer_container.cpp b/nano/core_test/peer_container.cpp index 9914ab3e..c4150cf9 100644 --- a/nano/core_test/peer_container.cpp +++ b/nano/core_test/peer_container.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/nano/core_test/request_aggregator.cpp b/nano/core_test/request_aggregator.cpp index 28758cf9..f60dd14c 100644 --- a/nano/core_test/request_aggregator.cpp +++ b/nano/core_test/request_aggregator.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/nano/core_test/socket.cpp b/nano/core_test/socket.cpp index eedab399..afba0c07 100644 --- a/nano/core_test/socket.cpp +++ b/nano/core_test/socket.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/nano/core_test/telemetry.cpp b/nano/core_test/telemetry.cpp index 1ad42c4e..13792edf 100644 --- a/nano/core_test/telemetry.cpp +++ b/nano/core_test/telemetry.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include diff --git a/nano/core_test/vote_processor.cpp b/nano/core_test/vote_processor.cpp index 72869e4c..4b40c740 100644 --- a/nano/core_test/vote_processor.cpp +++ b/nano/core_test/vote_processor.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include diff --git a/nano/core_test/voting.cpp b/nano/core_test/voting.cpp index 2abe3da4..32bb33c7 100644 --- a/nano/core_test/voting.cpp +++ b/nano/core_test/voting.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include diff --git a/nano/core_test/wallet.cpp b/nano/core_test/wallet.cpp index dc98ff05..7702b18c 100644 --- a/nano/core_test/wallet.cpp +++ b/nano/core_test/wallet.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include diff --git a/nano/core_test/wallets.cpp b/nano/core_test/wallets.cpp index 21871a05..facf35c7 100644 --- a/nano/core_test/wallets.cpp +++ b/nano/core_test/wallets.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/nano/core_test/websocket.cpp b/nano/core_test/websocket.cpp index 4484bdb9..412a9f53 100644 --- a/nano/core_test/websocket.cpp +++ b/nano/core_test/websocket.cpp @@ -1,7 +1,7 @@ #include -#include #include #include +#include #include #include diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index dd2d92e1..d00f6a78 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -128,8 +128,6 @@ add_library( state_block_signature_verification.cpp telemetry.hpp telemetry.cpp - testing.hpp - testing.cpp transport/tcp.hpp transport/tcp.cpp transport/transport.hpp diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 79ce1bef..374e4e24 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -6,10 +6,10 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -1781,7 +1781,7 @@ nano::node_wrapper::node_wrapper (boost::filesystem::path const & path_a, boost: } auto & node_config = daemon_config.node; - node_config.peering_port = nano::get_available_port (); + //node_config.peering_port = nano::get_available_port (); node_config.logging.max_size = std::numeric_limits::max (); node_config.logging.init (path_a); diff --git a/nano/node/vote_processor.hpp b/nano/node/vote_processor.hpp index 9dab5323..b1eecdd6 100644 --- a/nano/node/vote_processor.hpp +++ b/nano/node/vote_processor.hpp @@ -24,6 +24,7 @@ class rep_crawler; class ledger; class network_params; class node_flags; +class stat; class transaction; namespace transport diff --git a/nano/qt_system/entry.cpp b/nano/qt_system/entry.cpp index bcda125b..ae55f0f0 100644 --- a/nano/qt_system/entry.cpp +++ b/nano/qt_system/entry.cpp @@ -2,8 +2,8 @@ #include #include #include -#include #include +#include #include diff --git a/nano/qt_test/qt.cpp b/nano/qt_test/qt.cpp index a3ee579a..e9cf1f3c 100644 --- a/nano/qt_test/qt.cpp +++ b/nano/qt_test/qt.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index 4cf433e9..57f1943d 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -5,10 +5,10 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index 9214c79a..31b75178 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -1,9 +1,9 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/nano/test_common/CMakeLists.txt b/nano/test_common/CMakeLists.txt index eef91729..49276546 100644 --- a/nano/test_common/CMakeLists.txt +++ b/nano/test_common/CMakeLists.txt @@ -1,5 +1,12 @@ -add_library(test_common network.hpp network.cpp telemetry.hpp telemetry.cpp - testutil.hpp testutil.cpp) +add_library(test_common + network.hpp + network.cpp + system.hpp + system.cpp + telemetry.hpp + telemetry.cpp + testutil.hpp + testutil.cpp) target_link_libraries(test_common node gtest Boost::log_setup Boost::log Boost::boost) diff --git a/nano/test_common/network.cpp b/nano/test_common/network.cpp index 5427ad6e..316218a9 100644 --- a/nano/test_common/network.cpp +++ b/nano/test_common/network.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include diff --git a/nano/node/testing.cpp b/nano/test_common/system.cpp similarity index 99% rename from nano/node/testing.cpp rename to nano/test_common/system.cpp index d481bf80..98f4ba9d 100644 --- a/nano/node/testing.cpp +++ b/nano/test_common/system.cpp @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include diff --git a/nano/node/testing.hpp b/nano/test_common/system.hpp similarity index 100% rename from nano/node/testing.hpp rename to nano/test_common/system.hpp diff --git a/nano/test_common/testutil.cpp b/nano/test_common/testutil.cpp index 194a85ad..5d77700d 100644 --- a/nano/test_common/testutil.cpp +++ b/nano/test_common/testutil.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include