Skip to content

Commit

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

#include <boost/test/unit_test.hpp>

const double TOL = 0.00001;
const double TOL = 1e-10;

void setRandomFreeFlyer(rbd::MultiBodyConfig & mbc)
{
Expand Down Expand Up @@ -61,28 +61,16 @@ BOOST_AUTO_TEST_CASE(ExpandJacobianTest)
Eigen::MatrixXd product = jacMat.transpose() * jacMat;
Eigen::MatrixXd fullProduct = jac.expand(mb, product);

#if defined __i386__ || defined __aarch64__
BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL);
#else
BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0);
#endif
BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL);

fullProduct.setZero();
jac.expandAdd(mb, product, fullProduct);

#if defined __i386__ || defined __aarch64__
BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL);
#else
BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0);
#endif
BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL);

fullProduct.setZero();
jac.expandAdd(compact, product, fullProduct);

#if defined __i386__ || defined __aarch64__
BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL);
#else
BOOST_CHECK_EQUAL((fullProduct - res).norm(), 0);
#endif
BOOST_CHECK_SMALL((fullProduct - res).norm(), TOL);
}
}

0 comments on commit ca3021f

Please sign in to comment.