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

Function TEST

tests/cpp/types/Cell_test.cpp:10–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "fields2cover/types.h"
9
10TEST(fields2cover_types_cell, constructor) {
11 F2CLinearRing line{
12 F2CPoint(0,0), F2CPoint(2,0),F2CPoint(2,2),F2CPoint(0,2), F2CPoint(0,0)};
13 F2CCell cell {line};
14 F2CCell cell_clone{cell.get()};
15 F2CCell cell2 {cell};
16 F2CCell cell3 {static_cast<OGRGeometry*>(cell.get())};
17
18 EXPECT_EQ(cell.area(), 4);
19 EXPECT_EQ(cell2.area(), 4);
20 EXPECT_EQ(cell3.area(), 4);
21 EXPECT_EQ(cell_clone.area(), 4);
22 EXPECT_EQ(F2CCell(cell.get()).area(), 4);
23 EXPECT_EQ(F2CCell(cell).area(), 4);
24 EXPECT_THROW(F2CCell(line.get()), std::invalid_argument);
25}
26
27TEST(fields2cover_types_cell, setGeometry) {
28 F2CLinearRing line {

Callers

nothing calls this directly

Calls 15

sstrFunction · 0.85
getMethod · 0.80
areaMethod · 0.45
sizeMethod · 0.45
setGeometryMethod · 0.45
addRingMethod · 0.45
getGeometryMethod · 0.45
lengthMethod · 0.45
cloneMethod · 0.45
createLineUntilBorderMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected