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/tgenprop.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/tgenprop.c')
-rw-r--r-- | test/tgenprop.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c index c91a05c..ba60cee 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -646,7 +646,11 @@ test_genprop_basic_list(void) VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); ret = H5Pget(lid1,PROP2_NAME,&prop2_value); CHECK_I(ret, "H5Pget"); - VERIFY(prop2_value, *PROP2_DEF_VALUE, "H5Pget"); + /* Verify the floating-poing value in this way to avoid compiler warning. */ + if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__); + /* Close list */ ret = H5Pclose(lid1); @@ -750,7 +754,11 @@ test_genprop_basic_list_prop(void) VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); ret = H5Pget(lid1,PROP2_NAME,&prop2_value); CHECK_I(ret, "H5Pget"); - VERIFY(prop2_value, *PROP2_DEF_VALUE, "H5Pget"); + /* Verify the floating-poing value in this way to avoid compiler warning. */ + if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__); + /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1,PROP3_NAME,&prop3_value); @@ -759,7 +767,10 @@ test_genprop_basic_list_prop(void) TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__); ret = H5Pget(lid1,PROP4_NAME,&prop4_value); CHECK_I(ret, "H5Pget"); - VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget"); + /* Verify the floating-poing value in this way to avoid compiler warning. */ + if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE)) + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Delete permanent property */ ret = H5Premove(lid1,PROP2_NAME); @@ -793,7 +804,10 @@ test_genprop_basic_list_prop(void) /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1,PROP4_NAME,&prop4_value); CHECK_I(ret, "H5Pget"); - VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget"); + /* Verify the floating-poing value in this way to avoid compiler warning. */ + if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE)) + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Close list */ ret = H5Pclose(lid1); @@ -1192,7 +1206,10 @@ test_genprop_list_callback(void) VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); ret = H5Pget(lid1,PROP2_NAME,&prop2_value); CHECK_I(ret, "H5Pget"); - VERIFY(prop2_value, *PROP2_DEF_VALUE, "H5Pget"); + /* Verify the floating-poing value in this way to avoid compiler warning. */ + if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1,PROP3_NAME,&prop3_value); @@ -1201,7 +1218,10 @@ test_genprop_list_callback(void) TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__); ret = H5Pget(lid1,PROP4_NAME,&prop4_value); CHECK_I(ret, "H5Pget"); - VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget"); + /* Verify the floating-poing value in this way to avoid compiler warning. */ + if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE)) + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Verify get callback information for properties tracked */ VERIFY(prop1_cb_info.get_count, 1, "H5Pget"); |