geom/aabb: add (minimally) more thorough test data

This commit is contained in:
Danny Robson 2017-08-24 17:02:18 +10:00
parent 1cea1600d3
commit 56444b4a50

View File

@ -13,19 +13,17 @@ main (int, char**)
util::TAP::logger tap;
{
// Test contraction
const aabb2f val { { 2, 2 }, { 8, 8 } };
const aabb2f res { { 3, 3 }, { 7, 7 } };
const aabb2f val { { 1, 2 }, { 8, 5 } };
const aabb2f res { { 3, 3 }, { 6, 4 } };
tap.expect_eq (val.contract (1.f), res, "over contraction");
tap.expect_eq (val.contract ({2.f, 1.f}), res, "aabb::contract");
}
{
// Test expansion
const aabb2f val { { 2, 2 }, { 8, 8 } };
const aabb2f res { { 1, 1 }, { 9, 9 } };
const aabb2f val { { 2, 1 }, { 3, 6 } };
const aabb2f res { { 1, -1 }, { 4, 8 } };
tap.expect_eq (val.expand (1.f), res, "expansion");
tap.expect_eq (val.expand ({1.f, 2.f}), res, "aabb::expand");
}
return tap.status ();