| 105 | /****************TESTS START HERE***************************/ |
| 106 | |
| 107 | TEST_F(SimpleParallelTest, ConditionsTrue) |
| 108 | { |
| 109 | BT::NodeStatus state = root.executeTick(); |
| 110 | |
| 111 | ASSERT_EQ(NodeStatus::SUCCESS, condition_1.status()); |
| 112 | ASSERT_EQ(NodeStatus::SUCCESS, condition_2.status()); |
| 113 | ASSERT_EQ(NodeStatus::RUNNING, action_1.status()); |
| 114 | ASSERT_EQ(NodeStatus::RUNNING, action_2.status()); |
| 115 | ASSERT_EQ(NodeStatus::RUNNING, state); |
| 116 | |
| 117 | std::this_thread::sleep_for(milliseconds(200)); |
| 118 | state = root.executeTick(); |
| 119 | |
| 120 | ASSERT_EQ(NodeStatus::SUCCESS, condition_1.status()); |
| 121 | ASSERT_EQ(NodeStatus::SUCCESS, condition_2.status()); |
| 122 | ASSERT_EQ(NodeStatus::SUCCESS, action_1.status()); |
| 123 | ASSERT_EQ(NodeStatus::RUNNING, action_2.status()); |
| 124 | ASSERT_EQ(NodeStatus::RUNNING, state); |
| 125 | |
| 126 | std::this_thread::sleep_for(milliseconds(200)); |
| 127 | state = root.executeTick(); |
| 128 | |
| 129 | ASSERT_EQ(NodeStatus::IDLE, condition_1.status()); |
| 130 | ASSERT_EQ(NodeStatus::IDLE, condition_2.status()); |
| 131 | ASSERT_EQ(NodeStatus::IDLE, action_1.status()); |
| 132 | ASSERT_EQ(NodeStatus::IDLE, action_2.status()); |
| 133 | ASSERT_EQ(NodeStatus::SUCCESS, state); |
| 134 | } |
| 135 | |
| 136 | TEST_F(SimpleParallelTest, Threshold_3) |
| 137 | { |
nothing calls this directly
no test coverage detected