Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
PointTest.cpp
Go to the documentation of this file.
1// Copyright 2023 Google LLC
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
5#include "tests/Test.h"
6
7using namespace bentleyottmann;
8
9DEF_TEST(BO_PointBasic, reporter) {
10 {
11 Point p0 = {0, 0};
12 Point p1 = {0, 0};
13 REPORTER_ASSERT(reporter, !(p0 < p1));
14 REPORTER_ASSERT(reporter, !(p1 < p0));
15 REPORTER_ASSERT(reporter, p0 == p1);
16 }
17
18 {
19 Point p0 = {0, 0};
20 Point p1 = {1, 1};
21 REPORTER_ASSERT(reporter, p0 < p1);
22 REPORTER_ASSERT(reporter, !(p1 < p0));
23 REPORTER_ASSERT(reporter, p0 != p1);
24 }
25
26 {
27 // Same y different x.
28 Point p0 = {0, 0};
29 Point p1 = {1, 0};
30 REPORTER_ASSERT(reporter, p0 < p1);
31 REPORTER_ASSERT(reporter, !(p1 < p0));
32 REPORTER_ASSERT(reporter, p0 != p1);
33 }
34
35 {
46 }
47}
reporter
#define DEF_TEST(name, reporter)
Definition Test.h:312
#define REPORTER_ASSERT(r, cond,...)
Definition Test.h:286
static Point Smallest()
Definition Point.cpp:36
static bool DifferenceTooBig(Point p0, Point p1)
Definition Point.cpp:46
static Point Largest()
Definition Point.cpp:41