MCPcopy Create free account
hub / github.com/cp-algorithms/cp-algorithms / test_simple

Function test_simple

test/test_planar_faces.cpp:27–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void test_simple() {
28 std::vector<Point> p = {
29 Point(0, 0),
30 Point(1, 0),
31 Point(1, 1),
32 Point(0, 1)
33 };
34
35 std::vector<std::vector<size_t>> adj = {
36 {1, 2, 3},
37 {0, 2},
38 {0, 1, 3},
39 {0, 2}
40 };
41
42 auto faces = find_faces(p, adj);
43 assert(faces.size() == 3u);
44 assert(equal_cycles(faces[0], {3, 2, 1, 0}));
45 bool eq11 = equal_cycles(faces[1], {0, 1, 2});
46 bool eq12 = equal_cycles(faces[1], {0, 2, 3});
47 bool eq21 = equal_cycles(faces[2], {0, 1, 2});
48 bool eq22 = equal_cycles(faces[2], {0, 2, 3});
49 assert(eq11^eq21);
50 assert(eq12^eq22);
51}
52
53void test_degenerate() {
54 std::vector<Point> p = {

Callers 1

mainFunction · 0.85

Calls 1

equal_cyclesFunction · 0.85

Tested by

no test coverage detected