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

Function TEST

tests/cpp/types/LinearRing_test.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "fields2cover/types.h"
9
10TEST(fields2cover_types_linearring, init) {
11 F2CLinearRing ring1;
12 EXPECT_EQ(ring1.size(), 0);
13
14 ring1.addPoint(1,1);
15 ring1.addPoint(2,1);
16 EXPECT_EQ(ring1.size(), 2);
17
18 F2CLinearRing ring2{F2CPoint(1,2), F2CPoint(3,2), F2CPoint(1,3)};
19 EXPECT_EQ(ring2.size(), 3);
20
21
22 F2CPoint error_p;
23 const F2CLinearRing c_line = ring1.clone();
24 EXPECT_THROW(ring1.getGeometry(100, error_p), std::out_of_range);
25 EXPECT_THROW(c_line.getGeometry(100, error_p), std::out_of_range);
26 EXPECT_THROW(ring1.getGeometry(100), std::out_of_range);
27 EXPECT_THROW(c_line.getGeometry(100), std::out_of_range);
28}
29
30TEST(fields2cover_types_linearring, area) {
31 std::vector<F2CPoint> ps{F2CPoint(-1,2), F2CPoint(3,2), F2CPoint(-1,3), F2CPoint(-1,2)};

Callers

nothing calls this directly

Calls 9

sizeMethod · 0.45
addPointMethod · 0.45
cloneMethod · 0.45
getGeometryMethod · 0.45
areaMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45
getZMethod · 0.45
endPointMethod · 0.45

Tested by

no test coverage detected