MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

tools/poly_borders/poly_borders_tests/mark_points_tests.cpp:48–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48UNIT_TEST(PolyBordersPostprocessor_MarkPoints_1)
49{
50 ScopedDir const scopedDir(kTestDir);
51 string const & bordersDir = scopedDir.GetFullPath();
52
53 m2::PointD a(-1.0, -1.0);
54 m2::PointD b(-1.0, 1.0);
55
56 vector<vector<m2::PointD>> polygons1 = {{a, b, {1.0, 1.0}, {1.0, -1.0}}};
57
58 vector<vector<bool>> markedMask1 = {{true, true, false, false}};
59
60 vector<vector<m2::PointD>> polygons2 = {{a, b, {2.0, 1.0}, {5.0, -1.0}}};
61
62 vector<vector<bool>> markedMask2 = {{true, true, false, false}};
63
64 vector<shared_ptr<ScopedFile>> files;
65 files.emplace_back(CreatePolyBorderFileByPolygon(kTestDir, "First", polygons1));
66 files.emplace_back(CreatePolyBorderFileByPolygon(kTestDir, "Second", polygons2));
67
68 BordersData bordersData;
69 bordersData.Init(bordersDir);
70
71 auto const & bordersPolygon1 = bordersData.GetBordersPolygonByName("First" + BordersData::kBorderExtension + "1");
72 CheckByMask(bordersPolygon1, markedMask1[0]);
73
74 auto const & bordersPolygon2 = bordersData.GetBordersPolygonByName("Second" + BordersData::kBorderExtension + "1");
75 CheckByMask(bordersPolygon2, markedMask2[0]);
76}
77
78UNIT_TEST(PolyBordersPostprocessor_MarkPoints_2)
79{

Callers

nothing calls this directly

Calls 4

CheckByMaskFunction · 0.85
emplace_backMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected