summaryrefslogtreecommitdiffstats
path: root/test/hyperslab.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2007-02-05 19:22:26 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2007-02-05 19:22:26 (GMT)
commita82e85c2d408386b14859f40c572a3911aaaa682 (patch)
tree3d41a800b047a185814eed5dde195bffdd15b947 /test/hyperslab.c
parent08ea58bac21f32f091045b28bccee27d95d0effe (diff)
downloadhdf5-a82e85c2d408386b14859f40c572a3911aaaa682.zip
hdf5-a82e85c2d408386b14859f40c572a3911aaaa682.tar.gz
hdf5-a82e85c2d408386b14859f40c572a3911aaaa682.tar.bz2
[svn-r13238] A trial fix for the comparison of equality between floating-point values in hyperslab.c. A few
macros are defined in h5test.h to check if the difference between two values is smaller than Epsilon.
Diffstat (limited to 'test/hyperslab.c')
-rw-r--r--test/hyperslab.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 0a46faf..16bd1bb 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -663,7 +663,11 @@ test_multifill(size_t nx)
for (i = 0; i < nx; i++) {
if (dst[i].left != 3333333) {
sprintf(s, "bad dst[%lu].left", (unsigned long)i);
- } else if (dst[i].mid != fill.mid) {
+ } else if (!DBL_ABS_EQUAL(dst[i].mid, fill.mid)) {
+ /* Check if two DOUBLE values are equal. If their difference
+ * is smaller than the EPSILON value for double, they are
+ * considered equal. See the definition in h5test.h.
+ */
sprintf(s, "bad dst[%lu].mid", (unsigned long)i);
} else if (dst[i].right != 4444444) {
sprintf(s, "bad dst[%lu].right", (unsigned long)i);