Skip to content

Commit 4b4f4a6

Browse files
pre-commit-ci[bot]xmfcx
authored andcommitted
style(pre-commit): autofix
1 parent 662e11a commit 4b4f4a6

File tree

2 files changed

+42
-39
lines changed

2 files changed

+42
-39
lines changed

common/autoware_component_interface_tools/package.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88
<license>Apache License 2.0</license>
99

1010
<buildtool_depend>ament_cmake_auto</buildtool_depend>
11-
<buildtool_depend>autoware_cmake</buildtool_depend>
1211
<buildtool_depend>ament_cmake_test</buildtool_depend>
13-
12+
<buildtool_depend>autoware_cmake</buildtool_depend>
13+
1414
<depend>diagnostic_updater</depend>
1515
<depend>fmt</depend>
1616
<depend>rclcpp</depend>
1717
<depend>rclcpp_components</depend>
1818
<depend>tier4_system_msgs</depend>
1919
<depend>yaml_cpp_vendor</depend>
20-
20+
2121
<test_depend>ament_cmake_ros</test_depend>
22-
<test_depend>rclcpp</test_depend>
22+
<test_depend>ament_index_python</test_depend>
2323
<test_depend>ament_lint_auto</test_depend>
2424
<test_depend>autoware_lint_common</test_depend>
25+
<test_depend>diagnostic_updater</test_depend>
26+
<test_depend>rclcpp</test_depend>
2527
<test_depend>tier4_system_msgs</test_depend>
2628
<test_depend>yaml_cpp_vendor</test_depend>
27-
<test_depend>diagnostic_updater</test_depend>
28-
<test_depend>ament_index_python</test_depend>
29-
29+
3030
<export>
3131
<build_type>ament_cmake</build_type>
3232
</export>

common/autoware_component_interface_tools/test/test_autoware_component_interface_tools.cpp

+35-32
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
#include <gtest/gtest.h>
1514
#include "service_log_checker.hpp"
15+
1616
#include <rclcpp/node_options.hpp>
17+
18+
#include <gtest/gtest.h>
19+
1720
#include <memory>
1821
#include <string>
1922

@@ -23,38 +26,38 @@ using ServiceLogChecker = autoware::component_interface_tools::ServiceLogChecker
2326

2427
TEST(ServiceCheckerTest, ServiceChecker)
2528
{
26-
class PubManager : public rclcpp::Node
29+
class PubManager : public rclcpp::Node
30+
{
31+
public:
32+
PubManager() : Node("test_pub_node")
2733
{
28-
public:
29-
PubManager() : Node("test_pub_node")
30-
{
31-
pub_odom_ = create_publisher<ServiceLog>("service_log", 1);
32-
sub_odom_ = create_subscription<DiagnosticArray>(
33-
"/diagnostics", 1, std::bind(&PubManager::on_service_log, this, std::placeholders::_1));
34-
}
35-
rclcpp::Publisher<ServiceLog>::SharedPtr pub_odom_;
36-
rclcpp::Subscription<DiagnosticArray>::SharedPtr sub_odom_;
37-
bool flag = false;
38-
void on_service_log(const DiagnosticArray::ConstSharedPtr msg)
39-
{
40-
if (msg->status.size() > 0) {
41-
auto diag_array = msg->status[0].message.c_str();
42-
EXPECT_EQ(diag_array, "ERROR");
43-
flag = true;
44-
}
34+
pub_odom_ = create_publisher<ServiceLog>("service_log", 1);
35+
sub_odom_ = create_subscription<DiagnosticArray>(
36+
"/diagnostics", 1, std::bind(&PubManager::on_service_log, this, std::placeholders::_1));
37+
}
38+
rclcpp::Publisher<ServiceLog>::SharedPtr pub_odom_;
39+
rclcpp::Subscription<DiagnosticArray>::SharedPtr sub_odom_;
40+
bool flag = false;
41+
void on_service_log(const DiagnosticArray::ConstSharedPtr msg)
42+
{
43+
if (msg->status.size() > 0) {
44+
auto diag_array = msg->status[0].message.c_str();
45+
EXPECT_EQ(diag_array, "ERROR");
46+
flag = true;
4547
}
46-
};
47-
48-
rclcpp::init(0, nullptr);
49-
auto node_options = rclcpp::NodeOptions{};
50-
auto test_target_node = std::make_shared<ServiceLogChecker>(node_options);
51-
auto test_log = std::make_shared<PubManager>();
52-
ServiceLog log;
53-
log.type = 6;
54-
log.name = "test";
55-
log.node = "test_node";
56-
test_log->pub_odom_->publish(log);
57-
58-
while (!test_log->flag) {
5948
}
49+
};
50+
51+
rclcpp::init(0, nullptr);
52+
auto node_options = rclcpp::NodeOptions{};
53+
auto test_target_node = std::make_shared<ServiceLogChecker>(node_options);
54+
auto test_log = std::make_shared<PubManager>();
55+
ServiceLog log;
56+
log.type = 6;
57+
log.name = "test";
58+
log.node = "test_node";
59+
test_log->pub_odom_->publish(log);
60+
61+
while (!test_log->flag) {
62+
}
6063
}

0 commit comments

Comments
 (0)