|
15 | 15 | #include "test_chainable_controller_interface.hpp" |
16 | 16 |
|
17 | 17 | #include <gmock/gmock.h> |
| 18 | +#include <memory> |
18 | 19 |
|
19 | 20 | using ::testing::IsEmpty; |
20 | 21 | using ::testing::SizeIs; |
@@ -51,7 +52,7 @@ TEST_F(ChainableControllerInterfaceTest, export_state_interfaces) |
51 | 52 | EXPECT_EQ(exported_state_interfaces[0]->get_prefix_name(), TEST_CONTROLLER_NAME); |
52 | 53 | EXPECT_EQ(exported_state_interfaces[0]->get_interface_name(), "test_state"); |
53 | 54 |
|
54 | | - EXPECT_EQ(exported_state_interfaces[0]->get_value(), INTERFACE_VALUE); |
| 55 | + EXPECT_EQ(exported_state_interfaces[0]->get_value(), EXPORTED_STATE_INTERFACE_VALUE); |
55 | 56 | } |
56 | 57 |
|
57 | 58 | TEST_F(ChainableControllerInterfaceTest, export_reference_interfaces) |
@@ -88,10 +89,15 @@ TEST_F(ChainableControllerInterfaceTest, interfaces_prefix_is_not_node_name) |
88 | 89 | controller.set_name_prefix_of_reference_interfaces("some_not_correct_interface_prefix"); |
89 | 90 |
|
90 | 91 | // expect empty return because interface prefix is not equal to the node name |
91 | | - auto reference_interfaces = controller.export_reference_interfaces(); |
92 | | - ASSERT_THAT(reference_interfaces, IsEmpty()); |
| 92 | + std::vector<std::shared_ptr<hardware_interface::CommandInterface>> exported_reference_interfaces; |
| 93 | + EXPECT_THROW( |
| 94 | + { exported_reference_interfaces = controller.export_reference_interfaces(); }, |
| 95 | + std::runtime_error); |
| 96 | + ASSERT_THAT(exported_reference_interfaces, IsEmpty()); |
93 | 97 | // expect empty return because interface prefix is not equal to the node name |
94 | | - auto exported_state_interfaces = controller.export_state_interfaces(); |
| 98 | + std::vector<std::shared_ptr<hardware_interface::StateInterface>> exported_state_interfaces; |
| 99 | + EXPECT_THROW( |
| 100 | + { exported_state_interfaces = controller.export_state_interfaces(); }, std::runtime_error); |
95 | 101 | ASSERT_THAT(exported_state_interfaces, IsEmpty()); |
96 | 102 | } |
97 | 103 |
|
|
0 commit comments