Skip to content

Commit

Permalink
[tests] fix test for ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDuvinage committed Dec 11, 2024
1 parent e429070 commit eb74db0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/ExpandTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include <boost/test/unit_test.hpp>

const double TOL = 0.00001;

void setRandomFreeFlyer(rbd::MultiBodyConfig & mbc)
{
Eigen::Vector3d axis = Eigen::Vector3d::Random();
Expand Down Expand Up @@ -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
}
}

0 comments on commit eb74db0

Please sign in to comment.