summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-03-19 14:26:04 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-03-19 14:26:04 (GMT)
commit19206f5687a4366f077ae47ae8e206f4a972144f (patch)
tree1022864b6b9015dcb035f33775d3fb0da24cddf2 /tools
parentb1a2c642a7105d808f884a27111236dd77df3ce0 (diff)
downloadhdf5-19206f5687a4366f077ae47ae8e206f4a972144f.zip
hdf5-19206f5687a4366f077ae47ae8e206f4a972144f.tar.gz
hdf5-19206f5687a4366f077ae47ae8e206f4a972144f.tar.bz2
[svn-r22088] HDFFV-7957(7958): Correct use of ERROR_STACK for h5dump and tools.
Tested: local linux after week in trunk
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/CMakeLists.txt14
-rw-r--r--tools/h5dump/h5dump.c266
-rw-r--r--tools/h5dump/testh5dump.sh.in9
-rwxr-xr-xtools/h5dump/testh5dumpxml.sh.in4
-rw-r--r--tools/h5ls/CMakeLists.txt6
-rw-r--r--tools/h5ls/testh5ls.sh.in30
-rw-r--r--tools/lib/h5tools_dump.c2
-rw-r--r--tools/lib/h5tools_dump.h2
-rw-r--r--tools/testfiles/h5dump-help.txt6
-rw-r--r--tools/testfiles/tmultifile.ddl42
-rw-r--r--tools/testfiles/tmultifile.ls6
-rw-r--r--tools/testfiles/tnofilename-with-packed-bits.ddl6
-rw-r--r--tools/testfiles/tpbitsIncomplete.ddl6
-rw-r--r--tools/testfiles/tpbitsLengthExceeded.ddl6
-rw-r--r--tools/testfiles/tpbitsLengthPositive.ddl6
-rw-r--r--tools/testfiles/tpbitsMaxExceeded.ddl6
-rw-r--r--tools/testfiles/tpbitsOffsetExceeded.ddl6
-rw-r--r--tools/testfiles/tpbitsOffsetNegative.ddl6
-rw-r--r--tools/testfiles/tqmarkfile.ddl83
-rw-r--r--tools/testfiles/tstarfile.ddl89
20 files changed, 446 insertions, 155 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 9908fd0..91e7ec6 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -126,6 +126,9 @@ IF (BUILD_TESTING)
tlonglinks.ddl
tloop-1.ddl
tmulti.ddl
+ tmultifile.ddl
+# tqmarkfile.ddl
+# tstarfile.ddl
tnamed_dtype_attr.ddl
tnestcomp-1.ddl
tnbit.ddl
@@ -827,6 +830,12 @@ IF (BUILD_TESTING)
tloop-1.out.err
tmulti.out
tmulti.out.err
+ tmultifile.out
+ tmultifile.out.err
+# tqmarkfile.out
+# tqmarkfile.out.err
+# tstarfile.out
+# tstarfile.out.err
tnamed_dtype_attr.out
tnamed_dtype_attr.out.err
tnestcomp-1.out
@@ -1010,6 +1019,11 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tarray7 0 --enable-error-stack tarray7.h5)
ADD_H5_TEST (tarray8 0 --enable-error-stack tarray8.h5)
+ # test for wildcards in filename (does not work with cmake)
+ #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5)
+ #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5)
+ ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5)
+
# test for files with empty data
ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5)
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 23c8ea9..650846a 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -231,7 +231,7 @@ static void
usage(const char *prog)
{
HDfflush(rawoutstream);
- HDfprintf(rawoutstream, "usage: %s [OPTIONS] file\n", prog);
+ HDfprintf(rawoutstream, "usage: %s [OPTIONS] files\n", prog);
HDfprintf(rawoutstream, " OPTIONS\n");
HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n");
HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n");
@@ -329,6 +329,10 @@ usage(const char *prog)
HDfprintf(rawoutstream, "\n");
HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -d /foo multi1.h5 multi2.h5 multi3.h5\n");
+ HDfprintf(rawoutstream, "\n");
}
@@ -1453,161 +1457,161 @@ main(int argc, const char *argv[])
while(opt_ind < argc) {
fname = HDstrdup(argv[opt_ind++]);
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
-
- if (fid < 0) {
- error_msg("unable to open file \"%s\"\n", fname);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
- /* allocate and initialize internal data structure */
- init_prefix(&prefix, prefix_len);
+ if (fid < 0) {
+ error_msg("unable to open file \"%s\"\n", fname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
- /* Prepare to find objects that might be targets of a reference */
- fill_ref_path_table(fid);
+ /* allocate and initialize internal data structure */
+ init_prefix(&prefix, prefix_len);
- if(doxml) {
- /* initialize XML */
- /* reset prefix! */
- HDstrcpy(prefix, "");
+ /* Prepare to find objects that might be targets of a reference */
+ fill_ref_path_table(fid);
- /* make sure the URI is initialized to something */
- if (xml_dtd_uri == NULL) {
- if (useschema) {
- xml_dtd_uri = DEFAULT_XSD;
+ if(doxml) {
+ /* initialize XML */
+ /* reset prefix! */
+ HDstrcpy(prefix, "");
+
+ /* make sure the URI is initialized to something */
+ if (xml_dtd_uri == NULL) {
+ if (useschema) {
+ xml_dtd_uri = DEFAULT_XSD;
+ }
+ else {
+ xml_dtd_uri = DEFAULT_DTD;
+ xmlnsprefix = "";
+ }
}
else {
- xml_dtd_uri = DEFAULT_DTD;
- xmlnsprefix = "";
- }
- }
- else {
- if (useschema && HDstrcmp(xmlnsprefix,"")) {
- error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n");
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
+ if (useschema && HDstrcmp(xmlnsprefix,"")) {
+ error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
}
}
- }
- /* Get object info for root group */
- if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) {
- error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
-
- /* Initialize object tables */
- if(table_list_add(fid, oi.fileno) < 0) {
- error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
- group_table = table_list.tables[0].group_table;
- dset_table = table_list.tables[0].dset_table;
- type_table = table_list.tables[0].type_table;
-
- /* does there exist unamed committed datatype */
- for (u = 0; u < type_table->nobjs; u++)
- if (!type_table->objs[u].recorded) {
- unamedtype = 1;
- break;
- } /* end if */
+ /* Get object info for root group */
+ if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) {
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
- /* start to dump - display file header information */
- if (!doxml) {
- begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin);
- }
- else {
- HDfprintf(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ /* Initialize object tables */
+ if(table_list_add(fid, oi.fileno) < 0) {
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ group_table = table_list.tables[0].group_table;
+ dset_table = table_list.tables[0].dset_table;
+ type_table = table_list.tables[0].type_table;
+
+ /* does there exist unamed committed datatype */
+ for (u = 0; u < type_table->nobjs; u++)
+ if (!type_table->objs[u].recorded) {
+ unamedtype = 1;
+ break;
+ } /* end if */
+
+ /* start to dump - display file header information */
+ if (!doxml) {
+ begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin);
+ }
+ else {
+ HDfprintf(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- /* alternative first element, depending on schema or DTD. */
- if (useschema) {
- if (HDstrcmp(xmlnsprefix,"") == 0) {
- HDfprintf(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
- xml_dtd_uri);
+ /* alternative first element, depending on schema or DTD. */
+ if (useschema) {
+ if (HDstrcmp(xmlnsprefix,"") == 0) {
+ HDfprintf(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
+ xml_dtd_uri);
+ }
+ else {
+ /* TO DO: make -url option work in this case (may need new option) */
+ char *ns;
+ char *indx;
+
+ ns = HDstrdup(xmlnsprefix);
+ indx = HDstrrchr(ns,(int)':');
+ if (indx) *indx = '\0';
+
+ HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" "
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File "
+ "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns);
+ HDfree(ns);
+ }
}
else {
-/* TO DO: make -url option work in this case (may need new option) */
- char *ns;
- char *indx;
-
- ns = HDstrdup(xmlnsprefix);
- indx = HDstrrchr(ns,(int)':');
- if (indx) *indx = '\0';
-
- HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" "
- "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File "
- "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns);
- HDfree(ns);
+ HDfprintf(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
+ HDfprintf(rawoutstream, "<HDF5-File>\n");
}
- }
- else {
- HDfprintf(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
- HDfprintf(rawoutstream, "<HDF5-File>\n");
}
- }
- if (!doxml) {
- if (display_fi) {
- HDfprintf(rawoutstream, "\n");
- dump_fcontents(fid);
- end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend);
- HDfprintf(rawoutstream, "\n");
- goto done;
+ if (!doxml) {
+ if (display_fi) {
+ HDfprintf(rawoutstream, "\n");
+ dump_fcontents(fid);
+ end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend);
+ HDfprintf(rawoutstream, "\n");
+ goto done;
+ }
+
+ if (display_bb)
+ dump_fcpl(fid);
}
- if (display_bb)
- dump_fcpl(fid);
- }
+ if(display_all) {
+ if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) {
+ error_msg("unable to open root group\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ else {
+ if (!doxml)
+ dump_indent += COL;
+ dump_function_table->dump_group_function(gid, "/" );
+ if (!doxml)
+ dump_indent -= COL;
+ HDfprintf(rawoutstream, "\n");
+ }
- if(display_all) {
- if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) {
- error_msg("unable to open root group\n");
- h5tools_setstatus(EXIT_FAILURE);
- }
- else {
- if (!doxml)
- dump_indent += COL;
- dump_function_table->dump_group_function(gid, "/" );
- if (!doxml)
- dump_indent -= COL;
- HDfprintf(rawoutstream, "\n");
- }
+ if(H5Gclose(gid) < 0) {
+ error_msg("unable to close root group\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
- if(H5Gclose(gid) < 0) {
- error_msg("unable to close root group\n");
- h5tools_setstatus(EXIT_FAILURE);
}
+ else {
+ /* Note: this option is not supported for XML */
+ if(doxml) {
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ } /* end if */
- }
- else {
- /* Note: this option is not supported for XML */
- if(doxml) {
- error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- } /* end if */
-
- for(i = 0; i < argc; i++) {
- if(hand[i].func) {
- hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL);
+ for(i = 0; i < argc; i++) {
+ if(hand[i].func) {
+ hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL);
+ }
}
+ HDfprintf(rawoutstream, "\n");
}
- HDfprintf(rawoutstream, "\n");
- }
- if (!doxml) {
- end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend);
- HDfprintf(rawoutstream, "\n");
- }
- else {
- HDfprintf(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix);
- }
- /* Free tables for objects */
- table_list_free();
+ if (!doxml) {
+ end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend);
+ HDfprintf(rawoutstream, "\n");
+ }
+ else {
+ HDfprintf(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix);
+ }
+ /* Free tables for objects */
+ table_list_free();
if(fid >=0)
if (H5Fclose(fid) < 0)
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 06eca36..18cd5d4 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -50,6 +50,7 @@ if test -z "$srcdir"; then
fi
# source dirs
SRC_TOOLS="$srcdir/../"
+
SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles"
# testfiles source dirs for tools
SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES"
@@ -242,6 +243,9 @@ $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
$SRC_H5DUMP_TESTFILES/tloop-1.ddl
$SRC_H5DUMP_TESTFILES/tmulti.ddl
+$SRC_H5DUMP_TESTFILES/tmultifile.ddl
+$SRC_H5DUMP_TESTFILES/tqmarkfile.ddl
+$SRC_H5DUMP_TESTFILES/tstarfile.ddl
$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl
$SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl
$SRC_H5DUMP_TESTFILES/tnbit.ddl
@@ -792,6 +796,11 @@ TOOLTEST tarray6.ddl --enable-error-stack tarray6.h5
TOOLTEST tarray7.ddl --enable-error-stack tarray7.h5
TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5
+# test for wildcards in filename (does not work with cmake)
+TOOLTEST3 tstarfile --enable-error-stack -H -d Dataset1 tarr*.h5
+TOOLTEST3 tqmarkfile --enable-error-stack -H -d Dataset1 tarray?.h5
+TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5
+
# test for files with empty data
TOOLTEST tempty.ddl --enable-error-stack tempty.h5
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index 0bd01b0..1bbf232 100755
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -71,7 +71,7 @@ TOOLTEST() {
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
echo " CREATED"
- cp $actual $expect
+ cp $actual $expect
elif $CMP $expect $actual; then
echo " PASSED"
else
@@ -96,7 +96,7 @@ SKIP() {
##############################################################################
##############################################################################
-### T H E T E S T S ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt
index 599202f..0dec21c 100644
--- a/tools/h5ls/CMakeLists.txt
+++ b/tools/h5ls/CMakeLists.txt
@@ -98,6 +98,7 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls
@@ -354,6 +355,11 @@ IF (BUILD_TESTING)
# when used file with no dangling links - expected exit code 0
ADD_H5_TEST (thlinks-nodangle-1 0 -w80 --follow-symlinks --no-dangling-links thlink.h5)
+# test for wildcards in filename (does not work with cmake)
+# ADD_H5_TEST (tstarfile 0 -w80 t*link.h5)
+# ADD_H5_TEST (tqmarkfile 0 -w80 t?link.h5)
+ ADD_H5_TEST (tmultifile 0 -w80 thlink.h5 tslink.h5)
+
# tests for hard links
ADD_H5_TEST (thlink-1 0 -w80 thlink.h5)
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index e2c204b..23b4ab3 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -25,13 +25,13 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
-NLINES=20 # Max. lines of output to display if test fails
+NLINES=20 # Max. lines of output to display if test fails
WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
nerrors=0
verbose=yes
-h5haveexitcode=yes # default is yes
+h5haveexitcode=yes # default is yes
# The build (current) directory might be different than the source directory.
if test -z "$srcdir"; then
srcdir=.
@@ -131,6 +131,7 @@ $SRC_H5LS_TESTFILES/tgroup-2.ls
$SRC_H5LS_TESTFILES/tgroup-3.ls
$SRC_H5LS_TESTFILES/thlink-1.ls
$SRC_H5LS_TESTFILES/tloop-1.ls
+$SRC_H5LS_TESTFILES/tmultifile.ls
$SRC_H5LS_TESTFILES/tnestcomp-1.ls
$SRC_H5LS_TESTFILES/tnestcomp-2.ls
$SRC_H5LS_TESTFILES/tnestcomp-3.ls
@@ -210,7 +211,7 @@ TOOLTEST() {
# any unexpected output from that stream too.
TESTING $H5LS $@
(
- cd $TESTDIR
+ cd $TESTDIR
$RUNSERIAL $H5LS_BIN "$@"
) >$actual 2>$actual_err
@@ -222,15 +223,15 @@ TOOLTEST() {
STDERR_FILTER $actual_err
cat $actual_err >> $actual
if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
- if [ yes = "$verbose" ]; then
- echo "test returned with exit code $exitcode"
- echo "test output: (up to $NLINES lines)"
- head -$NLINES $actual
- echo "***end of test output***"
- echo ""
- fi
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ if [ yes = "$verbose" ]; then
+ echo "test returned with exit code $exitcode"
+ echo "test output: (up to $NLINES lines)"
+ head -$NLINES $actual
+ echo "***end of test output***"
+ echo ""
+ fi
elif [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
echo " CREATED"
@@ -322,6 +323,11 @@ TOOLTEST tsoftlinks-nodangle-1.ls 1 -w80 --follow-symlinks --no-dangling-links t
# when used file with no dangling links - expected exit code 0
TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thlink.h5
+# test for wildcards in filename (does not work with cmake)
+# this h5ls test script does not pass the filename properly like the h5dump test script???
+#TOOLTEST tstarfile 0 -w80 t*link.h5
+#TOOLTEST tqmarkfile 0 -w80 t?link.h5
+TOOLTEST tmultifile 0 -w80 thlink.h5 tslink.h5
# tests for hard links
TOOLTEST thlink-1.ls 0 -w80 thlink.h5
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index cd7e890..dfbb215 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -1645,7 +1645,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
CATCH
if(sm_buf)
- HDfree(sm_buf);
+ HDfree(sm_buf);
done:
if(sm_space >= 0 && H5Sclose(sm_space) < 0)
diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h
index 0d1a818..55e046b 100644
--- a/tools/lib/h5tools_dump.h
+++ b/tools/lib/h5tools_dump.h
@@ -47,7 +47,7 @@ H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info,
H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container,
h5tools_context_t *ctx/*in,out*/, unsigned flags,
hsize_t nelmts, hid_t type, void *_mem);
-H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info,
+H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t type);
H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t space);
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index ca16c42..f04ed48 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,3 +94,7 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
diff --git a/tools/testfiles/tmultifile.ddl b/tools/testfiles/tmultifile.ddl
new file mode 100644
index 0000000..cf94f2c
--- /dev/null
+++ b/tools/testfiles/tmultifile.ddl
@@ -0,0 +1,42 @@
+HDF5 "tarray2.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray3.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray4.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_COMPOUND {
+ H5T_STD_I32LE "i";
+ H5T_IEEE_F32LE "f";
+ } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray5.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_COMPOUND {
+ H5T_STD_I32LE "i";
+ H5T_ARRAY { [4] H5T_IEEE_F32LE } "f";
+ } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray6.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray7.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
diff --git a/tools/testfiles/tmultifile.ls b/tools/testfiles/tmultifile.ls
new file mode 100644
index 0000000..3fee937
--- /dev/null
+++ b/tools/testfiles/tmultifile.ls
@@ -0,0 +1,6 @@
+dset1 Dataset {5}
+g1 Group
+g2 Group
+g3 Group, same as /
+slink1 Soft Link {somevalue}
+slink2 Soft Link {linkvalue}
diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl
index 4a7f0b9..d3b12e3 100644
--- a/tools/testfiles/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/tnofilename-with-packed-bits.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: missing file name
diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl
index 88dac0a..0da055b 100644
--- a/tools/testfiles/tpbitsIncomplete.ddl
+++ b/tools/testfiles/tpbitsIncomplete.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Bad mask list(0,2,2,1,0,2,2,)
diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl
index 35055f4..594d70c 100644
--- a/tools/testfiles/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/tpbitsLengthExceeded.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Packed Bit offset+length value(65) too large. Max is 64
diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl
index 3daeab4..7b3b678 100644
--- a/tools/testfiles/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/tpbitsLengthPositive.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Packed Bit length value(0) must be positive.
diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl
index 2b3b68f..60bc2b1 100644
--- a/tools/testfiles/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/tpbitsMaxExceeded.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1)
diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl
index 6ccdc26..5db6a91 100644
--- a/tools/testfiles/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/tpbitsOffsetExceeded.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Packed Bit offset value(64) must be between 0 and 63
diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl
index eb41bd7..060fc37 100644
--- a/tools/testfiles/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/tpbitsOffsetNegative.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Bad mask list(-1,1)
diff --git a/tools/testfiles/tqmarkfile.ddl b/tools/testfiles/tqmarkfile.ddl
new file mode 100644
index 0000000..e7771cb
--- /dev/null
+++ b/tools/testfiles/tqmarkfile.ddl
@@ -0,0 +1,83 @@
+HDF5 "tarray1.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray2.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray3.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray4.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_COMPOUND {
+ H5T_STD_I32LE "i";
+ H5T_IEEE_F32LE "f";
+ } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray5.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_COMPOUND {
+ H5T_STD_I32LE "i";
+ H5T_ARRAY { [4] H5T_IEEE_F32LE } "f";
+ } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray6.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray7.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray8.h5" {
+}
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Dopen2(): not found
+ major: Dataset
+ minor: Object not found
+ #001: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist
+ major: Symbol table
+ minor: Object not found
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ major: Symbol table
+ minor: Object not found
+ #001: (file name) line (number) in H5L_get_info(): name doesn't exist
+ major: Symbol table
+ minor: Object already exists
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist
+ major: Symbol table
+ minor: Object not found
+h5dump error: unable to get link info from "Dataset1"
diff --git a/tools/testfiles/tstarfile.ddl b/tools/testfiles/tstarfile.ddl
new file mode 100644
index 0000000..77b80e0
--- /dev/null
+++ b/tools/testfiles/tstarfile.ddl
@@ -0,0 +1,89 @@
+HDF5 "tarray1_big.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [1000] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 2000 ) / ( 2000 ) }
+}
+}
+HDF5 "tarray1.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray2.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray3.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray4.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_COMPOUND {
+ H5T_STD_I32LE "i";
+ H5T_IEEE_F32LE "f";
+ } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray5.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_COMPOUND {
+ H5T_STD_I32LE "i";
+ H5T_ARRAY { [4] H5T_IEEE_F32LE } "f";
+ } }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray6.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray7.h5" {
+DATASET "Dataset1" {
+ DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+}
+}
+HDF5 "tarray8.h5" {
+}
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Dopen2(): not found
+ major: Dataset
+ minor: Object not found
+ #001: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist
+ major: Symbol table
+ minor: Object not found
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ major: Symbol table
+ minor: Object not found
+ #001: (file name) line (number) in H5L_get_info(): name doesn't exist
+ major: Symbol table
+ minor: Object already exists
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist
+ major: Symbol table
+ minor: Object not found
+h5dump error: unable to get link info from "Dataset1"