summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/Makefile.in8
-rw-r--r--tools/h5dump/h5dump.c61
-rw-r--r--tools/h5dump/testh5dump.sh.in13
-rwxr-xr-xtools/h5dump/testh5dumpxml.sh.in14
4 files changed, 53 insertions, 43 deletions
diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in
index 8ca6684..1791da5 100644
--- a/tools/h5dump/Makefile.in
+++ b/tools/h5dump/Makefile.in
@@ -327,12 +327,12 @@ CP = cp
# Some machines need a command to run executables; this is that command
# so that our tests will run.
-# We use RUNTESTS instead of RUNSERIAL directly because it may be that
+# We use RUNEXEC instead of RUNSERIAL directly because it may be that
# some tests need to be run with a different command. Older versions
# of the makefiles used the command
# $(LIBTOOL) --mode=execute
# in some directories, for instance.
-RUNTESTS = $(RUNSERIAL)
+RUNEXEC = $(RUNSERIAL)
# Libraries to link to while building
LIBHDF5 = $(top_builddir)/src/libhdf5.la
@@ -851,7 +851,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
fi; \
echo "============================" >> $${log}; \
srcdir="$(srcdir)" \
- $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
&& touch $(@:.chkexe_=.chkexe) || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
(cat $${log} && false) || exit 1; \
@@ -922,7 +922,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS)
@for test in $(TEST_PROG_PARA) dummy; do \
if test $$test != dummy; then \
$(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
- RUNTESTS="$(RUNPARALLEL)" || exit 1; \
+ RUNEXEC="$(RUNPARALLEL)" || exit 1; \
fi; \
done
@for test in $(TEST_SCRIPT_PARA) dummy; do \
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index abe97ea..0f25efe 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -2707,14 +2707,13 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
H5D_fill_time_t ft;
hsize_t storage_size;
haddr_t ioffset;
- int i, next;
+ int i;
unsigned j;
- storage_size=H5Dget_storage_size(obj_id);
+ storage_size = H5Dget_storage_size(obj_id);
nfilters = H5Pget_nfilters(dcpl_id);
- ioffset=H5Dget_offset(obj_id);
- next=H5Pget_external_count(dcpl_id);
- strcpy(f_name,"\0");
+ ioffset = H5Dget_offset(obj_id);
+ HDstrcpy(f_name,"\0");
/*-------------------------------------------------------------------------
* STORAGE_LAYOUT
@@ -2819,6 +2818,10 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
printf("%s\n",END);
}
else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) {
+ int next;
+
+ next = H5Pget_external_count(dcpl_id);
+
/*-------------------------------------------------------------------------
* EXTERNAL_FILE
*-------------------------------------------------------------------------
@@ -4531,8 +4534,7 @@ print_enum(hid_t type)
size_t dst_size; /*destination value type size */
unsigned i;
- nmembs = H5Tget_nmembers(type);
- assert(nmembs>0);
+ nmembs = (unsigned)H5Tget_nmembers(type);
super = H5Tget_super(type);
/*
@@ -4542,17 +4544,16 @@ print_enum(hid_t type)
* 2. unsigned long long -- the largest native unsigned integer
* 3. raw format
*/
- if (H5Tget_size(type) <= sizeof(long long)) {
- dst_size = sizeof(long long);
+ if(H5Tget_size(type) <= sizeof(long long)) {
+ dst_size = sizeof(long long);
- if (H5T_SGN_NONE == H5Tget_sign(type)) {
- native = H5T_NATIVE_ULLONG;
- } else {
- native = H5T_NATIVE_LLONG;
- }
- } else {
- dst_size = H5Tget_size(type);
- }
+ if(H5T_SGN_NONE == H5Tget_sign(type))
+ native = H5T_NATIVE_ULLONG;
+ else
+ native = H5T_NATIVE_LLONG;
+ } /* end if */
+ else
+ dst_size = H5Tget_size(type);
/* Get the names and raw values of all members */
name = calloc(nmembs, sizeof(char *));
@@ -5838,19 +5839,19 @@ xml_dump_group(hid_t gid, const char *name)
t_objname, parentxid, par_name);
free(t_objname);
free(par_name);
- }
- indentation(indent + COL);
- t_objname = xml_escape_the_name(found_obj->objname);/* point to the NDT by name */
- par_name = xml_escape_the_name(par);
- xml_name_to_XID(found_obj->objname, ptrstr, 100, 1);
- xml_name_to_XID(par, parentxid, 100, 1);
- printf("<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" "
- "Parents=\"%s\" H5ParentPaths=\"%s\" />\n",
- xmlnsprefix,
- ptrstr, t_objname, parentxid, par_name);
- free(t_objname);
- free(par_name);
+ indentation(indent + COL);
+ t_objname = xml_escape_the_name(found_obj->objname);/* point to the NDT by name */
+ par_name = xml_escape_the_name(par);
+ xml_name_to_XID(found_obj->objname, ptrstr, 100, 1);
+ xml_name_to_XID(par, parentxid, 100, 1);
+ printf("<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" "
+ "Parents=\"%s\" H5ParentPaths=\"%s\" />\n",
+ xmlnsprefix,
+ ptrstr, t_objname, parentxid, par_name);
+ free(t_objname);
+ free(par_name);
+ }
free(ptrstr);
} else {
@@ -6712,7 +6713,7 @@ xml_print_enum(hid_t type)
unsigned i; /*miscellaneous counters */
size_t j;
- nmembs = H5Tget_nmembers(type);
+ nmembs = (unsigned)H5Tget_nmembers(type);
super = H5Tget_super(type);
indentation(indent);
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 84274cf..55434ab 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -23,6 +23,10 @@ USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@"
USE_FILTER_NBIT="@USE_FILTER_NBIT@"
USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@"
+TESTNAME=h5dump
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
DUMPER=h5dump # The tool name
DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
TESTDIR=`pwd`/../testfiles
@@ -512,8 +516,9 @@ TOOLTEST textlinkfar.ddl textlinkfar.h5
TOOLTEST tdset_idx.ddl -p -H tdset_idx.h5
if test $nerrors -eq 0 ; then
- echo "All $DUMPER tests passed."
+ echo "All $TESTNAME tests passed."
+ exit $EXIT_SUCCESS
+else
+ echo "$TESTNAME tests failed with $nerrors errors."
+ exit $EXIT_FAILURE
fi
-
-exit $nerrors
-
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index 3e81a05..c4c8657 100755
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -15,6 +15,10 @@
#
# Tests for the h5dump tool
+TESTNAME=h5dumpxml
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
H5_LONE_COLON="@H5_LONE_COLON@"
DUMPER=h5dump # The tool name
@@ -185,10 +189,10 @@ TOOLTEST torderattr3.h5.xml --xml -H --sort_by=creation_order --sort_order=ascen
TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=descending torderattr.h5
-
-
if test $nerrors -eq 0 ; then
- echo "All $DUMPER tests passed."
+ echo "All $TESTNAME tests passed."
+ exit $EXIT_SUCCESS
+else
+ echo "$TESTNAME tests failed with $nerrors errors."
+ exit $EXIT_FAILURE
fi
-
-exit $nerrors