From eb74db0599bb76087c65d1178ef72c876656938d Mon Sep 17 00:00:00 2001 From: ThomasDuvinage Date: Wed, 11 Dec 2024 12:45:59 +0900 Subject: [PATCH] [tests] fix test for ARM64 --- tests/ExpandTest.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/ExpandTest.cpp b/tests/ExpandTest.cpp index a57b3270..d8aee586 100644 --- a/tests/ExpandTest.cpp +++ b/tests/ExpandTest.cpp @@ -12,6 +12,8 @@ #include +const double TOL = 0.00001; + void setRandomFreeFlyer(rbd::MultiBodyConfig & mbc) { Eigen::Vector3d axis = Eigen::Vector3d::Random(); @@ -59,16 +61,28 @@ BOOST_AUTO_TEST_CASE(ExpandJacobianTest) Eigen::MatrixXd product = jacMat.transpose() * jacMat; Eigen::MatrixXd fullProduct = jac.expand(mb, product); - BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0); + #if defined __i386__ || defined __aarch64__ + BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL); + #else + BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0); + #endif fullProduct.setZero(); jac.expandAdd(mb, product, fullProduct); - BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0); + #if defined __i386__ || defined __aarch64__ + BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL); + #else + BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0); + #endif fullProduct.setZero(); jac.expandAdd(compact, product, fullProduct); - BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0); + #if defined __i386__ || defined __aarch64__ + BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL); + #else + BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0); + #endif } }