DREAM3D
DREAM3D copied to clipboard
DREAM3D_COMPARE_FLOATS fails near zero
the AlmostEqualUlpsFinal function (called bye the DREAM3D_COMPARE_FLOATS macro) has trouble comparing small values to zero. For example comparing 0.0f to 9.66105 * 10^-18 fails even when the tolerance is set extremely high e.g. 0xFFFFFFFF.
AlmostEqualUlpsFinal takes pointers but DREAM3D_COMPARE_FLOATS looks like it was originally configured to take values so if the test fails it prints addresses instead of values. Pointers also make use of the macro a bit clunky when comparing to a constant (e.g. DREAM3D_COMPARE_FLOATS(value, 1.0f, 100) isn't valid)
It turns out the Bruce Dawson recognized the same issue and has an updated version of the code . Since it is only currently used in 1 place (that isn't in the current build) I can update the code based on his new version if that is an acceptable solution.
http://my.cdash.org/buildSummary.php?buildid=829027
The builds are now failing for OS X and LINUX.
The updated DataFusion tests were written with this pull request implemented and will build correctly when it is merged (I didn't realize it was part of the nightly, sorry). In the interim I can switch them back so they build but the tests fail, just let me know.