test_behavior_without_context_input_port_not_set.hpp File
Included Headers
Namespaces Index
| namespace | moveit_pro |
| namespace | test_utils |
Macro Definitions Index
| #define | INSTANTIATE_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS_(behavior_class, input_port_setter_generator, output_port_setter_generator, pre_tick_code) ... |
| #define | INSTANTIATE_SYNC_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS(behavior_class, input_port_setter_generator, output_port_setter_generator) ... |
|
Automatically instantiates tests for the "input Behavior port not set" situation for synchronous Behaviors without context. More... | |
| #define | INSTANTIATE_ASYNC_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS(behavior_class, input_port_setter_generator, output_port_setter_generator) ... |
|
Automatically instantiates tests for the "input Behavior port not set" situation for asynchronous Behaviors without context. More... | |
Macro Definitions
INSTANTIATE_ASYNC_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS
|
Automatically instantiates tests for the "input Behavior port not set" situation for asynchronous Behaviors without context.
- Value
-
INSTANTIATE_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS_( \ behavior_class, input_port_setter_generator, output_port_setter_generator, \ ASSERT_EQ(behavior().executeTick(), BT::NodeStatus::RUNNING) \ << "Should you use INSTANTIATE_SYNC_BEHAVIOR_PORT_NOT_SET_TESTS instead?"; \ std::this_thread::sleep_for(::moveit_pro::test_utils::kPortNotSetTestsMaxTimeBehaviorIsInRunningStatus);)
One test is generated for each Behavior input port.
- Parameters
-
behavior_class Class of the behavior under test. It cannot have namespace qualifiers. If those are needed, please use a using statement in the test file.
input_port_setter_generator A port setter map generator defining the expected input ports.
output_port_setter_generator A port setter map generator defining the expected output ports.
Definition at line 79 of file test_behavior_without_context_input_port_not_set.hpp.
INSTANTIATE_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS_
|
- Value
-
class behavior_class##BehaviorInputPortNotSetTest \ : public ::moveit_pro::test_utils::RosTest, \ public ::moveit_pro::test_utils::WithBehaviorWithoutContext<behavior_class>, \ public ::testing::WithParamInterface<std::string> \ { \ public: \ behavior_class##BehaviorInputPortNotSetTest() \ { \ initBehavior(#behavior_class, input_port_setter_generator, output_port_setter_generator); \ } \ }; \ \ TEST_P(behavior_class##BehaviorInputPortNotSetTest, FailsIfPortNotSet) \ { \ const std::string missing_port_name = GetParam(); \ for (const auto& [port_name, port_setter] : input_port_setter_generator()) \ { \ if (port_name == missing_port_name || !port_setter) \ { \ continue; \ } \ port_setter(blackboard(), port_name); \ } \ pre_tick_code; \ EXPECT_EQ(behavior().executeTick(), BT::NodeStatus::FAILURE); \ } \ \ INSTANTIATE_TEST_SUITE_P(UnsetPortTests, behavior_class##BehaviorInputPortNotSetTest, \ ::testing::ValuesIn(::moveit_pro::test_utils::getPortIDs(input_port_setter_generator(), \ /*only_mandatory=*/true)));
Definition at line 23 of file test_behavior_without_context_input_port_not_set.hpp.
INSTANTIATE_SYNC_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS
|
Automatically instantiates tests for the "input Behavior port not set" situation for synchronous Behaviors without context.
- Value
-
INSTANTIATE_BEHAVIOR_WITHOUT_CONTEXT_PORT_NOT_SET_TESTS_(behavior_class, input_port_setter_generator, \ output_port_setter_generator, )
One test is generated for each Behavior input port.
- Parameters
-
behavior_class Class of the behavior under test. It cannot have namespace qualifiers. If those are needed, please use a using statement in the test file.
input_port_setter_generator A port setter map generator defining the expected input ports.
output_port_setter_generator A port setter map generator defining the expected output ports.
Definition at line 65 of file test_behavior_without_context_input_port_not_set.hpp.
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.