From 56444b4a50ab925b15ed2246c17c0fb45797a1e6 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 24 Aug 2017 17:02:18 +1000 Subject: [PATCH] geom/aabb: add (minimally) more thorough test data --- test/geom/aabb.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/geom/aabb.cpp b/test/geom/aabb.cpp index 35583bd4..1925e822 100644 --- a/test/geom/aabb.cpp +++ b/test/geom/aabb.cpp @@ -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 ();