Skip to content

Commit 9e5d3e1

Browse files
committed
COMP: Accept both vnl_math::sqrteps values in the parity test
The VNL deprecation-campaign pin fixes vnl_math::sqrteps to the exact 2^-26; the prior pin rounds 1 ULP above. Accept either so the test passes on both sides of the VNL update.
1 parent 412fe46 commit 9e5d3e1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/Core/Common/test/itkMathVnlParityGTest.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ TEST(itkMathVnlParity, Constants)
234234
EXPECT_EQ(itk::Math::eps, vnl_math::eps);
235235
EXPECT_EQ(itk::Math::float_eps, vnl_math::float_eps);
236236
EXPECT_EQ(itk::Math::float_sqrteps, vnl_math::float_sqrteps);
237-
// Intentional 1 ULP divergence: itk::Math::sqrteps is the exact sqrt(eps) = 2^-26,
238-
// vnl_math::sqrteps rounds 1 ULP above it (see the ITKv6 migration guide).
239-
EXPECT_EQ(std::nextafter(itk::Math::sqrteps, 1.0), vnl_math::sqrteps);
237+
// itk::Math::sqrteps is the exact sqrt(eps) = 2^-26; vnl_math::sqrteps rounds
238+
// 1 ULP above it before the VNL deprecation-campaign pin and matches exactly after.
239+
EXPECT_TRUE(vnl_math::sqrteps == itk::Math::sqrteps || vnl_math::sqrteps == std::nextafter(itk::Math::sqrteps, 1.0))
240+
<< "vnl_math::sqrteps=" << vnl_math::sqrteps;
240241
}

0 commit comments

Comments
 (0)