From e0ba62849acada085cfe6bf8436c9fad55d2d2d8 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Fri, 16 Aug 2019 10:24:20 +0200 Subject: [PATCH] Fix "do_more" check for test_ping/test_pong --- tracetools_test/src/test_ping.cpp | 9 ++++++++- tracetools_test/src/test_pong.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tracetools_test/src/test_ping.cpp b/tracetools_test/src/test_ping.cpp index 5a1cafa..86b203f 100644 --- a/tracetools_test/src/test_ping.cpp +++ b/tracetools_test/src/test_ping.cpp @@ -69,7 +69,14 @@ private: int main(int argc, char * argv[]) { - bool do_only_one = argc == 1; + bool do_only_one = true; + for (int i = 0; i < argc; ++i) + { + if (strncmp(argv[i], "do_more", 7) == 0) + { + do_only_one = false; + } + } rclcpp::init(argc, argv); diff --git a/tracetools_test/src/test_pong.cpp b/tracetools_test/src/test_pong.cpp index f1d52b8..a6a4663 100644 --- a/tracetools_test/src/test_pong.cpp +++ b/tracetools_test/src/test_pong.cpp @@ -58,7 +58,14 @@ private: int main(int argc, char * argv[]) { - bool do_only_one = argc == 1; + bool do_only_one = true; + for (int i = 0; i < argc; ++i) + { + if (strncmp(argv[i], "do_more", 7) == 0) + { + do_only_one = false; + } + } rclcpp::init(argc, argv);