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

Function TEST

tests/cpp/types/Swaths_test.cpp:23–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23TEST(fields2cover_types_swaths, append) {
24 auto rings = create_polygon_border();
25 F2CCells polys;
26 F2CCell polygon;
27 polygon.addRing(rings[0]);
28 polys.addGeometry(polygon);
29 F2CLineString line;
30 line.addPoint(-20, -10);
31 line.addPoint(-5, 5);
32
33 F2CSwaths swaths;
34 EXPECT_EQ(swaths.size(), 0);
35 swaths.append(line, polys, 1.0);
36 EXPECT_EQ(swaths.size(), 1);
37 swaths.append(line, polys, 2.0);
38 EXPECT_EQ(swaths.size(), 2);
39 line.addPoint(-19.9, -10);
40 line.addPoint(-5, 5.1);
41 swaths.append(line, polys, 3.0);
42 EXPECT_EQ(swaths.size(), 4);
43 F2CMultiLineString lines;
44 lines.addGeometry(line);
45 lines.addGeometry(F2CLineString({F2CPoint(-10,0),F2CPoint(10,20)}));
46 swaths.append(lines, polygon, 4);
47 EXPECT_EQ(swaths.size(), 8);
48 swaths.append(lines, polys, 5);
49 EXPECT_EQ(swaths.size(), 12);
50 lines.addGeometry(F2CLineString({F2CPoint(1e5, 1e5),F2CPoint(1e5+1, 1e5+1)}));
51 swaths.append(lines, polys, 6);
52 EXPECT_EQ(swaths.size(), 16);
53}
54
55
56TEST(fields2cover_types_swaths, sort) {

Callers

nothing calls this directly

Calls 15

create_polygon_borderFunction · 0.85
sortMethod · 0.80
reverseDirOddSwathsMethod · 0.80
hasSameDirMethod · 0.80
addRingMethod · 0.45
addGeometryMethod · 0.45
addPointMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
emplace_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected