diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2012-09-11 23:19:53 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2012-09-11 23:19:53 (GMT) |
commit | 0c21f00cf8a1a6260fedff98d4b27c3afd21de47 (patch) | |
tree | 744e56c7717292687c89016515519eb0e8a8f5c2 /tools/lib | |
parent | 6810576bf21566b08956205bc957183b3a5c3d8d (diff) | |
download | hdf5-0c21f00cf8a1a6260fedff98d4b27c3afd21de47.zip hdf5-0c21f00cf8a1a6260fedff98d4b27c3afd21de47.tar.gz hdf5-0c21f00cf8a1a6260fedff98d4b27c3afd21de47.tar.bz2 |
[svn-r22753] Purpose:
HDFFV-5919 - GMQS: h5diff - The number of object difference is not consistent between dataset and group/type when attribute(s) have differences
Description:
Object differences are not consistent between dataset and group/datatype when their attribute(s) have differences. This is because attribute(s) differences is not accumulated to group or datatype object’s difference, but accumulated to dataset difference.
To fix, do not accumulate attribute difference to dataset difference. This is referred to h5diff’s default behavior and also past report from users that users were confused by the accumulated behavior. (also can’t figure out only for dataset difference , also hard to spot dataset difference when it has lots of attributes or differences)
This also lead to fix inconsistent format indicating difference between dataset and group/datatype object.
Merged from HDF5 trunk r22751.
Tested:
jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), cmake (jam)
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff.c | 22 | ||||
-rw-r--r-- | tools/lib/h5diff_dset.c | 7 |
2 files changed, 22 insertions, 7 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index c12b9da..9d73d2b 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1524,6 +1524,8 @@ hsize_t diff(hid_t file1_id, diff_opt_t * options, diff_args_t *argdata) { + hid_t dset1_id = (-1); + hid_t dset2_id = (-1); hid_t type1_id = (-1); hid_t type2_id = (-1); hid_t grp1_id = (-1); @@ -1689,6 +1691,10 @@ hsize_t diff(hid_t file1_id, *---------------------------------------------------------------------- */ case H5TRAV_TYPE_DATASET: + if((dset1_id = H5Dopen2(file1_id, path1, H5P_DEFAULT)) < 0) + goto out; + if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) + goto out; /* verbose (-v) and report (-r) mode */ if(options->m_verbose || options->m_report) { @@ -1712,6 +1718,22 @@ hsize_t diff(hid_t file1_id, print_found(nfound); } } + + + /*--------------------------------------------------------- + * compare attributes + * if condition refers to cases when the dataset is a + * referenced object + *--------------------------------------------------------- + */ + if(path1) + nfound += diff_attr(dset1_id, dset2_id, path1, path2, options); + + + if(H5Dclose(dset1_id) < 0) + goto out; + if(H5Dclose(dset2_id) < 0) + goto out; break; /*---------------------------------------------------------------------- diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index a08f0be..aea2192 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -499,13 +499,6 @@ hsize_t diff_datasetid( hid_t did1, } /* hyperslab read */ } /*can_compare*/ - /*------------------------------------------------------------------------- - * compare attributes - * the if condition refers to cases when the dataset is a referenced object - *------------------------------------------------------------------------- - */ - if(obj1_name) - nfound += diff_attr(did1,did2,obj1_name,obj2_name,options); /*------------------------------------------------------------------------- * close |