Skip to content
Permalink
Browse files

Merge pull request #5876

a5c7eeb unit_tests: fix build with CLANG 8 and boost 1.69 (moneromooo-monero)
  • Loading branch information...
luigi1111 committed Sep 9, 2019
2 parents e7b5b23 + a5c7eeb commit d0d76f771ac318046306cd2ef40e67d598d7429d
Showing with 12 additions and 6 deletions.
  1. +12 −6 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;

0 comments on commit d0d76f7

Please sign in to comment.
You can’t perform that action at this time.