summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diffgentest.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-03-31 21:43:46 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-03-31 21:43:46 (GMT)
commit553e452ce4f49a81d41a06b8eb8072bd47d30c59 (patch)
tree18fc63ff0d098ee4cfee23628cff326560927a9c /tools/h5diff/h5diffgentest.c
parentd03182a94e4e40fd9a14be55d5701c14ae85ec38 (diff)
downloadhdf5-553e452ce4f49a81d41a06b8eb8072bd47d30c59.zip
hdf5-553e452ce4f49a81d41a06b8eb8072bd47d30c59.tar.gz
hdf5-553e452ce4f49a81d41a06b8eb8072bd47d30c59.tar.bz2
[svn-r20384] Purpose:
Fixed Bug 2184 - GMQS: h5diff - incorrect calculation code for --use-system-epsilon option Description: Merged from HDF5 1.8 branch r20369. Fixed h5diff for --use-system-epsilon option: the calculation changed from ( |a - b| / b ) to ( |a - b| ). This was decided for better performance and was corrected only in HDF5 trunk, so 1.8 got updated. Also comments for equal_XXX() function were updated correctly. Also help page and RM got updated correctly. Also add test cases for testing the differences w/wo the option. Tested: jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE)
Diffstat (limited to 'tools/h5diff/h5diffgentest.c')
-rw-r--r--tools/h5diff/h5diffgentest.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index dcfe76a..66f1ce8 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -312,11 +312,16 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
*-------------------------------------------------------------------------
*/
{
- /* epsilon = 0.00001 */
- float data11[3][2] ={{0.00000f,0.00001f},{0.00001f, 0.00000f},{0.00001f,0.00001f}};
- float data12[3][2] ={{0.00000f,0.00002f},{0.000009f,0.00001f},{0.00000f,0.00001f}};
- double data13[3][2] ={{0.000000000,0.000000001},{0.000000001, 0.000000000},{0.000000001,0.000000001}};
- double data14[3][2] ={{0.000000000,0.000000002},{0.0000000009,0.000000001},{0.000000000,0.000000001}};
+ /* epsilon = 0.0000001 = 1e-7
+ * system epsilon for float : FLT_EPSILON = 1.19209E-07
+ */
+ float data11[3][2] ={{0.000000f,0.0000001f},{0.0000001f, 0.00000022f},{0.0000001f,0.0000001f}};
+ float data12[3][2] ={{0.000000f,0.0000002f},{0.0000003f,0.0000001f},{0.000000f,0.0000001f}};
+ /* epsilon = 0.0000000000000001 = 1e-16
+ * system epsilon for double : DBL_EPSILON = 2.22045E-16
+ */
+ double data13[3][2] ={{0.0000000000000000, 0.0000000000000001},{0.0000000000000001, 0.0000000000000000},{0.00000000000000033, 0.0000000000000001}};
+ double data14[3][2] ={{0.0000000000000000, 0.0000000000000004},{0.0000000000000002, 0.0000000000000001},{0.0000000000000001, 0.00000000000000000}};
write_dset(gid1,2,dims2,"fp1",H5T_NATIVE_FLOAT,data11);
write_dset(gid1,2,dims2,"fp2",H5T_NATIVE_FLOAT,data12);