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

Function TEST

tests/cpp/types/PathState_test.cpp:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "fields2cover/types.h"
9
10TEST(fields2cover_types_pathState, atEnd) {
11 F2CPathState ps;
12 ps.point = F2CPoint(1, 1);
13 ps.angle = 0.0;
14 ps.velocity = 2.0;
15 ps.len = 4.0;
16 ps.dir = f2c::types::PathDirection::FORWARD;
17 ps.type = f2c::types::PathSectionType::SWATH;
18 EXPECT_EQ(ps.atEnd(), F2CPoint(5,1));
19
20 ps.angle = M_PI*0.5;
21 EXPECT_NEAR(ps.atEnd().getX(), 1, 1e-7);
22 EXPECT_NEAR(ps.atEnd().getY(), 5, 1e-7);
23
24 ps.dir = f2c::types::PathDirection::BACKWARD;
25 EXPECT_NEAR(ps.atEnd().getX(), 1, 1e-7);
26 EXPECT_NEAR(ps.atEnd().getY(), -3, 1e-7);
27
28 ps.len = -4.0;
29 EXPECT_NEAR(ps.atEnd().getX(), 1, 1e-7);
30 EXPECT_NEAR(ps.atEnd().getY(), 5, 1e-7);
31}
32
33
34

Callers

nothing calls this directly

Calls 3

atEndMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected