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

Function TEST

tests/cpp/objectives/hg_obj/rem_area_test.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "fields2cover/types.h"
11
12TEST(fields2cover_obj_remArea, computeCost) {
13 f2c::obj::RemArea rem_area;
14
15 F2CCell total_field(F2CLinearRing(
16 {F2CPoint(-2,-2), F2CPoint(6,-2), F2CPoint(6,6), F2CPoint(-2,6), F2CPoint(-2,-2)}));
17 F2CCell field(F2CLinearRing(
18 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,4), F2CPoint(0,4), F2CPoint(0,0)}));
19
20 EXPECT_EQ(rem_area.computeCost(total_field, field), 0.25);
21 EXPECT_EQ(rem_area.computeCostWithMinimizingSign(total_field, field), -0.25);
22 EXPECT_EQ(rem_area.computeCost(F2CCells(total_field), field), 0.25);
23 EXPECT_EQ(rem_area.computeCostWithMinimizingSign(F2CCells(total_field), field), -0.25);
24 EXPECT_EQ(rem_area.computeCost(total_field, F2CCells(field)), 0.25);
25 EXPECT_EQ(rem_area.computeCostWithMinimizingSign(total_field, F2CCells(field)), -0.25);
26 EXPECT_EQ(rem_area.computeCost(F2CCells(total_field), F2CCells(field)), 0.25);
27 EXPECT_EQ(rem_area.computeCostWithMinimizingSign(F2CCells(total_field), F2CCells(field)), -0.25);
28}
29
30TEST(fields2cover_obj_remArea, params_check) {
31 f2c::obj::RemArea objective;

Callers

nothing calls this directly

Calls 4

isMaximizingMethod · 0.80
computeCostMethod · 0.45
isMinimizingMethod · 0.45

Tested by

no test coverage detected