| 14 | #include "../test_helpers/path_planning_checker.hpp" |
| 15 | |
| 16 | TEST(fields2cover_types_path, addState) { |
| 17 | F2CPath path; |
| 18 | path.addState(F2CPoint(1,2), 0.5*M_PI, 3, f2c::types::PathDirection::FORWARD, f2c::types::PathSectionType::TURN, 5); |
| 19 | path.addState(F2CPoint(3,4), 5*M_PI, 5, f2c::types::PathDirection::BACKWARD, f2c::types::PathSectionType::SWATH, 3); |
| 20 | |
| 21 | const F2CPath const_path = path; |
| 22 | |
| 23 | auto state0 = path.getState(0); |
| 24 | auto c_state0 = const_path.getState(0); |
| 25 | EXPECT_EQ(state0.point, c_state0.point); |
| 26 | EXPECT_EQ(state0.angle, c_state0.angle); |
| 27 | |
| 28 | EXPECT_EQ(state0.point, F2CPoint(1,2)); |
| 29 | EXPECT_EQ(state0.angle, 0.5*M_PI); |
| 30 | EXPECT_EQ(state0.len, 3); |
| 31 | EXPECT_EQ(int(state0.dir), int(f2c::types::PathDirection::FORWARD)); |
| 32 | EXPECT_EQ(int(state0.type), int(f2c::types::PathSectionType::TURN)); |
| 33 | EXPECT_EQ(state0.velocity, 5); |
| 34 | |
| 35 | auto states = path.getStates(); |
| 36 | auto c_states = const_path.getStates(); |
| 37 | EXPECT_EQ(states[0].point, F2CPoint(1,2)); |
| 38 | EXPECT_EQ(c_states[0].point, F2CPoint(1,2)); |
| 39 | EXPECT_EQ(states[0].point, path.atStart()); |
| 40 | EXPECT_EQ(c_states[0].point, const_path.atStart()); |
| 41 | } |
| 42 | |
| 43 | |
| 44 |
nothing calls this directly
no test coverage detected