diff options
Diffstat (limited to 'tools/lib/h5diff.c')
-rw-r--r-- | tools/lib/h5diff.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index a326916..10c8cb0 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -207,6 +207,14 @@ out: * * Date: May 9, 2003 * + * Modifications: + * + * Aug 2008 + * Added a "contents" mode check. + * If this mode is present, objects in both files must match (must be exactly the same) + * If this does not happen, the tool returns an error code of 1 + * (instead of the success code of 0) + * *------------------------------------------------------------------------- */ hsize_t diff_match(hid_t file1_id, @@ -302,6 +310,34 @@ hsize_t diff_match(hid_t file1_id, } /* end for */ printf ("\n"); } /* end if */ + + /*------------------------------------------------------------------------- + * contents mode. we do an "absolute" compare criteria, the number of objects + * in file1 must be the same as in file2 + *------------------------------------------------------------------------- + */ + if ( options->m_contents ) + { + /* assume equal contents initially */ + options->contents = 1; + + /* number of different objects */ + if ( nobjects1 != nobjects2 ) + { + options->contents = 0; + } + + + for( i = 0; i < table->nobjs; i++) + { + if( table->objs[i].flags[0] != table->objs[i].flags[1] ) + { + options->contents = 0; + } + } + + } + /*------------------------------------------------------------------------- |