@@ -111,11 +111,7 @@ DdsRouterConfiguration dds_test_simple_configuration(
111111 * The transient_local option changes the test behavior to verify that the communication is transient_local and all old data is sent
112112 * to Late Joiners.
113113 */
114- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
115- template <class MsgStruct >
116- #else
117114template <class MsgStruct , class MsgStructType >
118- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
119115void test_local_communication (
120116 DdsRouterConfiguration ddsrouter_configuration,
121117 uint32_t samples_to_receive = DEFAULT_SAMPLES_TO_RECEIVE ,
@@ -135,9 +131,7 @@ void test_local_communication(
135131 // Create a message with size specified by repeating the same string
136132 MsgStruct msg;
137133
138- #if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 13
139134 MsgStructType type;
140- #endif // if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 13
141135
142136 std::string msg_str;
143137
@@ -149,20 +143,12 @@ void test_local_communication(
149143 msg.message (msg_str);
150144
151145 // Create DDS Publisher in domain 0
152- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
153- TestPublisher<MsgStruct> publisher (msg.isKeyDefined ());
154- #else
155146 TestPublisher<MsgStruct> publisher (type.m_isGetKeyDefined );
156- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
157147
158148 ASSERT_TRUE (publisher.init (0 ));
159149
160150 // Create DDS Subscriber in domain 1
161- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
162- TestSubscriber<MsgStruct> subscriber (msg.isKeyDefined (), transient_local);
163- #else
164151 TestSubscriber<MsgStruct> subscriber (type.m_isGetKeyDefined , transient_local);
165- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
166152
167153 ASSERT_TRUE (subscriber.init (1 , &msg, &samples_received));
168154
@@ -226,14 +212,8 @@ void test_local_communication(
226212 */
227213TEST (DDSTestLocal, end_to_end_local_communication)
228214{
229- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
230- test::test_local_communication<HelloWorld>(
231- test::dds_test_simple_configuration ());
232- #else
233215 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
234216 test::dds_test_simple_configuration ());
235- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
236-
237217}
238218
239219/* *
@@ -242,13 +222,8 @@ TEST(DDSTestLocal, end_to_end_local_communication)
242222 */
243223TEST (DDSTestLocal, end_to_end_local_communication_keyed)
244224{
245- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
246- test::test_local_communication<HelloWorldKeyed>(
247- test::dds_test_simple_configuration ());
248- #else
249225 test::test_local_communication<HelloWorldKeyed, HelloWorldKeyedPubSubType>(
250226 test::dds_test_simple_configuration ());
251- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
252227}
253228
254229/* *
@@ -258,24 +233,14 @@ TEST(DDSTestLocal, end_to_end_local_communication_keyed)
258233 */
259234TEST (DDSTestLocal, end_to_end_local_communication_disable_dynamic_discovery)
260235{
261- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
262- test::test_local_communication<HelloWorld>(
263- test::dds_test_simple_configuration (true ));
264- #else
265236 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
266237 test::dds_test_simple_configuration (true ));
267- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
268238}
269239
270240TEST (DDSTestLocal, end_to_end_local_communication_disable_dynamic_discovery_keyed)
271241{
272- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
273- test::test_local_communication<HelloWorldKeyed>(
274- test::dds_test_simple_configuration (true ));
275- #else
276242 test::test_local_communication<HelloWorldKeyed, HelloWorldKeyedPubSubType>(
277243 test::dds_test_simple_configuration (true ));
278- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
279244}
280245
281246/* *
@@ -287,17 +252,10 @@ TEST(DDSTestLocal, end_to_end_local_communication_disable_dynamic_discovery_keye
287252 */
288253TEST (DDSTestLocal, end_to_end_local_communication_high_frequency)
289254{
290- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
291- test::test_local_communication<HelloWorld>(
292- test::dds_test_simple_configuration (),
293- 1000 , // wait for 1000 samples received
294- 0 ); // send it without waiting from one sample to the other
295- #else
296255 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
297256 test::dds_test_simple_configuration (),
298257 1000 , // wait for 1000 samples received
299258 0 ); // send it without waiting from one sample to the other
300- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
301259}
302260
303261/* *
@@ -309,19 +267,11 @@ TEST(DDSTestLocal, end_to_end_local_communication_high_frequency)
309267 */
310268TEST (DDSTestLocal, end_to_end_local_communication_high_size)
311269{
312- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
313- test::test_local_communication<HelloWorld>(
314- test::dds_test_simple_configuration (),
315- test::DEFAULT_SAMPLES_TO_RECEIVE ,
316- test::DEFAULT_MILLISECONDS_PUBLISH_LOOP ,
317- 10000 ); // 500K message size
318- #else
319270 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
320271 test::dds_test_simple_configuration (),
321272 test::DEFAULT_SAMPLES_TO_RECEIVE ,
322273 test::DEFAULT_MILLISECONDS_PUBLISH_LOOP ,
323274 10000 ); // 500K message size
324- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
325275}
326276
327277/* *
@@ -335,19 +285,11 @@ TEST(DDSTestLocal, end_to_end_local_communication_high_size)
335285 */
336286TEST (DDSTestLocal, end_to_end_local_communication_high_throughput)
337287{
338- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
339- test::test_local_communication<HelloWorld>(
340- test::dds_test_simple_configuration (),
341- 500 ,
342- 1 ,
343- 1000 ); // 50K message size
344- #else
345288 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
346289 test::dds_test_simple_configuration (),
347290 500 ,
348291 1 ,
349292 1000 ); // 50K message size
350- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
351293}
352294
353295/* *
@@ -356,21 +298,12 @@ TEST(DDSTestLocal, end_to_end_local_communication_high_throughput)
356298 */
357299TEST (DDSTestLocal, end_to_end_local_communication_transient_local)
358300{
359- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
360- test::test_local_communication<HelloWorld>(
361- test::dds_test_simple_configuration (),
362- test::DEFAULT_SAMPLES_TO_RECEIVE ,
363- test::DEFAULT_MILLISECONDS_PUBLISH_LOOP ,
364- test::DEFAULT_MESSAGE_SIZE ,
365- true );
366- #else
367301 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
368302 test::dds_test_simple_configuration (),
369303 test::DEFAULT_SAMPLES_TO_RECEIVE ,
370304 test::DEFAULT_MILLISECONDS_PUBLISH_LOOP ,
371305 test::DEFAULT_MESSAGE_SIZE ,
372306 true );
373- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
374307}
375308
376309/* *
@@ -379,21 +312,12 @@ TEST(DDSTestLocal, end_to_end_local_communication_transient_local)
379312 */
380313TEST (DDSTestLocal, end_to_end_local_communication_transient_local_disable_dynamic_discovery)
381314{
382- #if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
383- test::test_local_communication<HelloWorld>(
384- test::dds_test_simple_configuration (true , true ),
385- test::DEFAULT_SAMPLES_TO_RECEIVE ,
386- test::DEFAULT_MILLISECONDS_PUBLISH_LOOP ,
387- test::DEFAULT_MESSAGE_SIZE ,
388- true );
389- #else
390315 test::test_local_communication<HelloWorld, HelloWorldPubSubType>(
391316 test::dds_test_simple_configuration (true , true ),
392317 test::DEFAULT_SAMPLES_TO_RECEIVE ,
393318 test::DEFAULT_MILLISECONDS_PUBLISH_LOOP ,
394319 test::DEFAULT_MESSAGE_SIZE ,
395320 true );
396- #endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
397321}
398322
399323int main (
0 commit comments