From d17d2c43644e3297b2c911def5c32cff7b1752b1 Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Mon, 7 Feb 2022 14:40:09 +0000 Subject: [PATCH] Fix network.construction_with_specified_port (uses test network port) (#3714) The test case network.construction_with_specified_port uses the test network port as the test port but that means this test fails if there is a test network node running on that machine. Convert the test to use nano::get_available_port() to avoid that problem. --- nano/core_test/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nano/core_test/network.cpp b/nano/core_test/network.cpp index 0ba34373..8d6dfd7b 100644 --- a/nano/core_test/network.cpp +++ b/nano/core_test/network.cpp @@ -56,7 +56,7 @@ TEST (network, tcp_connection) TEST (network, construction_with_specified_port) { nano::system system{}; - auto const port = nano::test_node_port (); + auto const port = nano::get_available_port (); auto const node = system.add_node (nano::node_config{ port, system.logging }); EXPECT_EQ (port, node->network.port); EXPECT_EQ (port, node->network.endpoint ().port ());