summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
authorPeter Cao <xcao@hdfgroup.org>2009-07-28 19:40:18 (GMT)
committerPeter Cao <xcao@hdfgroup.org>2009-07-28 19:40:18 (GMT)
commita6676de3c8cf07ef5a2e8f6d9b8f6bf4f3e779d3 (patch)
tree0ff6e6745ac32b88cb280a15d77dd671833b9f1b /tools/lib/h5diff_array.c
parentc9b33f6dd48024708989753fecf6ee8e849a5542 (diff)
downloadhdf5-a6676de3c8cf07ef5a2e8f6d9b8f6bf4f3e779d3.zip
hdf5-a6676de3c8cf07ef5a2e8f6d9b8f6bf4f3e779d3.tar.gz
hdf5-a6676de3c8cf07ef5a2e8f6d9b8f6bf4f3e779d3.tar.bz2
[svn-r17254] Fixed Bug 1563 - h5diff and Infinity
Added test cases
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r--tools/lib/h5diff_array.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 5d026ea..735ea70 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -3055,15 +3055,11 @@ hsize_t diff_float(unsigned char *mem1,
*/
else
{
-
-
-
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_float, mem1, sizeof(float));
memcpy(&temp2_float, mem2, sizeof(float));
-
if (equal_float(temp1_float,temp2_float,options)==FALSE)
{
if ( print_data(options) )
@@ -5547,6 +5543,9 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options)
if (is_zero)
return(equal_double(expected,value,options));
+ if (value == expected)
+ return TRUE;
+
if ( ABS( (value-expected) / expected) < H5DIFF_DBL_EPSILON)
return TRUE;
else
@@ -5608,6 +5607,9 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio
if (is_zero)
return(equal_ldouble(expected,value,options));
+ if (value == expected)
+ return TRUE;
+
if ( ABS( (value-expected) / expected) < H5DIFF_DBL_EPSILON)
return TRUE;
else
@@ -5672,6 +5674,9 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options)
if (is_zero)
return(equal_float(expected,value,options));
+ if (value == expected)
+ return TRUE;
+
if ( ABS( (value-expected) / expected) < H5DIFF_FLT_EPSILON)
return TRUE;
else
@@ -6024,4 +6029,4 @@ static void h5diff_print_char(char ch)
break;
}
-} \ No newline at end of file
+}