diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-12 15:52:52 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-12 15:52:52 (GMT) |
commit | 3015df0a5b02dee38264b191997c1949596c2c95 (patch) | |
tree | 6e26bbe1228af8a0ed8eea213f99989956350981 /test/tarray.c | |
parent | 8d91f0643b411da90476e2ac4fabca32b3045845 (diff) | |
download | hdf5-3015df0a5b02dee38264b191997c1949596c2c95.zip hdf5-3015df0a5b02dee38264b191997c1949596c2c95.tar.gz hdf5-3015df0a5b02dee38264b191997c1949596c2c95.tar.bz2 |
[svn-r13501] Suppress the compiler warning about the equality comparison of floating-point values.
Diffstat (limited to 'test/tarray.c')
-rw-r--r-- | test/tarray.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/tarray.c b/test/tarray.c index 2664f7e..8c7e6c8 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -703,7 +703,7 @@ test_array_compound_atomic(void) TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n",(int)i,(int)j,(int)wdata[i][j].i,(int)i,(int)j,(int)rdata[i][j].i); continue; } /* end if */ - if(wdata[i][j].f!=rdata[i][j].f) { + if(!FLT_ABS_EQUAL(wdata[i][j].f, rdata[i][j].f)) { TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f=%f, rdata[%d][%d].f=%f\n",(int)i,(int)j,wdata[i][j].f,(int)i,(int)j,rdata[i][j].f); continue; } /* end if */ @@ -948,7 +948,7 @@ test_array_compound_array(void) continue; } /* end if */ for(k=0; k<ARRAY1_DIM1; k++) - if(wdata[i][j].f[k]!=rdata[i][j].f[k]) { + if(!FLT_ABS_EQUAL(wdata[i][j].f[k],rdata[i][j].f[k])) { TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f[%d]=%f, rdata[%d][%d].f[%d]=%f\n",(int)i,(int)j,(int)k,wdata[i][j].f[k],(int)i,(int)j,(int)k,rdata[i][j].f[k]); continue; } /* end if */ @@ -1638,11 +1638,11 @@ test_array_bkg(void) TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]); continue; } - if(cf[i].b[j]!=cfr[i].b[j]) { + if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) { TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].b[j],(int)i,(int)j,(float)cfr[i].b[j]); continue; } - if(cf[i].c[j]!=cfr[i].c[j]) { + if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) { TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].c[j],(int)i,(int)j,(float)cfr[i].c[j]); continue; } @@ -1705,7 +1705,7 @@ test_array_bkg(void) for (i=0; i< LENGTH; i++) for (j = 0; j < ALEN; j++) - if(fld[i].b[j]!=fldr[i].b[j]) { + if(!FLT_ABS_EQUAL(fld[i].b[j],fldr[i].b[j])) { TestErrPrintf("Field data doesn't match, fld[%d].b[%d]=%f, fldr[%d].b[%d]=%f\n",(int)i,(int)j,(float)fld[i].b[j],(int)i,(int)j,(float)fldr[i].b[j]); continue; } @@ -1731,11 +1731,11 @@ test_array_bkg(void) TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]); continue; } - if(cf[i].b[j]!=cfr[i].b[j]) { + if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) { TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].b[j],(int)i,(int)j,(float)cfr[i].b[j]); continue; } - if(cf[i].c[j]!=cfr[i].c[j]) { + if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) { TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].c[j],(int)i,(int)j,(float)cfr[i].c[j]); continue; } @@ -1780,11 +1780,11 @@ test_array_bkg(void) TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]); continue; } - if(cf[i].b[j]!=cfr[i].b[j]) { + if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) { TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].b[j],(int)i,(int)j,(float)cfr[i].b[j]); continue; } - if(cf[i].c[j]!=cfr[i].c[j]) { + if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) { TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].c[j],(int)i,(int)j,(float)cfr[i].c[j]); continue; } |