Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Garrido <[email protected]>
  • Loading branch information
pablogs9 committed Dec 9, 2022
1 parent dca41aa commit beeffe1
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ if(UXRCE_BUILD_TESTS)
GIT_REPOSITORY
https://github.com/google/googletest.git
GIT_TAG
2fe3bd994b3189899d93f1d5a881e725e046fdc2
release-1.11.0
PREFIX
${PROJECT_BINARY_DIR}/googletest
INSTALL_DIR
Expand Down
8 changes: 7 additions & 1 deletion test/test/client_agent/ClientAgentCan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ TEST_P(ClientAgentCan, PingFromClientToAgent)
ASSERT_NO_FATAL_FAILURE(client_can_.ping_agent());
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
CanTransports,
ClientAgentCan,
::testing::Values(MiddlewareKind::FASTDDS));
10 changes: 8 additions & 2 deletions test/test/client_agent/ClientAgentInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,20 @@ TEST_P(ClientAgentInteraction, PingFromClientToAgent)
ASSERT_NO_FATAL_FAILURE(client_.ping_agent(transport_kind));
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
Transports,
ClientAgentInteraction,
::testing::Combine(
::testing::Values(Transport::UDP_IPV4_TRANSPORT, Transport::TCP_IPV4_TRANSPORT, Transport::UDP_IPV6_TRANSPORT, Transport::TCP_IPV6_TRANSPORT),
::testing::Values(MiddlewareKind::FASTDDS, MiddlewareKind::FASTRTPS, MiddlewareKind::CED)));

INSTANTIATE_TEST_CASE_P(
GTEST_INSTANTIATE_TEST_MACRO(
CustomTransports,
ClientAgentInteraction,
::testing::Combine(
Expand Down
8 changes: 7 additions & 1 deletion test/test/client_agent/ClientAgentSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ TEST_P(ClientAgentSerial, PingFromClientToAgent)
}
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
SerialTransports,
ClientAgentSerial,
::testing::Combine(
Expand Down
8 changes: 7 additions & 1 deletion test/test/discovery/DiscoveryIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ TEST_P(DiscoveryIntegration, DiscoveryMulticast)
discovery_->multicast();
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
Transports,
DiscoveryIntegration,
::testing::Combine(
Expand Down
8 changes: 7 additions & 1 deletion test/test/publisher_subscriber/PublisherSubscriberCan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ TEST_P(PublisherSubscriberCan, PubSub1ContinousFragmentedTopic)
publisher_.publish(1, 0x80, 1, message);
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
PubSubCan,
PublisherSubscriberCan,
::testing::Combine(
Expand Down
16 changes: 11 additions & 5 deletions test/test/publisher_subscriber/PublisherSubscriberInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ TEST_P(PublisherSubscriberUnitary, PubSub1WithPing)
ASSERT_EQ(subscriber_.get_received_topics(), message_number);
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
PublisherSubscriberWithPing,
PublisherSubscriberUnitary,
::testing::Combine(
Expand All @@ -211,7 +217,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values(0.0f),
::testing::Values(XRCECreationMode::XRCE_BIN_CREATION)));

INSTANTIATE_TEST_CASE_P(
GTEST_INSTANTIATE_TEST_MACRO(
TransportAndLost,
PublisherSubscriberNoLost,
::testing::Combine(
Expand All @@ -220,7 +226,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values(0.0f),
::testing::Values(XRCECreationMode::XRCE_XML_CREATION)));

INSTANTIATE_TEST_CASE_P(
GTEST_INSTANTIATE_TEST_MACRO(
TransportAndLostCreationModes,
PublisherSubscriberNoLost,
::testing::Combine(
Expand All @@ -229,7 +235,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values(0.0f),
::testing::Values(XRCECreationMode::XRCE_XML_CREATION, XRCECreationMode::XRCE_BIN_CREATION)));

INSTANTIATE_TEST_CASE_P(
GTEST_INSTANTIATE_TEST_MACRO(
TransportAndLostCustomTransports,
PublisherSubscriberNoLost,
::testing::Combine(
Expand Down Expand Up @@ -262,7 +268,7 @@ TEST_P(PublisherSubscriberLost, PubSub3FragmentedTopic4Parts)
check_messages(message, 3, 0x80);
}

INSTANTIATE_TEST_CASE_P(
GTEST_INSTANTIATE_TEST_MACRO(
TransportAndLost,
PublisherSubscriberLost,
::testing::Combine(
Expand Down
8 changes: 7 additions & 1 deletion test/test/publisher_subscriber/PublisherSubscriberSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ TEST_P(PublisherSubscriberSerial, MultiPubSub)
check_messages(SMALL_MESSAGE, 10, 0x01);
}

INSTANTIATE_TEST_CASE_P(
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_SUITE_P(x, y, z)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z) INSTANTIATE_TEST_CASE_P(x, y, z)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(
MultiSerialPubSubBin,
PublisherSubscriberSerial,
::testing::Combine(
Expand Down
8 changes: 7 additions & 1 deletion test/test/shapes_demo/ShapesDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ class ShapesDemoTest : public ::testing::TestWithParam<Transport>

/* ############################################## TESTS ##################################################### */

INSTANTIATE_TEST_CASE_P(Transport, ShapesDemoTest, ::testing::Values(UDP_TRANSPORT, TCP_TRANSPORT), ::testing::PrintToStringParamName());
#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z, w) INSTANTIATE_TEST_SUITE_P(x, y, z, w)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z, w) INSTANTIATE_TEST_CASE_P(x, y, z, w)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(Transport, ShapesDemoTest, ::testing::Values(UDP_TRANSPORT, TCP_TRANSPORT), ::testing::PrintToStringParamName());

TEST_P(ShapesDemoTest, CreateSession)
{
Expand Down

0 comments on commit beeffe1

Please sign in to comment.