From 46cede1e1a47c8a218c910a52a6c6ac2bffe5219 Mon Sep 17 00:00:00 2001
From: Stefan Bienert <stefan.bienert@unibas.ch>
Date: Mon, 6 Feb 2012 15:01:36 +0100
Subject: [PATCH] Fixed some unit tests to work with older versions of boost.

---
 modules/geom/tests/test_composite3.cc |  4 ++--
 modules/geom/tests/test_quat.cc       | 20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/geom/tests/test_composite3.cc b/modules/geom/tests/test_composite3.cc
index 5602df4dd..f5cd5cf6b 100644
--- a/modules/geom/tests/test_composite3.cc
+++ b/modules/geom/tests/test_composite3.cc
@@ -199,9 +199,9 @@ BOOST_AUTO_TEST_CASE(rotation3)
   Vec3 v(1,0,0);
   Rotation3 r(Vec3(0,1,0), 30.0*M_PI/180.0);
   Vec3 vrot=r.Apply(v);
-  BOOST_CHECK_CLOSE(cos(30.0*M_PI/180.0),vrot[0],float(1e-5));
+  BOOST_CHECK_CLOSE(Real(cos(30.0*M_PI/180.0)), Real(vrot[0]), Real(1e-5));
   BOOST_CHECK_SMALL(vrot[1],float(1e-5));
-  BOOST_CHECK_CLOSE(-sin(30.0*M_PI/180.0),vrot[2],float(1e-5));
+  BOOST_CHECK_CLOSE(Real(-sin(30.0*M_PI/180.0)), Real(vrot[2]), Real(1e-5));
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/modules/geom/tests/test_quat.cc b/modules/geom/tests/test_quat.cc
index 0869fd518..ccaf9ab2d 100644
--- a/modules/geom/tests/test_quat.cc
+++ b/modules/geom/tests/test_quat.cc
@@ -31,16 +31,16 @@ BOOST_AUTO_TEST_CASE(init_quat)
 {
   // default
   Quat q1;
-  BOOST_CHECK_CLOSE(q1.w,1.0,1.0e-5);
-  BOOST_CHECK_CLOSE(q1.x,0.0,1.0e-5);
-  BOOST_CHECK_CLOSE(q1.y,0.0,1.0e-5);
-  BOOST_CHECK_CLOSE(q1.z,0.0,1.0e-5);
+  BOOST_CHECK_CLOSE(Real(q1.w), Real(1.0), Real(1.0e-5));
+  BOOST_CHECK_CLOSE(Real(q1.x), Real(0.0), Real(1.0e-5));
+  BOOST_CHECK_CLOSE(Real(q1.y), Real(0.0), Real(1.0e-5));
+  BOOST_CHECK_CLOSE(Real(q1.z), Real(0.0), Real(1.0e-5));
 
   Quat q2(2.0,3.0,4.0,5.0);
-  BOOST_CHECK_CLOSE(q2.w,2.0,1.0e-5);
-  BOOST_CHECK_CLOSE(q2.x,3.0,1.0e-5);
-  BOOST_CHECK_CLOSE(q2.y,4.0,1.0e-5);
-  BOOST_CHECK_CLOSE(q2.z,5.0,1.0e-5);
+  BOOST_CHECK_CLOSE(Real(q2.w), Real(2.0), Real(1.0e-5));
+  BOOST_CHECK_CLOSE(Real(q2.x), Real(3.0), Real(1.0e-5));
+  BOOST_CHECK_CLOSE(Real(q2.y), Real(4.0), Real(1.0e-5));
+  BOOST_CHECK_CLOSE(Real(q2.z), Real(5.0), Real(1.0e-5));
 }
 
 BOOST_AUTO_TEST_CASE(quat_rotate)
@@ -48,9 +48,9 @@ BOOST_AUTO_TEST_CASE(quat_rotate)
   Vec3 v(1,0,0);
   Quat q(30.0*M_PI/180.0,Vec3(0,1,0));
   Vec3 vrot=q.Rotate(v);
-  BOOST_CHECK_CLOSE(cos(30.0*M_PI/180.0),vrot[0],float(1e-5));
+  BOOST_CHECK_CLOSE(Real(cos(30.0*M_PI/180.0)), Real(vrot[0]), Real(1e-5));
   BOOST_CHECK_SMALL(vrot[1],float(1e-5));
-  BOOST_CHECK_CLOSE(-sin(30.0*M_PI/180.0),vrot[2],float(1e-5));
+  BOOST_CHECK_CLOSE(Real(-sin(30.0*M_PI/180.0)), Real(vrot[2]), Real(1e-5));
 }
 
 
-- 
GitLab