From 61af8db951144e0795165df6a198a6ba4bbafef3 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Wed, 29 Oct 2008 15:01:38 -0500 Subject: [svn-r15990] Merge with 1.8 rev 15967 regarding the return value of h5diff (0, no difference in files, 1 difference ) objects with the same name must be of the same type tested: linux --- tools/lib/h5diff.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 8876a24..60d97b0 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -450,10 +450,12 @@ hsize_t diff_match(hid_t file1_id, /*------------------------------------------------------------------------- - * the number of objects - * in file1 must be the same as in file2 + * regarding the return value of h5diff (0, no difference in files, 1 difference ) + * 1) the number of objects in file1 must be the same as in file2 + * 2) the graph must match, i.e same names (absolute path) + * 3) objects with the same name must be of the same type *------------------------------------------------------------------------- - */ + */ /* number of different objects */ if ( info1->nused != info2->nused ) @@ -461,7 +463,7 @@ hsize_t diff_match(hid_t file1_id, options->contents = 0; } - + /* objects in one file and not the other */ for( i = 0; i < table->nobjs; i++) { if( table->objs[i].flags[0] != table->objs[i].flags[1] ) @@ -470,6 +472,18 @@ hsize_t diff_match(hid_t file1_id, } } + /* objects with the same name but different HDF5 types */ + for( i = 0; i < table->nobjs; i++) + { + if ( table->objs[i].flags[0] && table->objs[i].flags[1] ) + { + if ( table->objs[i].type != table->objs[i].type ) + { + options->contents = 0; + } + } + } + /*------------------------------------------------------------------------- -- cgit v0.12