Skip to content

Commit b70046c

Browse files
style(pre-commit): autofix
1 parent 2e899d7 commit b70046c

File tree

2 files changed

+47
-49
lines changed

2 files changed

+47
-49
lines changed

common/autoware_component_interface_tools/package.xml

+11-13
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,29 @@
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+
21+
<test_depend>ament_cmake_gtest</test_depend>
2122
<test_depend>ament_cmake_ros</test_depend>
22-
<test_depend>rclcpp_components</test_depend>
23-
<test_depend>rclcpp</test_depend>
23+
<test_depend>ament_index_python</test_depend>
2424
<test_depend>ament_lint_auto</test_depend>
25-
<test_depend>autoware_test_utils</test_depend>
2625
<test_depend>autoware_lint_common</test_depend>
27-
<test_depend>tier4_system_msgs</test_depend>
28-
<test_depend>yaml_cpp_vendor</test_depend>
29-
<test_depend>diagnostic_updater</test_depend>
26+
<test_depend>autoware_test_utils</test_depend>
3027
<test_depend>autoware_testing</test_depend>
31-
<test_depend>ament_index_python</test_depend>
28+
<test_depend>diagnostic_updater</test_depend>
3229
<test_depend>fake_test_node</test_depend>
33-
<test_depend>ament_cmake_gtest</test_depend>
34-
35-
30+
<test_depend>rclcpp</test_depend>
31+
<test_depend>rclcpp_components</test_depend>
32+
<test_depend>tier4_system_msgs</test_depend>
33+
<test_depend>yaml_cpp_vendor</test_depend>
3634

3735
<export>
3836
<build_type>ament_cmake</build_type>

common/autoware_component_interface_tools/test/test_autoware_component_interface_tools.cpp

+36-36
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
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>
15-
1614
#include "service_log_checker.hpp"
17-
#include <rclcpp/node_options.hpp>
18-
#include <yaml-cpp/yaml.h>
15+
1916
#include <ament_index_cpp/get_package_share_directory.hpp>
17+
#include <rclcpp/node_options.hpp>
2018
#include <rclcpp_components/register_node_macro.hpp>
19+
20+
#include <gtest/gtest.h>
21+
#include <yaml-cpp/yaml.h>
22+
2123
#include <memory>
2224
#include <string>
2325
using ServiceLog = tier4_system_msgs::msg::ServiceLog;
@@ -27,40 +29,38 @@ using namespace rclcpp;
2729

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

64+
while (!test_log->flag) {
65+
}
6666
}

0 commit comments

Comments
 (0)