From bf3f514353f75759f95307827ebc8af91cfb96aa Mon Sep 17 00:00:00 2001 From: Bence Magyar Date: Sat, 13 Jan 2024 23:34:24 +0000 Subject: [PATCH] Update system name --- .../mock_components/test_generic_system.cpp | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hardware_interface/test/mock_components/test_generic_system.cpp b/hardware_interface/test/mock_components/test_generic_system.cpp index b54e2c758f..a9edd55d52 100644 --- a/hardware_interface/test/mock_components/test_generic_system.cpp +++ b/hardware_interface/test/mock_components/test_generic_system.cpp @@ -50,7 +50,7 @@ class TestGenericSystem : public ::testing::Test // REMOVE THIS MEMBER ONCE FAKE COMPONENTS ARE REMOVED hardware_fake_system_2dof_ = R"( - + fake_components/GenericSystem @@ -645,7 +645,7 @@ void set_components_state( auto configure_components = []( TestableResourceManager & rm, - const std::vector & components = {"GenericSystem2dof"}) + const std::vector & components = {"MockHardwareSystem"}) { set_components_state( rm, components, lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE, @@ -654,7 +654,7 @@ auto configure_components = []( auto activate_components = []( TestableResourceManager & rm, - const std::vector & components = {"GenericSystem2dof"}) + const std::vector & components = {"MockHardwareSystem"}) { set_components_state( rm, components, lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE, @@ -663,7 +663,7 @@ auto activate_components = []( auto deactivate_components = []( TestableResourceManager & rm, - const std::vector & components = {"GenericSystem2dof"}) + const std::vector & components = {"MockHardwareSystem"}) { set_components_state( rm, components, lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE, @@ -794,17 +794,17 @@ void generic_system_functional_test(const std::string & urdf, const double offse // check is hardware is configured auto status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::UNCONFIGURED); configure_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::INACTIVE); activate_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::ACTIVE); // Check initial values @@ -884,7 +884,7 @@ void generic_system_functional_test(const std::string & urdf, const double offse deactivate_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::INACTIVE); } @@ -1324,18 +1324,18 @@ TEST_F(TestGenericSystem, generic_system_2dof_functionality_with_offset_custom_i // check is hardware is configured auto status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::UNCONFIGURED); configure_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::INACTIVE); activate_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::ACTIVE); // Check initial values @@ -1425,7 +1425,7 @@ TEST_F(TestGenericSystem, generic_system_2dof_functionality_with_offset_custom_i deactivate_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::INACTIVE); } @@ -1438,17 +1438,17 @@ TEST_F(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio) // check is hardware is started auto status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::UNCONFIGURED); configure_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::INACTIVE); activate_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::ACTIVE); ASSERT_EQ(8u, rm.state_interface_keys().size()); @@ -1534,17 +1534,17 @@ void TestGenericSystem::test_generic_system_with_mock_gpio_commands(std::string // check is hardware is started auto status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::UNCONFIGURED); configure_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::INACTIVE); activate_components(rm); status_map = rm.get_components_status(); EXPECT_EQ( - status_map["GenericSystem2dof"].state.label(), + status_map["MockHardwareSystem"].state.label(), hardware_interface::lifecycle_state_names::ACTIVE); // Check interfaces