Skip to content

Commit

Permalink
fixed precision issue in unit-test on OSX M3 (#1875)
Browse files Browse the repository at this point in the history
Signed-off-by: kmuseth <ken.museth@gmail.com>
  • Loading branch information
kmuseth committed Aug 17, 2024
1 parent d74e2c4 commit 6719224
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions openvdb/openvdb/unittest/TestLinearInterp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ template<typename GridType>
void
TestLinearInterp::testStencilsMatch()
{
typedef typename GridType::ValueType ValueType;
using ValueType = typename GridType::ValueType;

GridType grid;
typename GridType::TreeType& tree = grid.tree();
Expand All @@ -1022,14 +1022,13 @@ TestLinearInterp::testStencilsMatch()
openvdb::tools::GridSampler<GridType, openvdb::tools::BoxSampler>
interpolator(grid);

openvdb::math::BoxStencil<const GridType>
stencil(grid);

typename GridType::ValueType val1 = interpolator.sampleVoxel(pos.x(), pos.y(), pos.z());
openvdb::math::BoxStencil<const GridType> stencil(grid);

const ValueType val1 = interpolator.sampleVoxel(pos.x(), pos.y(), pos.z());
stencil.moveTo(pos);
typename GridType::ValueType val2 = stencil.interpolation(pos);
EXPECT_EQ(val1, val2);
const ValueType val2 = stencil.interpolation(pos);
static const ValueType epsilon = openvdb::math::Delta<ValueType>::value();
EXPECT_NEAR(val1, val2, epsilon);
}
}
TEST_F(TestLinearInterp, testStencilsMatchFloat) { testStencilsMatch<openvdb::FloatGrid>(); }
Expand Down

0 comments on commit 6719224

Please sign in to comment.