From 12350d3ac7a1192407b0f920bd937d4f753ec118 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 14 Jun 2016 11:31:52 +0200 Subject: Add unit test for AlignedBox::center --- test/geo_alignedbox.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/geo_alignedbox.cpp') diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp index 2bdb4b7f2..ba3378aab 100644 --- a/test/geo_alignedbox.cpp +++ b/test/geo_alignedbox.cpp @@ -48,6 +48,8 @@ template void alignedbox(const BoxType& _box) b0.extend(p0); b0.extend(p1); VERIFY(b0.contains(p0*s1+(Scalar(1)-s1)*p1)); + VERIFY(b0.contains(b0.center())); + VERIFY(b0.center()==(p0+p1)/Scalar(2)); (b2 = b0).extend(b1); VERIFY(b2.contains(b0)); -- cgit v1.2.3 From 57113e00f9b0cb25e6982df13706687023cea944 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 9 Jul 2016 23:37:11 +0200 Subject: Relax strict equality --- test/geo_alignedbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/geo_alignedbox.cpp') diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp index ba3378aab..d2339a651 100644 --- a/test/geo_alignedbox.cpp +++ b/test/geo_alignedbox.cpp @@ -49,7 +49,7 @@ template void alignedbox(const BoxType& _box) b0.extend(p1); VERIFY(b0.contains(p0*s1+(Scalar(1)-s1)*p1)); VERIFY(b0.contains(b0.center())); - VERIFY(b0.center()==(p0+p1)/Scalar(2)); + VERIFY_IS_APPROX(b0.center(),(p0+p1)/Scalar(2)); (b2 = b0).extend(b1); VERIFY(b2.contains(b0)); -- cgit v1.2.3