1
+ // Copyright 2025 Open Source Robotics Foundation, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
1
15
#include < gtest/gtest.h>
2
16
3
17
#include < chrono>
@@ -36,14 +50,14 @@ template<
36
50
AllocatorT
37
51
>>
38
52
class CustomSubscription : public rclcpp ::Subscription<
39
- MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>
53
+ MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>
40
54
{
41
55
public:
42
-
43
- template < typename ... Args>
44
- CustomSubscription (Args &&...args) : rclcpp::Subscription<
45
- MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>(
46
- std::forward<Args>(args)...) {}
56
+ template < typename ... Args>
57
+ explicit CustomSubscription (Args && ... args)
58
+ : rclcpp::Subscription<
59
+ MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>(
60
+ std::forward<Args>(args)...) {}
47
61
};
48
62
49
63
TEST_F (TestCreateSubscription, create) {
@@ -69,4 +83,4 @@ TEST_F(TestCreateSubscription, create) {
69
83
ASSERT_NE (nullptr , subscription);
70
84
EXPECT_STREQ (" /ns/topic_name" , subscription->get_topic_name ());
71
85
static_assert (std::is_same_v<std::decay_t <decltype (*subscription.get ())>, SubscriptionT>);
72
- }
86
+ }
0 commit comments