Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 17, 2024
1 parent dd6dacc commit 4f1ba88
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 45 deletions.
20 changes: 10 additions & 10 deletions common/autoware_component_interface_tools/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_test</buildtool_depend>

<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>diagnostic_updater</depend>
<depend>fmt</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tier4_system_msgs</depend>
<depend>yaml_cpp_vendor</depend>

<test_depend>ament_cmake_ros</test_depend>
<test_depend>rclcpp_components</test_depend>
<test_depend>rclcpp</test_depend>
<test_depend>ament_index_python</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_test_utils</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>autoware_test_utils</test_depend>
<test_depend>autoware_testing</test_depend>
<test_depend>diagnostic_updater</test_depend>
<test_depend>rclcpp</test_depend>
<test_depend>rclcpp_components</test_depend>
<test_depend>tier4_system_msgs</test_depend>
<test_depend>yaml_cpp_vendor</test_depend>
<test_depend>diagnostic_updater</test_depend>
<test_depend>autoware_testing</test_depend>
<test_depend>ament_index_python</test_depend>


<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <gtest/gtest.h>

#include "service_log_checker.hpp"
#include <rclcpp/node_options.hpp>
#include <yaml-cpp/yaml.h>

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <rclcpp/node_options.hpp>
#include <rclcpp_components/register_node_macro.hpp>

#include <gtest/gtest.h>
#include <yaml-cpp/yaml.h>

#include <memory>
#include <string>

Expand All @@ -27,38 +29,38 @@ using ServiceLogChecker = autoware::component_interface_tools::ServiceLogChecker

TEST(ServiceCheckerTest, ServiceChecker)
{
class PubManager : public rclcpp::Node
class PubManager : public rclcpp::Node
{
public:
PubManager() : Node("test_pub_node")
{
public:
PubManager() : Node("test_pub_node")
{
pub_odom_ = create_publisher<ServiceLog>("service_log", 1);
sub_odom_ = create_subscription<DiagnosticArray>(
"/diagnostics", 1, std::bind(&PubManager::on_service_log, this, std::placeholders::_1));
}
rclcpp::Publisher<ServiceLog>::SharedPtr pub_odom_;
rclcpp::Subscription<DiagnosticArray>::SharedPtr sub_odom_;
bool flag = false;
void on_service_log(const DiagnosticArray::ConstSharedPtr msg)
{
if (msg->status.size() > 0) {
auto diag_array = msg->status[0].message.c_str();
EXPECT_EQ(diag_array, "ERROR");
flag = true;
}
pub_odom_ = create_publisher<ServiceLog>("service_log", 1);
sub_odom_ = create_subscription<DiagnosticArray>(
"/diagnostics", 1, std::bind(&PubManager::on_service_log, this, std::placeholders::_1));
}
rclcpp::Publisher<ServiceLog>::SharedPtr pub_odom_;
rclcpp::Subscription<DiagnosticArray>::SharedPtr sub_odom_;
bool flag = false;
void on_service_log(const DiagnosticArray::ConstSharedPtr msg)
{
if (msg->status.size() > 0) {
auto diag_array = msg->status[0].message.c_str();
EXPECT_EQ(diag_array, "ERROR");
flag = true;
}
};

rclcpp::init(0, nullptr);
auto node_options = rclcpp::NodeOptions{};
auto test_target_node = std::make_shared<ServiceLogChecker>(node_options);
auto test_log = std::make_shared<PubManager>();
ServiceLog log;
log.type = 6;
log.name = "test";
log.node = "test_node";
test_log->pub_odom_->publish(log);

while (!test_log->flag) {
}
};

rclcpp::init(0, nullptr);
auto node_options = rclcpp::NodeOptions{};
auto test_target_node = std::make_shared<ServiceLogChecker>(node_options);
auto test_log = std::make_shared<PubManager>();
ServiceLog log;
log.type = 6;
log.name = "test";
log.node = "test_node";
test_log->pub_odom_->publish(log);

while (!test_log->flag) {
}
}

0 comments on commit 4f1ba88

Please sign in to comment.