2012-05-11 12:21:47 +10:00
|
|
|
#include "../region.hpp"
|
2012-06-08 16:48:33 +10:00
|
|
|
#include "../point.hpp"
|
2012-05-26 18:01:54 +10:00
|
|
|
#include "../debug.hpp"
|
2012-05-11 12:21:47 +10:00
|
|
|
|
|
|
|
using util::region;
|
2012-06-08 16:48:33 +10:00
|
|
|
using util::point2;
|
2012-05-11 12:21:47 +10:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int, char **) {
|
|
|
|
{
|
|
|
|
region<double> a (32.7, -6.09703, 0.8, 2);
|
|
|
|
region<double> b (33.5, -4.5, 0.5, 0.5);
|
|
|
|
|
2012-05-11 12:34:21 +10:00
|
|
|
CHECK_HARD (!a.overlaps (b));
|
2012-05-11 12:21:47 +10:00
|
|
|
}
|
|
|
|
|
2012-06-08 16:48:33 +10:00
|
|
|
CHECK_HARD (region<int> (0, 0, 2, 2).includes (point2(1.0, 1.0)));
|
|
|
|
CHECK_HARD (region<int> (0, 0, 2, 2).includes (point2(0.0, 0.0)));
|
|
|
|
CHECK_HARD (region<int> (0, 0, 2, 2).includes (point2(2.0, 2.0)));
|
|
|
|
|
|
|
|
CHECK_HARD ( region<int> (0, 0, 2, 2).contains (point2(1.0, 1.0)));
|
|
|
|
CHECK_HARD (!region<int> (0, 0, 2, 2).contains (point2(0.0, 0.0)));
|
|
|
|
CHECK_HARD (!region<int> (0, 0, 2, 2).contains (point2(2.0, 2.0)));
|
|
|
|
|
|
|
|
CHECK_HARD (region<intmax_t> (0, 0, 10, 10).includes (point2 (0.4, 0.01)));
|
|
|
|
CHECK_HARD (region<intmax_t> (0, 0, 10, 10).contains (point2 (0.4, 0.01)));
|
|
|
|
|
2012-05-11 12:21:47 +10:00
|
|
|
return 0;
|
|
|
|
}
|