summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-01 18:34:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-01 18:34:23 (GMT)
commita4750dfae7e187f95c4515939968e6fce880efed (patch)
tree0fc33c6dda70c952d83759c937ff3bf9499aaa86 /tools/lib
parentdfd01b8331fd3173c396c1ec3e6523db8a8adb9e (diff)
downloadhdf5-a4750dfae7e187f95c4515939968e6fce880efed.zip
hdf5-a4750dfae7e187f95c4515939968e6fce880efed.tar.gz
hdf5-a4750dfae7e187f95c4515939968e6fce880efed.tar.bz2
[svn-r17946] Description:
Bring r17899:17945 from trunk to revise_chunks branch Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c50
-rw-r--r--tools/lib/h5diff_attr.c110
2 files changed, 62 insertions, 98 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 5a4e2f2..7d11f2f 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -916,45 +916,27 @@ hsize_t diff(hid_t file1_id,
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_DATASET:
- /*-------------------------------------------------------------------------
- * verbose, always print name
- *-------------------------------------------------------------------------
- */
- if(options->m_verbose)
+ /* verbose (-v) and report (-r) mode */
+ if(options->m_verbose || options->m_report)
{
- if(print_objname(options, (hsize_t)1))
- do_print_objname("dataset", path1, path2);
+ do_print_objname("dataset", path1, path2);
nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
print_found(nfound);
- } /* end if */
- /*-------------------------------------------------------------------------
- * non verbose, check first if we have differences by enabling quiet mode
- * so that printing is off, and compare again if differences found,
- * disabling quiet mode
- *-------------------------------------------------------------------------
- */
+ }
+ /* quiet mode (-q), just count differences */
+ else if(options->m_quiet)
+ {
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ }
+ /* the rest (-c, none, ...) */
else
{
- if(options->m_quiet == 0)
- {
- /* shut up temporarily */
- options->m_quiet = 1;
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
-
- /* print again */
- options->m_quiet = 0;
- if(nfound)
- {
- if(print_objname(options,nfound))
- do_print_objname("dataset", path1, path2);
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
- print_found(nfound);
- } /* end if */
- } /* end if */
- /* in quiet mode, just count differences */
- else
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
- } /* end else */
+ do_print_objname("dataset", path1, path2);
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ /* not comparable, no display the different number */
+ if (!options->not_cmp)
+ print_found(nfound);
+ }
break;
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 69bd44c..73a7ee7 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -130,9 +130,9 @@ hsize_t diff_attr(hid_t loc1_id,
goto error;
- /*-------------------------------------------------------------------------
+ /*----------------------------------------------------------------------
* check for comparable TYPE and SPACE
- *-------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
if ( msize1 != msize2
@@ -175,9 +175,9 @@ hsize_t diff_attr(hid_t loc1_id,
}
- /*-------------------------------------------------------------------------
+ /*---------------------------------------------------------------------
* read
- *-------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
nelmts1=1;
for (j=0; j<rank1; j++)
@@ -198,13 +198,14 @@ hsize_t diff_attr(hid_t loc1_id,
sprintf(np1,"%s of <%s>",name1,path1);
sprintf(np2,"%s of <%s>",name2,path2);
- /*-------------------------------------------------------------------------
+ /*---------------------------------------------------------------------
* array compare
- *-------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
/* always print name */
- if (options->m_verbose)
+ /* verbose (-v) and report (-r) mode */
+ if(options->m_verbose || options->m_report)
{
do_print_objname ("attribute", np1, np2);
nfound = diff_array(buf1,
@@ -222,67 +223,48 @@ hsize_t diff_attr(hid_t loc1_id,
print_found(nfound);
}
- /* check first if we have differences */
+ /* quiet mode (-q), just count differences */
+ else if(options->m_quiet)
+ {
+ nfound = diff_array(buf1,
+ buf2,
+ nelmts1,
+ (hsize_t)0,
+ rank1,
+ dims1,
+ options,
+ np1,
+ np2,
+ mtype1_id,
+ attr1_id,
+ attr2_id);
+ }
+ /* the rest (-c, none, ...) */
else
{
- if (options->m_quiet==0)
- {
- /* shut up temporarily */
- options->m_quiet=1;
- nfound = diff_array(buf1,
- buf2,
- nelmts1,
- (hsize_t)0,
- rank1,
- dims1,
- options,
- np1,
- np2,
- mtype1_id,
- attr1_id,
- attr2_id);
- /* print again */
- options->m_quiet=0;
- if (nfound)
- {
- do_print_objname ("attribute", np1, np2);
- nfound = diff_array(buf1,
- buf2,
- nelmts1,
- (hsize_t)0,
- rank1,
- dims1,
- options,
- np1,
- np2,
- mtype1_id,
- attr1_id,
- attr2_id);
+ do_print_objname ("attribute", np1, np2);
+ 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)
print_found(nfound);
- } /*if*/
- } /*if*/
- /* in quiet mode, just count differences */
- else
- {
- nfound = diff_array(buf1,
- buf2,
- nelmts1,
- (hsize_t)0,
- rank1,
- dims1,
- options,
- np1,
- np2,
- mtype1_id,
- attr1_id,
- attr2_id);
- } /*else quiet */
- } /*else verbose */
-
-
- /*-------------------------------------------------------------------------
+ }
+
+
+ /*----------------------------------------------------------------------
* close
- *-------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
if (H5Tclose(ftype1_id)<0)