Skip to content

Commit

Permalink
fix compilation (std::fabs not templated for floating point)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy committed Mar 6, 2025
1 parent cd15c4e commit 5e61aa6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PlaneMappingTest : public testing::Test
typename sofa::component::mapping::linear::DistanceToPlaneMapping<DataType>::SPtr mapping = New<sofa::component::mapping::linear::DistanceToPlaneMapping<DataType>>();
mapping->d_planeNormal.setValue(planeNormal);
auto simu = this->createSimpleScene(mapping);
EXPECT_LE(std::fabs<SReal>(mapping->d_planeNormal.getValue().norm() - 1.0),EPSILON);
EXPECT_LE(std::fabs(mapping->d_planeNormal.getValue().norm() - 1.0),EPSILON);
EXPECT_EQ(mapping->getFrom()[0]->getSize(),10);
EXPECT_EQ(mapping->getTo()[0]->getSize(),mapping->getFrom()[0]->getSize());
}
Expand Down Expand Up @@ -155,7 +155,7 @@ class PlaneMappingTest : public testing::Test

for (unsigned i = 0; i<outVec.getValue().size(); ++i)
{
EXPECT_LE(std::fabs<SReal>(outVec.getValue()[i][0] - dists[i]), EPSILON);
EXPECT_LE(std::fabs(outVec.getValue()[i][0] - dists[i]), EPSILON);
}
}

Expand Down Expand Up @@ -192,7 +192,7 @@ class PlaneMappingTest : public testing::Test

for (unsigned i = 0; i<outVec.getValue().size(); ++i)
{
EXPECT_LE(std::fabs<SReal>(outVec.getValue()[i][0] - dists[i]), EPSILON );
EXPECT_LE(std::fabs(outVec.getValue()[i][0] - dists[i]), EPSILON );
}
}

Expand All @@ -217,7 +217,7 @@ class PlaneMappingTest : public testing::Test
{
for (unsigned j=0; j< PlaneNormalType::size(); ++j)
{
EXPECT_LE(std::fabs<SReal>(outVec.getValue()[i][j] - planeNormal[j] * inPos.getValue()[i][0]),EPSILON);
EXPECT_LE(std::fabs(outVec.getValue()[i][j] - planeNormal[j] * inPos.getValue()[i][0]),EPSILON);
}
}
}
Expand Down

0 comments on commit 5e61aa6

Please sign in to comment.