File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -999,7 +999,7 @@ template<typename GridType>
999999void
10001000TestLinearInterp::testStencilsMatch ()
10011001{
1002- typedef typename GridType::ValueType ValueType;
1002+ using ValueType = typename GridType::ValueType;
10031003
10041004 GridType grid;
10051005 typename GridType::TreeType& tree = grid.tree ();
@@ -1022,14 +1022,13 @@ TestLinearInterp::testStencilsMatch()
10221022 openvdb::tools::GridSampler<GridType, openvdb::tools::BoxSampler>
10231023 interpolator (grid);
10241024
1025- openvdb::math::BoxStencil<const GridType>
1026- stencil (grid);
1027-
1028- typename GridType::ValueType val1 = interpolator.sampleVoxel (pos.x (), pos.y (), pos.z ());
1025+ openvdb::math::BoxStencil<const GridType> stencil (grid);
10291026
1027+ const ValueType val1 = interpolator.sampleVoxel (pos.x (), pos.y (), pos.z ());
10301028 stencil.moveTo (pos);
1031- typename GridType::ValueType val2 = stencil.interpolation (pos);
1032- EXPECT_EQ (val1, val2);
1029+ const ValueType val2 = stencil.interpolation (pos);
1030+ static const ValueType epsilon = openvdb::math::Delta<ValueType>::value ();
1031+ EXPECT_NEAR (val1, val2, epsilon);
10331032 }
10341033}
10351034TEST_F (TestLinearInterp, testStencilsMatchFloat) { testStencilsMatch<openvdb::FloatGrid>(); }
You can’t perform that action at this time.
0 commit comments