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

Function test_square

test/test_planar_implicit.cpp:11–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "planar_implicit.h"
10
11void test_square() {
12 std::vector<Line> s = {
13 Line(Point(0, 0), Point(0, 1)),
14 Line(Point(0, 0), Point(1, 0)),
15 Line(Point(1, 1), Point(0, 1)),
16 Line(Point(1, 1), Point(1, 0)),
17 Line(Point(0, 0), Point(1, 1)),
18 Line(Point(1, 0), Point(0, 1))
19 };
20 auto [pts, adj] = build_graph(s);
21 std::vector<Point> pts1 = {Point(0, 0), Point(0, 1), Point(1, 0), Point(1, 1), Point(0.5, 0.5)};
22 assert(pts == pts1);
23 std::sort(adj[4].begin(), adj[4].end());
24 std::vector<size_t> adj1 = {0, 1, 2, 3};
25 assert(adj[4] == adj1);
26}
27
28void test_grid() {
29 std::vector<Line> s = {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected