MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / TEST

Function TEST

tests/cpp/types/Path_test.cpp:16–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include "../test_helpers/path_planning_checker.hpp"
15
16TEST(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

Callers

nothing calls this directly

Calls 15

addStateMethod · 0.80
atStartMethod · 0.80
setStatesMethod · 0.80
mirrorXMethod · 0.80
mirrorYMethod · 0.80
setBackwardDirMethod · 0.80
setForwardDirMethod · 0.80
setSwathTypeMethod · 0.80
setTurnTypeMethod · 0.80
appendSwathMethod · 0.80
getTaskTimeMethod · 0.80
serializePathMethod · 0.80

Tested by

no test coverage detected