Flutter Engine
The Flutter Engine
Functions
PointTest.cpp File Reference
#include "modules/bentleyottmann/include/Point.h"
#include "tests/Test.h"

Go to the source code of this file.

Functions

 DEF_TEST (BO_PointBasic, reporter)
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( BO_PointBasic  ,
reporter   
)

Definition at line 9 of file PointTest.cpp.

9 {
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 {
36 REPORTER_ASSERT(reporter, !Point::DifferenceTooBig(Point::Smallest(), Point{0, 0}));
37 REPORTER_ASSERT(reporter, !Point::DifferenceTooBig(Point::Largest(), Point{0, 0}));
38 REPORTER_ASSERT(reporter, Point::DifferenceTooBig(Point{0, 0}, Point::Smallest()));
39 REPORTER_ASSERT(reporter, !Point::DifferenceTooBig(Point{0, 0}, Point::Largest()));
40 REPORTER_ASSERT(reporter, Point::DifferenceTooBig(Point::Smallest(), Point::Largest()));
41 REPORTER_ASSERT(reporter, Point::DifferenceTooBig(Point::Largest(), Point::Smallest()));
43 !Point::DifferenceTooBig(Point::Smallest() + Point{1, 1}, Point{0, 0}));
45 !Point::DifferenceTooBig(Point{0, 0}, Point::Smallest() + Point{1, 1}));
46 }
47}
reporter
Definition: FontMgrTest.cpp:39
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286