summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2005-06-30 20:57:01 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2005-06-30 20:57:01 (GMT)
commitc3252ef1f2ac06e12fe91e9e7e1591f22c4819f4 (patch)
tree6820fc55746f795aacb6721607b7bdd5987dd983 /tools/lib
parente6589b04f0a4312ddabae2551b972d6bb073632e (diff)
downloadhdf5-c3252ef1f2ac06e12fe91e9e7e1591f22c4819f4.zip
hdf5-c3252ef1f2ac06e12fe91e9e7e1591f22c4819f4.tar.gz
hdf5-c3252ef1f2ac06e12fe91e9e7e1591f22c4819f4.tar.bz2
[svn-r11005] Purpose:
bug fix Description: the numbers of differences was not printed for each object Solution: print it Platforms tested: linux solaris aix Misc. update:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c79
1 files changed, 50 insertions, 29 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 16e5af7..1529730 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -855,41 +855,54 @@ diff (hid_t file1_id,
* H5G_DATASET
*-------------------------------------------------------------------------
*/
- case H5G_DATASET:
+ case H5G_DATASET:
- /* always print name */
+ /*-------------------------------------------------------------------------
+ * verbose, always print name
+ *-------------------------------------------------------------------------
+ */
if (options->m_verbose)
{
- if (print_objname (options, (hsize_t)1))
- parallel_print("Dataset: <%s> and <%s>\n", path1, path2);
- nfound = diff_dataset (file1_id, file2_id, path1, path2, options);
-
+ if (print_objname (options, (hsize_t)1))
+ parallel_print("Dataset: <%s> and <%s>\n", path1, path2);
+ nfound = diff_dataset (file1_id, file2_id, path1, path2, options);
+ /* always print the number of differences found */
+ print_found(nfound);
}
- /* check first if we have differences */
+ /*-------------------------------------------------------------------------
+ * non verbose, check first if we have differences
+ *-------------------------------------------------------------------------
+ */
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 (options->m_quiet == 0)
{
- if (print_objname (options, nfound))
- parallel_print("Dataset: <%s> and <%s>\n", path1, path2);
- nfound = diff_dataset (file1_id, file2_id, path1, path2, options);
- } /*if */
- } /*if */
- /* in quiet mode, just count differences */
- else
- {
- nfound = diff_dataset (file1_id, file2_id, path1, path2, options);
- }
- } /*else */
+ /* 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))
+ parallel_print("Dataset: <%s> and <%s>\n", path1, path2);
+ nfound = diff_dataset (file1_id, file2_id, path1, path2, options);
+ /* print the number of differences found only when found
+ this is valid for the default mode and report mode */
+ print_found(nfound);
+ } /*if nfound */
+ } /*if quiet */
+ /*-------------------------------------------------------------------------
+ * quiet mode, just count differences
+ *-------------------------------------------------------------------------
+ */
+ else
+ {
+ nfound = diff_dataset (file1_id, file2_id, path1, path2, options);
+ }
+ } /*else verbose */
+
break;
/*-------------------------------------------------------------------------
@@ -909,7 +922,11 @@ diff (hid_t file1_id,
nfound = (ret > 0) ? 0 : 1;
if (print_objname (options, nfound))
- parallel_print("Datatype: <%s> and <%s>\n", path1, path2);
+ parallel_print("Datatype: <%s> and <%s>\n", path1, path2);
+
+ /* always print the number of differences found in verbose mode */
+ if (options->m_verbose)
+ print_found(nfound);
/*-------------------------------------------------------------------------
* compare attributes
@@ -942,7 +959,11 @@ diff (hid_t file1_id,
nfound = (ret != 0) ? 1 : 0;
if (print_objname (options, nfound))
- parallel_print("Group: <%s> and <%s>\n", path1, path2);
+ parallel_print("Group: <%s> and <%s>\n", path1, path2);
+
+ /* always print the number of differences found in verbose mode */
+ if (options->m_verbose)
+ print_found(nfound);
/*-------------------------------------------------------------------------
* compare attributes