9 #include <boost/test/unit_test.hpp>
18 BOOST_AUTO_TEST_SUITE(Utilities)
20 BOOST_AUTO_TEST_SUITE(RangeXD)
25 BOOST_CHECK(r[0].
min() == std::numeric_limits<double>::lowest());
26 BOOST_CHECK(r[0].max() == std::numeric_limits<double>::max());
27 BOOST_CHECK(r[1].
min() == std::numeric_limits<double>::lowest());
28 BOOST_CHECK(r[1].max() == std::numeric_limits<double>::max());
29 BOOST_CHECK(r[2].
min() == std::numeric_limits<double>::lowest());
30 BOOST_CHECK(r[2].max() == std::numeric_limits<double>::max());
36 r[0].shrink(-10.0, 10.0);
37 r[1].shrink(0.0, 50.0);
38 r[2].shrinkMax(-20.0);
40 BOOST_CHECK(r[0].
min() == -10.0);
41 BOOST_CHECK(r[0].max() == 10.0);
42 BOOST_CHECK(r[1].
min() == 0.0);
43 BOOST_CHECK(r[1].max() == 50.0);
44 BOOST_CHECK(r[2].
min() == std::numeric_limits<double>::lowest());
45 BOOST_CHECK(r[2].max() == -20.0);
51 r[0].shrink(-10.0, 10.0);
52 r[1].shrink(0.0, 50.0);
53 r[2].shrink(-20.0, -30.0);
61 r[0].shrink(-10.0, 10.0);
62 r[1].shrink(0.0, 50.0);
63 r[2].shrink(-20.0, 30.0);
71 r[0].shrink(-10.0, 10.0);
72 r[1].shrink(0.0, 50.0);
73 r[2].shrink(-20.0, 30.0);
75 BOOST_CHECK(r.
contains({0.0, 1.0, 0.0}));
76 BOOST_CHECK(r.
contains({9.0, 0.5, 29.0}));
77 BOOST_CHECK(r.
contains({-8.0, 40.0, -20.0}));
78 BOOST_CHECK(r.
contains({4.0, 4.0, 4.0}));
79 BOOST_CHECK(r.
contains({0.0, 0.0, 0.0}));
80 BOOST_CHECK(!r.
contains({-12.0, 1.0, 0.0}));
81 BOOST_CHECK(!r.
contains({0.0, -1.0, 0.0}));
82 BOOST_CHECK(!r.
contains({0.0, 1.0, 40.0}));
83 BOOST_CHECK(!
r.contains({20.0, 10.0, 300.0}));
84 BOOST_CHECK(!
r.contains({-100.0, -100.0, -100.0}));
98 BOOST_CHECK((r == q));
104 r[0].shrink(-10.0, 10.0);
105 r[1].shrink(0.0, 50.0);
106 r[2].shrink(-20.0, 30.0);
108 q[0].shrink(-5.0, 5.0);
109 q[1].shrink(10.0, 100.0);
110 q[2].shrink(-10.0, 20.0);
112 BOOST_CHECK(!(r <= q));
113 BOOST_CHECK(!(q <= r));
119 r[0].shrink(-10.0, 10.0);
120 r[1].shrink(0.0, 50.0);
121 r[2].shrink(-20.0, 30.0);
123 q[0].shrink(-5.0, 5.0);
124 q[1].shrink(10.0, 20.0);
125 q[2].shrink(-10.0, 20.0);
127 BOOST_CHECK(!(r <= q));
128 BOOST_CHECK((q <= r));
134 r[0].shrink(-10.0, 10.0);
135 r[1].shrink(0.0, 50.0);
136 r[2].shrink(-20.0, 30.0);
138 q[0].shrink(-5.0, 5.0);
139 q[1].shrink(10.0, 20.0);
140 q[2].shrink(-10.0, 20.0);
142 BOOST_CHECK((r >= q));
143 BOOST_CHECK(!(q >= r));
149 r[0].shrink(-10.0, 10.0);
150 r[1].shrink(0.0, 50.0);
151 r[2].shrink(-20.0, 30.0);
153 q[0].shrink(-5.0, 5.0);
154 q[1].shrink(10.0, 20.0);
155 q[2].shrink(-10.0, 20.0);
157 BOOST_CHECK((r && q));
158 BOOST_CHECK((q && r));
164 r[0].shrink(-10.0, 10.0);
165 r[1].shrink(0.0, 50.0);
166 r[2].shrink(-20.0, 30.0);
168 q[0].shrink(-5.0, 5.0);
169 q[1].shrink(10.0, 20.0);
170 q[2].shrink(-100.0, -50.0);
172 BOOST_CHECK(!(r && q));
173 BOOST_CHECK(!(q && r));
179 r[0].shrink(-10.0, 10.0);
180 r[1].shrink(0.0, 50.0);
181 r[2].shrink(-20.0, 30.0);
183 q[0].shrink(-50.0, -20.0);
184 q[1].shrink(-10.0, -5.0);
185 q[2].shrink(-100.0, -50.0);
187 BOOST_CHECK(!(r && q));
188 BOOST_CHECK(!(q && r));
191 BOOST_AUTO_TEST_SUITE_END()
193 BOOST_AUTO_TEST_SUITE_END()