Skip to content

Commit

Permalink
Refs 11906. uncrustify
Browse files Browse the repository at this point in the history
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
  • Loading branch information
IkerLuengo committed Jul 12, 2021
1 parent 9a198f6 commit 9dd7bb9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 42 deletions.
4 changes: 2 additions & 2 deletions docs/code/StatisticsBackendTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void init_monitor_examples()
// The monitor uses a custom listener.
EntityId disc_server_prefix_monitor_id =
StatisticsBackend::init_monitor("44.53.01.5f.45.50.52.4f.53.49.4d.41", "127.0.0.1:11811",
&domain_listener);
&domain_listener);
//!--
static_cast<void>(domain_monitor_id);
static_cast<void>(disc_server_monitor_id);
Expand Down Expand Up @@ -114,7 +114,7 @@ void init_monitor_examples()
// The monitor uses a custom listener, a CallbackMask, and a DataKindMask.
EntityId disc_server_prefix_monitor_id =
StatisticsBackend::init_monitor("44.53.01.5f.45.50.52.4f.53.49.4d.41", "127.0.0.1:11811",
&domain_listener, callback_mask, datakind_mask);
&domain_listener, callback_mask, datakind_mask);
//!--
static_cast<void>(domain_monitor_id);
static_cast<void>(disc_server_monitor_id);
Expand Down
4 changes: 2 additions & 2 deletions include/fastdds_statistics_backend/StatisticsBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class FASTDDS_STATISTICS_BACKEND_DllAPI StatisticsBackend
* the network of the server with the given locators.
* The server \c GuidPrefix_t is set to the default one: \c eprosima::fastdds::rtps::DEFAULT_ROS2_SERVER_GUIDPREFIX.
* If any other server is to be used, call the overload method that receives the \c GuidPrefix_t as parameter.
*
*
* The format to specify a locator is: <tt>kind:[IPaddress]:port</tt>, where:
* * \b kind is one of { \c UDPv4, \c TCPv4, \c UDPv6, \c TCPv4 }
* * \b IPaddress is the IP address
Expand All @@ -111,7 +111,7 @@ class FASTDDS_STATISTICS_BACKEND_DllAPI StatisticsBackend
*
* This function creates a new statistics DomainParticipant that starts monitoring
* the network of the server with the given \c GuidPrefix_t and with the given locators.
*
*
* The format to specify a locator is: <tt>kind:[IPaddress]:port</tt>, where:
* * \b kind is one of { \c UDPv4, \c TCPv4, \c UDPv6, \c TCPv4 }
* * \b IPaddress is the IP address
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/StatisticsBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ EntityId StatisticsBackend::init_monitor(
participant_qos.name("monitor_domain_" + domain_id);

return create_and_register_monitor(domain_name.str(), domain_listener, callback_mask, data_mask, participant_qos,
domain_id);
domain_id);
}

void StatisticsBackend::stop_monitor(
Expand Down Expand Up @@ -357,7 +357,7 @@ EntityId StatisticsBackend::init_monitor(
DataKindMask data_mask)
{
return init_monitor(DEFAULT_ROS2_SERVER_GUIDPREFIX, discovery_server_locators, domain_listener, callback_mask,
data_mask);
data_mask);
}

EntityId StatisticsBackend::init_monitor(
Expand All @@ -371,7 +371,7 @@ EntityId StatisticsBackend::init_monitor(
DomainParticipantQos participant_qos = DomainParticipantFactory::get_instance()->get_default_participant_qos();
participant_qos.name("monitor_discovery_server_" + discovery_server_guid_prefix);
participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol =
eprosima::fastrtps::rtps::DiscoveryProtocol_t::SUPER_CLIENT;
eprosima::fastrtps::rtps::DiscoveryProtocol_t::SUPER_CLIENT;
RemoteServerAttributes server;
// Set the server guidPrefix
server.ReadguidPrefix(discovery_server_guid_prefix.c_str());
Expand Down Expand Up @@ -405,7 +405,7 @@ EntityId StatisticsBackend::init_monitor(
participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server);

return create_and_register_monitor(discovery_server_guid_prefix, domain_listener, callback_mask, data_mask,
participant_qos);
participant_qos);
}

void StatisticsBackend::restart_monitor(
Expand Down
44 changes: 22 additions & 22 deletions test/unittest/StatisticsBackend/InitMonitorFactoryFailsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,21 @@ class init_monitor_factory_fails_tests : public ::testing::Test
std::string server_locators = "UDPv4:[127.0.0.1]:11811";

EXPECT_THROW(StatisticsBackend::init_monitor(
domain_id,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), Error);
domain_id,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), Error);
EXPECT_THROW(StatisticsBackend::init_monitor(
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), Error);
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), Error);
EXPECT_THROW(StatisticsBackend::init_monitor(
server_guid_prefix,
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), Error);
server_guid_prefix,
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), Error);
}

void check_init_monitor_discovery_server_failure(
Expand All @@ -237,16 +237,16 @@ class init_monitor_factory_fails_tests : public ::testing::Test
std::string server_guid_prefix = "44.53.01.5f.45.50.52.4f.53.49.4d.41";

EXPECT_THROW(StatisticsBackend::init_monitor(
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), BadParameter);
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), BadParameter);
EXPECT_THROW(StatisticsBackend::init_monitor(
server_guid_prefix,
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), BadParameter);
server_guid_prefix,
server_locators,
&domain_listener,
all_callback_mask_,
all_datakind_mask_), BadParameter);
}

~init_monitor_factory_fails_tests()
Expand Down
26 changes: 14 additions & 12 deletions test/unittest/StatisticsBackend/InitMonitorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,14 @@ class init_monitor_tests : public ::testing::Test
if (is_unicast)
{
EXPECT_NE(std::find(server_qos.metatrafficUnicastLocatorList.begin(),
server_qos.metatrafficUnicastLocatorList.end(), locator), server_qos.metatrafficUnicastLocatorList.end());
server_qos.metatrafficUnicastLocatorList.end(), locator),
server_qos.metatrafficUnicastLocatorList.end());
}
else
{
EXPECT_NE(std::find(server_qos.metatrafficMulticastLocatorList.begin(),
server_qos.metatrafficMulticastLocatorList.end(), locator), server_qos.metatrafficMulticastLocatorList.end());
server_qos.metatrafficMulticastLocatorList.end(), locator),
server_qos.metatrafficMulticastLocatorList.end());
}
}

Expand All @@ -220,10 +222,10 @@ class init_monitor_tests : public ::testing::Test
const std::string& server_guid_prefix)
{
EXPECT_EQ(participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol,
eprosima::fastrtps::rtps::DiscoveryProtocol_t::SUPER_CLIENT);
eprosima::fastrtps::rtps::DiscoveryProtocol_t::SUPER_CLIENT);

RemoteServerAttributes server_qos =
participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.front();
participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.front();
GuidPrefix_t guid_prefix;
std::istringstream(server_guid_prefix) >> guid_prefix;
EXPECT_EQ(server_qos.guidPrefix, guid_prefix);
Expand Down Expand Up @@ -267,7 +269,7 @@ TEST_F(init_monitor_tests, init_monitor_domain_id_all_callback_all_data)
std::string server_locators = "UDPv4:[127.0.0.1]:11811";

auto domain_monitors = init_monitors(domain_id, &domain_listener, server_guid_prefix, server_locators,
all_callback_mask_, all_datakind_mask_);
all_callback_mask_, all_datakind_mask_);

std::vector<EntityId> monitor_ids;
for (const auto& monitor : domain_monitors)
Expand Down Expand Up @@ -310,7 +312,7 @@ TEST_F(init_monitor_tests, init_monitor_domain_id_no_callback_all_data)
std::string server_locators = "UDPv4:[127.0.0.1]:11811";

auto domain_monitors = init_monitors(domain_id, &domain_listener, server_guid_prefix, server_locators,
CallbackMask::none(), all_datakind_mask_);
CallbackMask::none(), all_datakind_mask_);

std::vector<EntityId> monitor_ids;
for (const auto& monitor : domain_monitors)
Expand Down Expand Up @@ -353,7 +355,7 @@ TEST_F(init_monitor_tests, init_monitor_domain_id_all_callback_no_data)
std::string server_locators = "UDPv4:[127.0.0.1]:11811";

auto domain_monitors = init_monitors(domain_id, &domain_listener, server_guid_prefix, server_locators,
all_callback_mask_, DataKindMask::none());
all_callback_mask_, DataKindMask::none());

std::vector<EntityId> monitor_ids;
for (const auto& monitor : domain_monitors)
Expand Down Expand Up @@ -395,7 +397,7 @@ TEST_F(init_monitor_tests, init_monitor_domain_id_null_listener_all_data)
std::string server_locators = "UDPv4:[127.0.0.1]:11811";

auto domain_monitors = init_monitors(domain_id, nullptr, server_guid_prefix, server_locators,
all_callback_mask_, all_datakind_mask_);
all_callback_mask_, all_datakind_mask_);

std::vector<EntityId> monitor_ids;
for (const auto& monitor : domain_monitors)
Expand Down Expand Up @@ -491,7 +493,7 @@ TEST_F(init_monitor_tests, init_monitor_twice)
std::string server_locators = "UDPv4:[127.0.0.1]:11811";

init_monitors(domain_id, &domain_listener, server_guid_prefix, server_locators,
all_callback_mask_, all_datakind_mask_);
all_callback_mask_, all_datakind_mask_);

EXPECT_THROW(StatisticsBackend::init_monitor(
domain_id,
Expand All @@ -512,7 +514,7 @@ TEST_F(init_monitor_tests, init_monitor_twice)

auto domain_monitors = details::StatisticsBackendData::get_instance()->monitors_by_entity_;

/* Check that three monitors are created */
/* Check that three monitors are created */
EXPECT_EQ(domain_monitors.size(), 3);

std::vector<EntityId> monitor_ids;
Expand Down Expand Up @@ -568,10 +570,10 @@ TEST_F(init_monitor_tests, init_server_monitor_several_locators)
domain_monitors[monitor_id]->participant->get_qos(participant_qos);

EXPECT_EQ(participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol,
eprosima::fastrtps::rtps::DiscoveryProtocol_t::SUPER_CLIENT);
eprosima::fastrtps::rtps::DiscoveryProtocol_t::SUPER_CLIENT);

const RemoteServerAttributes& server_qos =
participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.front();
participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.front();

check_locator(server_qos, LOCATOR_KIND_UDPv4, "127.0.0.1", 11811);
check_locator(server_qos, LOCATOR_KIND_TCPv4, "127.0.0.1", 11812);
Expand Down

0 comments on commit 9dd7bb9

Please sign in to comment.