summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-09-21 15:20:20 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-09-21 15:20:20 (GMT)
commit8f8fb620d8bc42519871d47ab55c2dc2f7a13db3 (patch)
treef1765f5a6dd7f743e6fdcf1c2a2d09ce29e030c1 /tools/lib
parente50e2a5974a5ca8c635128b2ea85f0405b0e79a4 (diff)
downloadhdf5-8f8fb620d8bc42519871d47ab55c2dc2f7a13db3.zip
hdf5-8f8fb620d8bc42519871d47ab55c2dc2f7a13db3.tar.gz
hdf5-8f8fb620d8bc42519871d47ab55c2dc2f7a13db3.tar.bz2
[svn-r21404] Purpose:
HDFFV-7693 - h5diff produces different behavior between versions: 1.8.3 and 1.8.6 Description: There were two issues on this. One was not displaying all the comparable objects if non-comparable object/attribute exist and compared before comparables ones. This issue occurred after 1.8.4 release. This is the issue from user. The other issue was not displaying all the comparable attributes, if non-comparable object/attribute exist and compared ahead. This issue were exist even before 1.8.4 release. So it's possible some attribute comparison may have not displayed correctly in the past, if non-comparable data were exist in common object. Fixed h5diff to display all the comparable object and attribute regardless of non-comparables. Merged from HDF5 trunk r21396 and r21397. Tested: jam (linux32-LE), koala (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Cmake (jam, Windows)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c4
-rw-r--r--tools/lib/h5diff_attr.c9
-rw-r--r--tools/lib/h5diff_dset.c36
3 files changed, 25 insertions, 24 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index bbf9b39..6e9fee8 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -1952,8 +1952,8 @@ hsize_t diff(hid_t file1_id,
else
{
nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
- /* print info if compatible and difference found */
- if (!options->not_cmp && nfound)
+ /* print info if difference found */
+ if (nfound)
{
do_print_objname("dataset", path1, path2, options);
print_found(nfound);
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index e5c5965..d9132e9 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -380,9 +380,8 @@ hsize_t diff_attr(hid_t loc1_id,
*----------------------------------------------------------------------
*/
- if(msize1 != msize2 ||
- diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1,
- dims2, NULL, NULL, name1, name2, options, 0) != 1)
+ if( diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2,
+ NULL, NULL, name1, name2, options, 0) != 1 )
{
if(H5Tclose(ftype1_id) < 0)
goto error;
@@ -452,8 +451,8 @@ hsize_t diff_attr(hid_t loc1_id,
nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1,
options, np1, np2, mtype1_id, attr1_id, attr2_id);
- /* not comparable, no display the different number */
- if(!options->not_cmp && nfound) {
+ /* print info if compatible and difference found */
+ if(nfound) {
do_print_attrname("attribute", np1, np2);
print_found(nfound);
} /* end if */
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index c26c766..03ec067 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -313,19 +313,21 @@ hsize_t diff_datasetid( hid_t did1,
* check for different signed/unsigned types
*-------------------------------------------------------------------------
*/
-
- sign1=H5Tget_sign(m_tid1);
- sign2=H5Tget_sign(m_tid2);
- if ( sign1 != sign2 )
+ if (can_compare)
{
- if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name)
+ sign1=H5Tget_sign(m_tid1);
+ sign2=H5Tget_sign(m_tid2);
+ if ( sign1 != sign2 )
{
- parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1));
- parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
+ if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name)
+ {
+ parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1));
+ parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
+ }
+
+ can_compare=0;
+ options->not_cmp=1;
}
-
- can_compare=0;
- options->not_cmp=1;
}
/* Check if type is either VLEN-data or VLEN-string to reclaim any
@@ -333,16 +335,16 @@ hsize_t diff_datasetid( hid_t did1,
if( TRUE == h5tools_detect_vlen(m_tid1) )
vl_data = TRUE;
- /*-------------------------------------------------------------------------
+ /*------------------------------------------------------------------------
* only attempt to compare if possible
*-------------------------------------------------------------------------
*/
if(can_compare) /* it is possible to compare */
{
- /*-------------------------------------------------------------------------
+ /*-----------------------------------------------------------------
* get number of elements
- *-------------------------------------------------------------------------
+ *------------------------------------------------------------------
*/
nelmts1 = 1;
for(i = 0; i < rank1; i++)
@@ -354,9 +356,9 @@ hsize_t diff_datasetid( hid_t did1,
HDassert(nelmts1 == nelmts2);
- /*-------------------------------------------------------------------------
+ /*-----------------------------------------------------------------
* "upgrade" the smaller memory size
- *-------------------------------------------------------------------------
+ *------------------------------------------------------------------
*/
if(m_size1 != m_size2) {
@@ -386,9 +388,9 @@ hsize_t diff_datasetid( hid_t did1,
name2 = diff_basename(obj2_name);
- /*-------------------------------------------------------------------------
+ /*----------------------------------------------------------------
* read/compare
- *-------------------------------------------------------------------------
+ *-----------------------------------------------------------------
*/
need = (size_t)(nelmts1 * m_size1); /* bytes needed */
if(need < H5TOOLS_MALLOCSIZE) {