[svn-r17255] Fixed Bug 1563 - h5diff and Infinity

Added test cases.
This commit is contained in:
Peter Cao
2009-07-28 15:08:09 -05:00
parent 0e50d368cd
commit 3bbdfcd5f7
7 changed files with 45 additions and 8 deletions

View File

@@ -20,7 +20,6 @@
#include "h5tools.h"
#include <sys/timeb.h>
#include <time.h>
@@ -364,9 +363,9 @@ hsize_t diff_array( void *_mem1,
* H5T_COMPOUND
* Recursively call this function for each member
* H5T_ARRAY
* Recursively call this function for each element<EFBFBD>
* Recursively call this function for each element
* H5T_VLEN
* Recursively call this function for each element<EFBFBD>
* Recursively call this function for each element
* H5T_STRING
* compare byte by byte in a cycle from 0 to type_size. this type_size is the
* value obtained by the get_size function but it is the string lenght for
@@ -3056,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) )
@@ -5548,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
@@ -5609,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
@@ -5673,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