9 #include <boost/test/unit_test.hpp>
18 std::vector<int>
v = {-100, -90, -80, -70, -60, -50, -40, -30, -20, 10, 0,
19 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
24 BOOST_AUTO_TEST_SUITE(Utilities)
26 BOOST_AUTO_TEST_SUITE(Range1D)
31 BOOST_CHECK(r.
min() == std::numeric_limits<int>::lowest());
32 BOOST_CHECK(r.
max() == std::numeric_limits<int>::max());
38 BOOST_CHECK(r.
min() == std::numeric_limits<double>::lowest());
39 BOOST_CHECK(r.
max() == std::numeric_limits<double>::max());
45 BOOST_CHECK(r.
min() == -11);
46 BOOST_CHECK(r.
max() == 2);
52 BOOST_CHECK(r.
min() == -11.0);
53 BOOST_CHECK(r.
max() == 2.0);
60 BOOST_CHECK(r.
min() == -11.0);
61 BOOST_CHECK(r.
max() == 2.0);
67 BOOST_CHECK(r.
min() == -11.0);
68 BOOST_CHECK(r.
max() == 2.0);
75 BOOST_CHECK(r.
min() == -11.0);
76 BOOST_CHECK(r.
max() == 2.0);
84 BOOST_CHECK(r.
min() == -11.0);
85 BOOST_CHECK(r.
max() == std::numeric_limits<double>::max());
93 BOOST_CHECK(r.
min() == std::numeric_limits<double>::lowest());
94 BOOST_CHECK(r.
max() == 2.0);
103 BOOST_CHECK(r.
min() == -11.0);
104 BOOST_CHECK(r.
max() == 2.0);
112 BOOST_CHECK(r.
min() == -11.0);
113 BOOST_CHECK(r.
max() == 2.0);
122 BOOST_CHECK(r.
min() == -11.0);
123 BOOST_CHECK(r.
max() == 2.0);
132 BOOST_CHECK(r.
min() == -11.0);
133 BOOST_CHECK(r.
max() == 2.0);
142 BOOST_CHECK(r.
min() == -11.0);
143 BOOST_CHECK(r.
max() == 1.0);
152 BOOST_CHECK(r.
min() == -10.0);
153 BOOST_CHECK(r.
max() == 2.0);
162 BOOST_CHECK(r.
min() == -11.0);
163 BOOST_CHECK(r.
max() == std::numeric_limits<double>::max());
172 BOOST_CHECK(r.
min() == std::numeric_limits<double>::lowest());
173 BOOST_CHECK(r.
max() == 2.0);
181 BOOST_CHECK(r.
min() == 2.0);
182 BOOST_CHECK(r.
max() == std::numeric_limits<double>::max());
191 BOOST_CHECK(r.
min() == -4.0);
192 BOOST_CHECK(r.
max() == std::numeric_limits<double>::max());
200 BOOST_CHECK(r.
min() == std::numeric_limits<double>::lowest());
201 BOOST_CHECK(r.
max() == 2.0);
210 BOOST_CHECK(r.
min() == std::numeric_limits<double>::lowest());
211 BOOST_CHECK(r.
max() == 4.0);
219 BOOST_CHECK(r.
min() == -11.0);
220 BOOST_CHECK(r.
max() == 0.0);
228 BOOST_CHECK(r.
min() == 0.0);
229 BOOST_CHECK(r.
max() == 2.0);
238 BOOST_CHECK(r.
min() == -11.0);
239 BOOST_CHECK(r.
max() == 2.0);
247 BOOST_CHECK(r.
min() == -11.0);
248 BOOST_CHECK(r.
max() == 2.0);
257 BOOST_CHECK(r.
min() == -100.0);
258 BOOST_CHECK(r.
max() == 20.0);
267 BOOST_CHECK(r.
min() == -100.0);
268 BOOST_CHECK(r.
max() == 20.0);
277 BOOST_CHECK(r.
min() == -100.0);
278 BOOST_CHECK(r.
max() == 2.0);
287 BOOST_CHECK(r.
min() == -11.0);
288 BOOST_CHECK(r.
max() == 20.0);
297 BOOST_CHECK(r.
min() == -100.0);
298 BOOST_CHECK(r.
max() == 0.0);
307 BOOST_CHECK(r.
min() == 0.0);
308 BOOST_CHECK(r.
max() == 4.0);
314 BOOST_CHECK(r.
size() == 35.0);
320 BOOST_CHECK(r.
size() == 0.0);
326 BOOST_CHECK(r.
size() == 0.0);
365 BOOST_CHECK((r && q));
372 BOOST_CHECK((r && q));
379 BOOST_CHECK((r && q));
386 BOOST_CHECK(!(r && q));
393 BOOST_CHECK(!(r && q));
400 BOOST_CHECK((r == q));
407 BOOST_CHECK(!(r == q));
414 BOOST_CHECK(!(r <= q));
415 BOOST_CHECK(!(q <= r));
422 BOOST_CHECK((r <= q));
423 BOOST_CHECK(!(q <= r));
430 BOOST_CHECK(!(r <= q));
431 BOOST_CHECK((q <= r));
438 BOOST_CHECK(!(r <= q));
439 BOOST_CHECK(!(q <= r));
446 BOOST_CHECK(!(r <= q));
447 BOOST_CHECK(!(q <= r));
454 BOOST_CHECK(!(r >= q));
455 BOOST_CHECK(!(q >= r));
462 BOOST_CHECK(!(r >= q));
463 BOOST_CHECK((q >= r));
470 BOOST_CHECK((r >= q));
471 BOOST_CHECK(!(q >= r));
478 BOOST_CHECK(!(r >= q));
479 BOOST_CHECK(!(q >= r));
486 BOOST_CHECK(!(r >= q));
487 BOOST_CHECK(!(q >= r));
495 BOOST_CHECK(i.
min() == 5.0);
496 BOOST_CHECK(i.
max() == 25.0);
504 BOOST_CHECK(i.
min() == -10.0);
505 BOOST_CHECK(i.
max() == 25.0);
513 BOOST_CHECK(i.
min() == -5.0);
514 BOOST_CHECK(i.
max() == 5.0);
537 BOOST_CHECK((r && q));
544 BOOST_CHECK(!(r && q));
572 BOOST_CHECK(!((r & q).degenerate()));
574 BOOST_CHECK(((r & q).degenerate()));
588 BOOST_CHECK(r.
size() == 0);
590 BOOST_CHECK(r.
size() >= 0);
612 BOOST_AUTO_TEST_SUITE_END()
614 BOOST_AUTO_TEST_SUITE_END()