diff options
-rw-r--r-- | tests/unit_tests/net.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/unit_tests/net.cpp b/tests/unit_tests/net.cpp index f24ffb45c..7e6ba4f03 100644 --- a/tests/unit_tests/net.cpp +++ b/tests/unit_tests/net.cpp @@ -1040,7 +1040,8 @@ TEST(dandelionpp_map, dropped_connection_remapped) boost::uuids::random_generator random_uuid{}; std::vector<boost::uuids::uuid> connections{3}; - std::generate(connections.begin(), connections.end(), random_uuid); + for (auto &e: connections) + e = random_uuid(); std::sort(connections.begin(), connections.end()); // select 3 of 3 outgoing connections @@ -1070,7 +1071,8 @@ TEST(dandelionpp_map, dropped_connection_remapped) } std::map<boost::uuids::uuid, boost::uuids::uuid> mapping; std::vector<boost::uuids::uuid> in_connections{9}; - std::generate(in_connections.begin(), in_connections.end(), random_uuid); + for (auto &e: in_connections) + e = random_uuid(); { std::map<boost::uuids::uuid, std::size_t> used; std::multimap<boost::uuids::uuid, boost::uuids::uuid> inverse_mapping; @@ -1149,7 +1151,8 @@ TEST(dandelionpp_map, dropped_connection_remapped) } // map 8 new incoming connections across 3 outgoing links in_connections.resize(18); - std::generate(in_connections.begin() + 10, in_connections.end(), random_uuid); + for (size_t i = 10; i < in_connections.size(); ++i) + in_connections[i] = random_uuid(); { std::map<boost::uuids::uuid, std::size_t> used; for (const boost::uuids::uuid& connection : in_connections) @@ -1176,7 +1179,8 @@ TEST(dandelionpp_map, dropped_all_connections) boost::uuids::random_generator random_uuid{}; std::vector<boost::uuids::uuid> connections{8}; - std::generate(connections.begin(), connections.end(), random_uuid); + for (auto &e: connections) + e = random_uuid(); std::sort(connections.begin(), connections.end()); // select 3 of 8 outgoing connections @@ -1205,7 +1209,8 @@ TEST(dandelionpp_map, dropped_all_connections) } } std::vector<boost::uuids::uuid> in_connections{9}; - std::generate(in_connections.begin(), in_connections.end(), random_uuid); + for (auto &e: in_connections) + e = random_uuid(); { std::map<boost::uuids::uuid, std::size_t> used; std::map<boost::uuids::uuid, boost::uuids::uuid> mapping; @@ -1237,7 +1242,8 @@ TEST(dandelionpp_map, dropped_all_connections) // select 3 of 30 connections, only 7 should be remapped to new indexes (but all to new uuids) connections.resize(30); - std::generate(connections.begin(), connections.end(), random_uuid); + for (auto &e: connections) + e = random_uuid(); EXPECT_TRUE(mapper.update(connections)); { std::map<boost::uuids::uuid, std::size_t> used; |