summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-01 10:27:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-01 10:27:45 (GMT)
commit642f392ba3e2d30ae2a82e32f249461121d17cbc (patch)
treebbce1ae1606153f323156f207b50d88d7fba2ddf /tools/h5dump
parentc034336452ee48574f0dd65bf053079f9801e269 (diff)
downloadhdf5-642f392ba3e2d30ae2a82e32f249461121d17cbc.zip
hdf5-642f392ba3e2d30ae2a82e32f249461121d17cbc.tar.gz
hdf5-642f392ba3e2d30ae2a82e32f249461121d17cbc.tar.bz2
[svn-r19330] Description:
Bring r19109:19328 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 (amani) 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, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/CMakeLists.txt305
-rw-r--r--tools/h5dump/h5dump.c250
-rw-r--r--tools/h5dump/h5dumpgentest.c313
-rw-r--r--tools/h5dump/testh5dump.sh.in69
-rwxr-xr-xtools/h5dump/testh5dumpxml.sh.in3
5 files changed, 654 insertions, 286 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index eb54e00..5ef1cc2 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -4,11 +4,11 @@ PROJECT (HDF5_TOOLS_H5DUMP)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
-INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib)
+INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
-# Add the h5dump and test executables
+# Add the h5dump executables
# --------------------------------------------------------------------
ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c)
H5_NAMING (h5dump)
@@ -26,8 +26,17 @@ TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET (H5_DEP_EXECUTABLES h5dump)
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
IF (BUILD_TESTING)
- IF (NOT BUILD_SHARED_LIBS)
+ # --------------------------------------------------------------------
+ # Add the h5dump test executable
+ # --------------------------------------------------------------------
+ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c)
H5_NAMING (h5dumpgentest)
IF (WIN32)
@@ -41,13 +50,11 @@ IF (BUILD_TESTING)
TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
#ADD_TEST (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>)
-
- SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
- # h5dumpgentest
- )
- ENDIF (NOT BUILD_SHARED_LIBS)
+ ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
- #-- Copy all the HDF5 files from the test directory into the source directory
+ # --------------------------------------------------------------------
+ # Copy all the HDF5 files from the test directory into the source directory
+ # --------------------------------------------------------------------
SET (HDF5_REFERENCE_FILES
tall-1.ddl
tall-2.ddl
@@ -70,6 +77,7 @@ IF (BUILD_TESTING)
tattr-3.ddl
tattrreg.ddl
tattrregR.ddl
+ tbinregR.ddl
tbigdims.ddl
tboot1.ddl
tboot2.ddl
@@ -155,6 +163,71 @@ IF (BUILD_TESTING)
tvlstr.ddl
tvms.ddl
)
+ SET (HDF5_XML_REFERENCE_FILES
+ tall.h5.xml
+ tall-2A.h5.xml
+ tarray1.h5.xml
+ tarray2.h5.xml
+ tarray3.h5.xml
+ tarray6.h5.xml
+ tarray7.h5.xml
+ tattr.h5.xml
+ tbitfields.h5.xml
+ tcompound_complex.h5.xml
+ tcompound.h5.xml
+ tcompound2.h5.xml
+ tdatareg.h5.xml
+ tdset.h5.xml
+ tdset2.h5.xml
+ tempty.h5.xml
+ tempty-dtd.h5.xml
+ tempty-dtd-2.h5.xml
+ tempty-dtd-uri.h5.xml
+ tempty-nons.h5.xml
+ tempty-nons-2.h5.xml
+ tempty-nons-uri.h5.xml
+ tempty-ns.h5.xml
+ tempty-ns-2.h5.xml
+ tenum.h5.xml
+ textlink.h5.xml
+ tfpformat.h5.xml
+ tgroup.h5.xml
+ thlink.h5.xml
+ tloop.h5.xml
+ tloop2.h5.xml
+ tmany.h5.xml
+ tname-amp.h5.xml
+ tname-apos.h5.xml
+ tnamed_dtype_attr.h5.xml
+ tname-gt.h5.xml
+ tname-lt.h5.xml
+ tname-quot.h5.xml
+ tname-sp.h5.xml
+ tnestedcomp.h5.xml
+ tnodata.h5.xml
+ tobjref.h5.xml
+ topaque.h5.xml
+ torderattr1.h5.xml
+ torderattr2.h5.xml
+ torderattr3.h5.xml
+ torderattr4.h5.xml
+ tref.h5.xml
+ tref-escapes.h5.xml
+ tref-escapes-at.h5.xml
+ tsaf.h5.xml
+ tslink.h5.xml
+ tstr.h5.xml
+ tstr2.h5.xml
+ tstring.h5.xml
+ tstring-at.h5.xml
+ tudlink.h5.xml
+ tvldtypes1.h5.xml
+ tvldtypes2.h5.xml
+ tvldtypes3.h5.xml
+ tvldtypes4.h5.xml
+ tvldtypes5.h5.xml
+ tvlstr.h5.xml
+ )
SET (HDF5_REFERENCE_TEST_FILES
tbin1.ddl
tbin1.ddl
@@ -237,6 +310,29 @@ IF (BUILD_TESTING)
tvlstr.h5
tvms.h5
)
+ SET (HDF5_XML_REFERENCE_TEST_FILES
+ tbitfields.h5
+ tcompound2.h5
+ tdset2.h5
+ tenum.h5
+ textlink.h5
+ tloop2.h5
+ tmany.h5
+ tname-amp.h5
+ tname-apos.h5
+ tname-gt.h5
+ tname-lt.h5
+ tname-quot.h5
+ tname-sp.h5
+ tnodata.h5
+ tobjref.h5
+ topaque.h5
+ tref.h5
+ tref-escapes.h5
+ tref-escapes-at.h5
+ tstring.h5
+ tstring-at.h5
+ )
FOREACH (ddl_file ${HDF5_REFERENCE_FILES})
SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}")
@@ -245,10 +341,21 @@ IF (BUILD_TESTING)
TARGET h5dump
POST_BUILD
COMMAND ${XLATE_UTILITY}
- ARGS ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3
+ ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_file} ${ddldest} -l3
)
ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES})
+ FOREACH (xml_file ${HDF5_XML_REFERENCE_FILES})
+ SET (xmldest "${PROJECT_BINARY_DIR}/${xml_file}")
+ #MESSAGE (STATUS " Translating ${xml_file}")
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${XLATE_UTILITY}
+ ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${xml_file} ${xmldest} -l3
+ )
+ ENDFOREACH (xml_file ${HDF5_XML_REFERENCE_FILES})
+
FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES})
SET (dest "${PROJECT_BINARY_DIR}/${h5_file}")
#MESSAGE (STATUS " Copying ${h5_file}")
@@ -256,10 +363,24 @@ IF (BUILD_TESTING)
TARGET h5dump
POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest}
)
ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES})
+ FOREACH (h5_xml_file ${HDF5_XML_REFERENCE_TEST_FILES})
+ SET (dest "${PROJECT_BINARY_DIR}/${h5_xml_file}")
+ #MESSAGE (STATUS " Copying ${h5_xml_file}")
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_xml_file} ${dest}
+ )
+ ENDFOREACH (h5_xml_file ${HDF5_XML_REFERENCE_TEST_FILES})
+
+ # --------------------------------------------------------------------
+ # Special file handling
+ # --------------------------------------------------------------------
ADD_CUSTOM_COMMAND (
TARGET h5dump
POST_BUILD
@@ -267,9 +388,30 @@ IF (BUILD_TESTING)
ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/tbin1LE.ddl
)
+ IF (WIN32 AND NOT MINGW)
+ FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM)
+ FILE (WRITE ${PROJECT_BINARY_DIR}/tbinregR.exp "${TEST_STREAM}")
+ ELSE (WIN32 AND NOT MINGW)
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/tbinregR.exp
+ )
+ ENDIF (WIN32 AND NOT MINGW)
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
+
MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype)
IF (${testtype} STREQUAL "SKIP")
- MESSAGE (STATUS "SKIP ${skipresultfile} ${ARGN}")
+ ADD_TEST (
+ NAME H5DUMP-${skipresultfile}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}"
+ )
ELSE (${testtype} STREQUAL "SKIP")
ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN})
ENDIF (${testtype} STREQUAL "SKIP")
@@ -289,7 +431,46 @@ IF (BUILD_TESTING)
)
ENDMACRO (ADD_H5_TEST file)
+ MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode)
+ ADD_TEST (
+ NAME H5DUMP-output-${resultfile}
+ COMMAND $<TARGET_FILE:h5dump> -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile}
+ )
+ ADD_TEST (
+ NAME H5DUMP-output-cmp-${resultfile}
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${resultfile}.exp
+ )
+ ENDMACRO (ADD_H5_EXPORT_TEST file)
+
+ MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype)
+ IF (${testtype} STREQUAL "SKIP")
+ ADD_TEST (
+ NAME H5DUMP-XML-${skipresultfile}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}"
+ )
+ ELSE (${testtype} STREQUAL "SKIP")
+ ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN})
+ ENDIF (${testtype} STREQUAL "SKIP")
+ ENDMACRO (ADD_XML_SKIP_H5_TEST)
+
+ MACRO (ADD_XML_H5_TEST resultfile resultcode)
+ ADD_TEST (
+ NAME H5DUMP-XML-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=--xml;${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.xml"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ ENDMACRO (ADD_XML_H5_TEST file)
+
+ # --------------------------------------------------------------------
# Determine which filters are available
+ # --------------------------------------------------------------------
SET (USE_FILTER_SZIP H5_HAVE_FILTER_SZIP)
SET (USE_FILTER_DEFLATE H5_HAVE_FILTER_DEFLATE)
SET (USE_FILTER_SHUFFLE H5_HAVE_FILTER_SHUFFLE)
@@ -297,7 +478,9 @@ IF (BUILD_TESTING)
SET (USE_FILTER_NBIT H5_HAVE_FILTER_NBIT)
SET (USE_FILTER_SCALEOFFSET H5_HAVE_FILTER_SCALEOFFSET)
-# Determine if H5dump packed bits feature is included
+ # --------------------------------------------------------------------
+ # Determine if H5dump packed bits feature is included
+ # --------------------------------------------------------------------
SET (USE_PACKED_BITS HDF5_USE_H5DUMP_PACKED_BITS)
##############################################################################
@@ -305,6 +488,7 @@ IF (BUILD_TESTING)
### T H E T E S T S ###
##############################################################################
##############################################################################
+
# test for displaying groups
ADD_H5_TEST (tgroup-1 0 tgroup.h5)
# test for displaying the selected groups
@@ -583,6 +767,7 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tdataregR 0 -R tdatareg.h5)
ADD_H5_TEST (tattrreg 0 tattrreg.h5)
ADD_H5_TEST (tattrregR 0 -R tattrreg.h5)
+ ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 -d /Dataset1 -s 0 -R -y -o)
# tests for group creation order
# "1" tracked, "2" name, root tracked
@@ -612,9 +797,103 @@ IF (BUILD_TESTING)
ENDIF (NOT ${USE_PACKED_BITS})
ADD_SKIP_H5_TEST (tpackedbits 0 ${TESTTYPE} -d /dset1 -M 0,2 tdset.h5)
ADD_SKIP_H5_TEST (tpackedbits2 0 ${TESTTYPE} -d /dset1 -M 0,2,2,1 tdset.h5)
+
+ ########## test XML
+ ADD_XML_H5_TEST (tall.h5 0 tall.h5)
+ ADD_XML_H5_TEST (tattr.h5 0 tattr.h5)
+ ADD_XML_H5_TEST (tbitfields.h5 0 tbitfields.h5)
+ ADD_XML_H5_TEST (tcompound.h5 0 tcompound.h5)
+ ADD_XML_H5_TEST (tcompound2.h5 0 tcompound2.h5)
+ ADD_XML_H5_TEST (tdatareg.h5 0 tdatareg.h5)
+ ADD_XML_H5_TEST (tdset.h5 0 tdset.h5)
+ ADD_XML_H5_TEST (tdset2.h5 0 tdset2.h5)
+ ADD_XML_H5_TEST (tenum.h5 0 tenum.h5)
+ ADD_XML_H5_TEST (tgroup.h5 0 tgroup.h5)
+ ADD_XML_H5_TEST (thlink.h5 0 thlink.h5)
+ ADD_XML_H5_TEST (tloop.h5 0 tloop.h5)
+ ADD_XML_H5_TEST (tloop2.h5 0 tloop2.h5)
+ ADD_XML_H5_TEST (tmany.h5 0 tmany.h5)
+ ADD_XML_H5_TEST (tnestedcomp.h5 0 tnestedcomp.h5)
+ ADD_XML_H5_TEST (tcompound_complex.h5 0 tcompound_complex.h5)
+ ADD_XML_H5_TEST (tobjref.h5 0 tobjref.h5)
+ ADD_XML_H5_TEST (topaque.h5 0 topaque.h5)
+ ADD_XML_H5_TEST (tslink.h5 0 tslink.h5)
+ ADD_XML_H5_TEST (tudlink.h5 0 tudlink.h5)
+ ADD_XML_H5_TEST (textlink.h5 0 textlink.h5)
+ ADD_XML_H5_TEST (tstr.h5 0 tstr.h5)
+ ADD_XML_H5_TEST (tstr2.h5 0 tstr2.h5)
+ ADD_XML_H5_TEST (tref.h5 0 tref.h5)
+ ADD_XML_H5_TEST (tname-amp.h5 0 tname-amp.h5)
+ ADD_XML_H5_TEST (tname-apos.h5 0 tname-apos.h5)
+ ADD_XML_H5_TEST (tname-gt.h5 0 tname-gt.h5)
+ ADD_XML_H5_TEST (tname-lt.h5 0 tname-lt.h5)
+ ADD_XML_H5_TEST (tname-quot.h5 0 tname-quot.h5)
+ ADD_XML_H5_TEST (tname-sp.h5 0 tname-sp.h5)
+ ADD_XML_H5_TEST (tstring.h5 0 tstring.h5)
+ ADD_XML_H5_TEST (tstring-at.h5 0 tstring-at.h5)
+ ADD_XML_H5_TEST (tref-escapes.h5 0 tref-escapes.h5)
+ ADD_XML_H5_TEST (tref-escapes-at.h5 0 tref-escapes-at.h5)
+ ADD_XML_H5_TEST (tnodata.h5 0 tnodata.h5)
+ ADD_XML_H5_TEST (tarray1.h5 0 tarray1.h5)
+ ADD_XML_H5_TEST (tarray2.h5 0 tarray2.h5)
+ ADD_XML_H5_TEST (tarray3.h5 0 tarray3.h5)
+ ADD_XML_H5_TEST (tarray6.h5 0 tarray6.h5)
+ ADD_XML_H5_TEST (tarray7.h5 0 tarray7.h5)
+ ADD_XML_H5_TEST (tvldtypes1.h5 0 tvldtypes1.h5)
+ ADD_XML_H5_TEST (tvldtypes2.h5 0 tvldtypes2.h5)
+ ADD_XML_H5_TEST (tvldtypes3.h5 0 tvldtypes3.h5)
+ ADD_XML_H5_TEST (tvldtypes4.h5 0 tvldtypes4.h5)
+ ADD_XML_H5_TEST (tvldtypes5.h5 0 tvldtypes5.h5)
+ ADD_XML_H5_TEST (tvlstr.h5 0 tvlstr.h5)
+ ADD_XML_H5_TEST (tsaf.h5 0 tsaf.h5)
+ ADD_XML_H5_TEST (tempty.h5 0 tempty.h5)
+ ADD_XML_H5_TEST (tnamed_dtype_attr.h5 0 tnamed_dtype_attr.h5)
+ ##Test dataset and attribute of null space. Commented out:
+ ## wait until the XML schema is updated for null space.
+ ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5)
+
+ # other options for xml
+
+ ADD_XML_H5_TEST (tempty-dtd.h5 0 --use-dtd tempty.h5)
+ ADD_XML_H5_TEST (tempty-dtd-2.h5 0 -u tempty.h5)
+
+ # The lone colon here confuses some systems (Cray X1). Skip
+ # it if configure detects that this is a problem.
+ SET (TESTTYPE "TEST")
+ IF (NOT "H5_LONE_COLON")
+ SET (TESTTYPE "SKIP")
+ ENDIF (NOT "H5_LONE_COLON")
+ ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5)
+
+ ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5)
+
+ ## Some of these combinations are syntactically correct but
+ ## the URLs are dummies
+ ADD_XML_H5_TEST (tempty-ns.h5 0 -X thing: tempty.h5)
+ ADD_XML_H5_TEST (tempty-ns-2.h5 0 --xml-ns=thing: tempty.h5)
+ ADD_XML_H5_TEST (tempty-nons-uri.h5 0 --xml-ns=: --xml-dtd=http://somewhere.net tempty.h5)
+ ADD_XML_H5_TEST (tempty-dtd-uri.h5 0 --use-dtd --xml-dtd=http://somewhere.net tempty.h5)
+
+ ADD_XML_H5_TEST (tall-2A.h5 0 -A tall.h5)
+
+
+ # tests for attribute order
+ ADD_XML_H5_TEST (torderattr1.h5 0 -H --sort_by=name --sort_order=ascending torderattr.h5)
+ ADD_XML_H5_TEST (torderattr2.h5 0 -H --sort_by=name --sort_order=descending torderattr.h5)
+ ADD_XML_H5_TEST (torderattr3.h5 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5)
+ ADD_XML_H5_TEST (torderattr4.h5 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5)
+
+ # tests for floating point user defined printf format
+ ADD_XML_H5_TEST (tfpformat.h5 0 -u -m %.7f tfpformat.h5)
ENDIF (BUILD_TESTING)
+##############################################################################
+##############################################################################
+### I N S T A L L A T I O N ###
+##############################################################################
+##############################################################################
+
#-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index e4c5231..261fe15 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -1607,8 +1607,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
begin_obj(dump_header_format->datasetbegin, name,
dump_header_format->datasetblockbegin);
indentation(indent + COL);
- error_msg(h5tools_getprogname(),
- "internal error (file %s:line %d)\n",
+ error_msg("internal error (file %s:line %d)\n",
__FILE__, __LINE__);
indentation(indent);
end_obj(dump_header_format->datasetend,
@@ -2116,8 +2115,7 @@ dump_group(hid_t gid, const char *name)
if (found_obj == NULL) {
indentation(indent);
- error_msg("internal error (file %s:line %d)\n",
- __FILE__, __LINE__);
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
h5tools_setstatus(EXIT_FAILURE);
}
else if (found_obj->displayed) {
@@ -2354,14 +2352,14 @@ dump_subsetting_header(struct subset_t *sset, int dims)
indentation(indent);
printf("%s %s ", dump_header_format->startbegin,
dump_header_format->startblockbegin);
- dump_dims((hsize_t *)sset->start, dims);
+ dump_dims(sset->start.data, dims);
printf("%s %s\n", dump_header_format->startend,
dump_header_format->startblockend);
indentation(indent);
printf("%s %s ", dump_header_format->stridebegin,
dump_header_format->strideblockbegin);
- dump_dims(sset->stride, dims);
+ dump_dims(sset->stride.data, dims);
printf("%s %s\n", dump_header_format->strideend,
dump_header_format->strideblockend);
@@ -2369,8 +2367,8 @@ dump_subsetting_header(struct subset_t *sset, int dims)
printf("%s %s ", dump_header_format->countbegin,
dump_header_format->countblockbegin);
- if (sset->count)
- dump_dims(sset->count, dims);
+ if(sset->count.data)
+ dump_dims(sset->count.data, dims);
else
printf("DEFAULT");
@@ -2381,8 +2379,8 @@ dump_subsetting_header(struct subset_t *sset, int dims)
printf("%s %s ", dump_header_format->blockbegin,
dump_header_format->blockblockbegin);
- if (sset->block)
- dump_dims(sset->block, dims);
+ if(sset->block.data)
+ dump_dims(sset->block.data, dims);
else
printf("DEFAULT");
@@ -3418,25 +3416,22 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
* semicolons (;). The lists themselves can be separated by
* either commas (,) or white spaces.
*
- * Return: Success: hsize_t array. NULL is a valid return type if
- * there aren't any elements in the array.
+ * Return: <none>
*
* Programmer: Bill Wendling
* Tuesday, 6. February 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-static hsize_t *
-parse_hsize_list(const char *h_list)
+static void
+parse_hsize_list(const char *h_list, subset_d *d)
{
hsize_t *p_list;
const char *ptr;
unsigned int size_count = 0, i = 0, last_digit = 0;
if (!h_list || !*h_list || *h_list == ';')
- return NULL;
+ return;
/* count how many integers do we have */
for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++)
@@ -3452,10 +3447,10 @@ parse_hsize_list(const char *h_list)
if (size_count == 0)
/* there aren't any integers to read */
- return NULL;
+ return;
/* allocate an array for the integers in the list */
- p_list = calloc(size_count, sizeof(hsize_t));
+ p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t));
for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++)
if(isdigit(*ptr)) {
@@ -3466,8 +3461,10 @@ parse_hsize_list(const char *h_list)
/* scroll to end of integer */
ptr++;
}
-
- return p_list;
+ d->data = p_list;
+ d->len = size_count;
+
+ return;
}
/*-------------------------------------------------------------------------
@@ -3499,8 +3496,8 @@ parse_subset_params(char *dset)
if (brace > slash) {
*brace++ = '\0';
- s = calloc(1, sizeof(struct subset_t));
- s->start = parse_hsize_list(brace);
+ s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
+ parse_hsize_list(brace, &s->start);
while (*brace && *brace != ';')
brace++;
@@ -3508,7 +3505,7 @@ parse_subset_params(char *dset)
if (*brace)
brace++;
- s->stride = parse_hsize_list(brace);
+ parse_hsize_list(brace, &s->stride);
while (*brace && *brace != ';')
brace++;
@@ -3516,7 +3513,7 @@ parse_subset_params(char *dset)
if (*brace)
brace++;
- s->count = parse_hsize_list(brace);
+ parse_hsize_list(brace, &s->count);
while (*brace && *brace != ';')
brace++;
@@ -3524,7 +3521,7 @@ parse_subset_params(char *dset)
if (*brace)
brace++;
- s->block = parse_hsize_list(brace);
+ parse_hsize_list(brace, &s->block);
}
}
@@ -3576,79 +3573,83 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
} /* end if */
if(sset) {
- if(!sset->start || !sset->stride || !sset->count || !sset->block) {
+ unsigned int i;
+ hid_t sid = H5Dget_space(dsetid);
+ unsigned int ndims = H5Sget_simple_extent_ndims(sid);
+
+ H5Sclose(sid);
+
+ if(!sset->start.data || !sset->stride.data || !sset->count.data || !sset->block.data) {
/* they didn't specify a ``stride'' or ``block''. default to 1 in all
* dimensions */
- hid_t sid = H5Dget_space(dsetid);
- unsigned int ndims = H5Sget_simple_extent_ndims(sid);
-
- if(!sset->start)
+ if(!sset->start.data) {
/* default to (0, 0, ...) for the start coord */
- sset->start = calloc(ndims, sizeof(hsize_t));
-
- if(!sset->stride) {
- unsigned int i;
-
- sset->stride = calloc(ndims, sizeof(hsize_t));
+ sset->start.data = (hsize_t *)calloc(ndims, sizeof(hsize_t));
+ sset->start.len = ndims;
+ }
+ if(!sset->stride.data) {
+ sset->stride.data = (hsize_t *)calloc(ndims, sizeof(hsize_t));
+ sset->stride.len = ndims;
for (i = 0; i < ndims; i++)
- sset->stride[i] = 1;
+ sset->stride.data[i] = 1;
}
- if (!sset->count) {
- unsigned int i;
-
-
- sset->count = calloc(ndims, sizeof(hsize_t));
-
+ if(!sset->count.data) {
+ sset->count.data = (hsize_t *)calloc(ndims, sizeof(hsize_t));
+ sset->count.len = ndims;
for (i = 0; i < ndims; i++)
- sset->count[i] = 1;
+ sset->count.data[i] = 1;
}
- if (!sset->block) {
- unsigned int i;
-
- sset->block = calloc(ndims, sizeof(hsize_t));
-
+ if(!sset->block.data) {
+ sset->block.data = (hsize_t *)calloc(ndims, sizeof(hsize_t));
+ sset->block.len = ndims;
for (i = 0; i < ndims; i++)
- sset->block[i] = 1;
+ sset->block.data[i] = 1;
}
-
- H5Sclose(sid);
}
- }
-
-
- /*-------------------------------------------------------------------------
- * check for block overlap
- *-------------------------------------------------------------------------
- */
-
- if(sset)
- {
- hid_t sid = H5Dget_space(dsetid);
- unsigned int ndims = H5Sget_simple_extent_ndims(sid);
- unsigned int i;
- for ( i = 0; i < ndims; i++)
- {
- if ( sset->count[i] > 1 )
- {
-
- if ( sset->stride[i] < sset->block[i] )
- {
+ /*-------------------------------------------------------------------------
+ * check for dimension overflow
+ *-------------------------------------------------------------------------
+ */
+ if(sset->start.len > ndims) {
+ error_msg("number of start dims (%u) exceed dataset dims (%u)\n", sset->start.len, ndims);
+ h5tools_setstatus(EXIT_FAILURE);
+ return;
+ }
+ if(sset->stride.len > ndims) {
+ error_msg("number of stride dims (%u) exceed dataset dims (%u)\n", sset->stride.len, ndims);
+ h5tools_setstatus(EXIT_FAILURE);
+ return;
+ }
+ if(sset->count.len > ndims) {
+ error_msg("number of count dims (%u) exceed dataset dims (%u)\n", sset->count.len, ndims);
+ h5tools_setstatus(EXIT_FAILURE);
+ return;
+ }
+ if(sset->block.len > ndims) {
+ error_msg("number of block dims (%u) exceed dataset dims (%u)\n", sset->block.len, ndims);
+ h5tools_setstatus(EXIT_FAILURE);
+ return;
+ }
+
+ /*-------------------------------------------------------------------------
+ * check for block overlap
+ *-------------------------------------------------------------------------
+ */
+ for(i = 0; i < ndims; i++) {
+ if(sset->count.data[i] > 1) {
+ if(sset->stride.data[i] < sset->block.data[i]) {
error_msg("wrong subset selection; blocks overlap\n");
h5tools_setstatus(EXIT_FAILURE);
return;
+ } /* end if */
+ } /* end if */
+ } /* end for */
+ } /* end if */
- }
-
- }
-
- }
- H5Sclose(sid);
-
- }
H5Oget_info(dsetid, &oinfo);
if(oinfo.rc > 1 || hit_elink) {
@@ -3726,7 +3727,7 @@ handle_groups(hid_t fid, const char *group, void UNUSED * data, int pe, const ch
if(prefix_len <= new_len)
{
prefix_len = new_len;
- prefix = HDrealloc(prefix, prefix_len);
+ prefix = (char *)HDrealloc(prefix, prefix_len);
} /* end if */
HDstrcpy(prefix, group);
@@ -3764,7 +3765,7 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
error_msg("\"%s\" is a hard link\n", links);
h5tools_setstatus(EXIT_FAILURE);
} else {
- char *buf = HDmalloc(linfo.u.val_size);
+ char *buf = (char *)HDmalloc(linfo.u.val_size);
switch(linfo.type) {
case H5L_TYPE_SOFT: /* Soft link */
@@ -3938,7 +3939,7 @@ parse_command_line(int argc, const char *argv[])
}
/* this will be plenty big enough to hold the info */
- hand = calloc((size_t)argc, sizeof(struct handler_t));
+ hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t));
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
@@ -4010,7 +4011,7 @@ parse_start:
hand[i].func = handle_datasets;
hand[i].obj = HDstrdup(opt_arg);
hand[i].subset_info = parse_subset_params(hand[i].obj);
- last_dset = hand;
+ last_dset = &hand[i];
break;
}
@@ -4163,8 +4164,7 @@ parse_start:
struct subset_t *s;
if (!last_was_dset) {
- error_msg(h5tools_getprogname(),
- "option `-%c' can only be used after --dataset option\n",
+ error_msg("option `-%c' can only be used after --dataset option\n",
opt);
leave(EXIT_FAILURE);
}
@@ -4176,7 +4176,7 @@ parse_start:
*/
s = last_dset->subset_info;
} else {
- last_dset->subset_info = s = calloc(1, sizeof(struct subset_t));
+ last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
}
/*
@@ -4192,10 +4192,10 @@ parse_start:
*/
do {
switch ((char)opt) {
- case 's': free(s->start); s->start = parse_hsize_list(opt_arg); break;
- case 'S': free(s->stride); s->stride = parse_hsize_list(opt_arg); break;
- case 'c': free(s->count); s->count = parse_hsize_list(opt_arg); break;
- case 'k': free(s->block); s->block = parse_hsize_list(opt_arg); break;
+ case 's': free(s->start.data); parse_hsize_list(opt_arg, &s->start); break;
+ case 'S': free(s->stride.data); parse_hsize_list(opt_arg, &s->stride); break;
+ case 'c': free(s->count.data); parse_hsize_list(opt_arg, &s->count); break;
+ case 'k': free(s->block.data); parse_hsize_list(opt_arg, &s->block); break;
default: goto end_collect;
}
} while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF);
@@ -4256,10 +4256,10 @@ free_handler(struct handler_t *hand, int len)
free(hand[i].obj);
if (hand[i].subset_info) {
- free(hand[i].subset_info->start);
- free(hand[i].subset_info->stride);
- free(hand[i].subset_info->count);
- free(hand[i].subset_info->block);
+ free(hand[i].subset_info->start.data);
+ free(hand[i].subset_info->stride.data);
+ free(hand[i].subset_info->count.data);
+ free(hand[i].subset_info->block.data);
free(hand[i].subset_info);
}
}
@@ -4588,8 +4588,8 @@ print_enum(hid_t type)
dst_size = H5Tget_size(type);
/* Get the names and raw values of all members */
- name = calloc(nmembs, sizeof(char *));
- value = calloc(nmembs, MAX(H5Tget_size(type), dst_size));
+ name = (char **)calloc(nmembs, sizeof(char *));
+ value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size));
for (i = 0; i < nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
@@ -4749,7 +4749,7 @@ xml_escape_the_name(const char *str)
return HDstrdup(str);
cp = str;
- rcp = ncp = HDmalloc(len + extra + 1);
+ rcp = ncp = (char *)HDmalloc(len + extra + 1);
if (!ncp)
return NULL; /* ?? */
@@ -4838,7 +4838,7 @@ xml_escape_the_string(const char *str, int slen)
}
cp = str;
- rcp = ncp = calloc((len + extra + 1), sizeof(char));
+ rcp = ncp = (char *)calloc((len + extra + 1), sizeof(char));
if (ncp == NULL)
return NULL; /* ?? */
@@ -4930,7 +4930,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
/* This should be defined somewhere else */
/* These 2 cases are handled the same right now, but
probably will have something different eventually */
- char * dtxid = malloc(100);
+ char * dtxid = (char *)malloc(100);
xml_name_to_XID(found_obj->objname, dtxid, 100, 1);
if (!found_obj->recorded) {
@@ -5290,7 +5290,7 @@ xml_dump_datatype(hid_t type)
if(found_obj) {
/* Shared datatype, must be entered as an object */
/* These 2 cases are the same now, but may change */
- char * dtxid = malloc(100);
+ char * dtxid = (char *)malloc(100);
xml_name_to_XID(found_obj->objname, dtxid, 100, 1);
if (!found_obj->recorded) {
@@ -5429,6 +5429,12 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
int depth;
int stdindent = COL; /* should be 3 */
+ if (fp_format)
+ {
+ outputformat->fmt_double = fp_format;
+ outputformat->fmt_float = fp_format;
+ }
+
if (nCols==0) {
outputformat->line_ncols = 65535;
outputformat->line_per_line = 1;
@@ -5663,14 +5669,14 @@ xml_dump_named_datatype(hid_t type, const char *name)
char *t_prefix;
char *t_name;
- tmp = HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
HDstrcpy(tmp, prefix);
HDstrcat(tmp, "/");
HDstrcat(tmp, name);
indentation(indent);
- dtxid = HDmalloc(100);
- parentxid = HDmalloc(100);
+ dtxid = (char *)HDmalloc(100);
+ parentxid = (char *)HDmalloc(100);
t_tmp = xml_escape_the_name(tmp);
t_prefix = xml_escape_the_name(prefix);
t_name = xml_escape_the_name(name);
@@ -5818,7 +5824,7 @@ xml_dump_group(hid_t gid, const char *name)
isRoot = 1;
tmp = HDstrdup("/");
} else {
- tmp = HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
HDstrcpy(tmp, prefix);
par = HDstrdup(tmp);
cp = HDstrrchr(par, '/');
@@ -5848,11 +5854,11 @@ xml_dump_group(hid_t gid, const char *name)
h5tools_setstatus(EXIT_FAILURE);
} else {
char *t_name = xml_escape_the_name(name);
- char *grpxid = malloc(100);
- char *parentxid = malloc(100);
+ char *grpxid = (char *)malloc(100);
+ char *parentxid = (char *)malloc(100);
if(found_obj->displayed) {
- char *ptrstr = malloc(100);
+ char *ptrstr = (char *)malloc(100);
/* already seen: enter a groupptr */
if(isRoot) {
@@ -5954,8 +5960,8 @@ xml_dump_group(hid_t gid, const char *name)
/* only link -- must be first time! */
char *t_name = xml_escape_the_name(name);
- char *grpxid = malloc(100);
- char *parentxid = malloc(100);
+ char *grpxid = (char *)malloc(100);
+ char *parentxid = (char *)malloc(100);
if(isRoot) {
xml_name_to_XID("/", grpxid, 100, 1);
@@ -6072,7 +6078,7 @@ xml_print_refs(hid_t did, int source)
ssiz = H5Sget_simple_extent_npoints(space);
ssiz *= H5Tget_size(type);
- buf = calloc((size_t)ssiz, sizeof(char));
+ buf = (char *)calloc((size_t)ssiz, sizeof(char));
if(buf == NULL)
return FAIL;
e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -6086,7 +6092,7 @@ xml_print_refs(hid_t did, int source)
ssiz = H5Sget_simple_extent_npoints(space);
ssiz *= H5Tget_size(type);
- buf = calloc((size_t)ssiz, sizeof(char));
+ buf = (char *)calloc((size_t)ssiz, sizeof(char));
if (buf == NULL) {
free(buf);
return FAIL;
@@ -6207,7 +6213,7 @@ xml_print_strs(hid_t did, int source)
tsiz = H5Tget_size(type);
bp = (char*)buf;
if(!is_vlstr)
- onestring = (char *) calloc(tsiz, sizeof(char));
+ onestring = (char *)calloc(tsiz, sizeof(char));
for (i = 0; i < ssiz; i++) {
if(is_vlstr) {
@@ -6480,10 +6486,10 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
char *tmp;
char *t_name, *t_tmp, *t_prefix;
unsigned attr_crt_order_flags;
- char *rstr = HDmalloc(100);
- char *pstr = HDmalloc(100);
+ char *rstr = (char *)HDmalloc(100);
+ char *pstr = (char *)HDmalloc(100);
- tmp = HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
HDstrcpy(tmp, prefix);
HDstrcat(tmp, "/");
HDstrcat(tmp, name);
@@ -6515,7 +6521,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
/* Print information about storage layout */
if(H5D_CHUNKED == H5Pget_layout(dcpl)) {
maxdims = H5Sget_simple_extent_ndims(space);
- chsize = (hsize_t *) malloc(maxdims * sizeof(hsize_t));
+ chsize = (hsize_t *)malloc(maxdims * sizeof(hsize_t));
indent += COL;
indentation(indent);
printf("<%sStorageLayout>\n",xmlnsprefix);
@@ -6798,8 +6804,8 @@ xml_print_enum(hid_t type)
}
/* Get the names and raw values of all members */
- name = calloc(nmembs, sizeof(char *));
- value = calloc(nmembs, MAX(H5Tget_size(type), dst_size));
+ name = (char **)calloc(nmembs, sizeof(char *));
+ value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size));
for (i = 0; i < nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
@@ -6983,7 +6989,7 @@ static void
init_prefix(char **prfx, size_t prfx_len)
{
HDassert(prfx_len > 0);
- *prfx = HDcalloc(prfx_len, 1);
+ *prfx = (char *)HDcalloc(prfx_len, 1);
}
@@ -7004,7 +7010,7 @@ add_prefix(char **prfx, size_t *prfx_len, const char *name)
/* Check if we need more space */
if(*prfx_len <= new_len) {
*prfx_len = new_len + 1;
- *prfx = HDrealloc(*prfx, *prfx_len);
+ *prfx = (char *)HDrealloc(*prfx, *prfx_len);
}
/* Append object name to prefix */
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index a466739..e8c888c 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -28,9 +28,6 @@
#include "H5private.h"
#include "h5tools.h"
-/* Name of tool */
-#define PROGRAMNAME "h5dumpgentest"
-
#define FILE1 "tgroup.h5"
#define FILE2 "tdset.h5"
#define FILE3 "tattr.h5"
@@ -493,15 +490,15 @@ static void gent_softlink(void)
#define NY 2
static int gent_softlink2(void)
{
- hid_t fileid1;
- hid_t gid1=0, gid2=0;
- hid_t tid;
- hid_t dset1, dset2;
- hid_t datatype, dataspace;
+ hid_t fileid1 = -1;
+ hid_t gid1 = -1, gid2 = -1;
+ hid_t datatype = -1;
+ hid_t dset1 = -1, dset2 = -1;
+ hid_t dataspace = -1;
hsize_t dimsf[2]; /* dataset dimensions */
- herr_t status=SUCCEED;
int data1[NX][NY] = {{0,0},{1,1},{2,2},{3,3}};
int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}};
+ herr_t status = SUCCEED;
/*-----------------------------------------------------------------------
* FILE
@@ -537,8 +534,8 @@ static int gent_softlink2(void)
/*-----------------------------------------------------------------------
* Named datatype
*------------------------------------------------------------------------*/
- tid = H5Tcopy(H5T_NATIVE_INT);
- status = H5Tcommit2(fileid1, "dtype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ datatype = H5Tcopy(H5T_NATIVE_INT);
+ status = H5Tcommit2(fileid1, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1);
@@ -558,16 +555,14 @@ static int gent_softlink2(void)
dataspace = H5Screate_simple(2, dimsf, NULL);
/*
- * Define datatype for the data in the file.
* We will store little endian INT numbers.
*/
- datatype = H5Tcopy(H5T_NATIVE_INT);
/*---------------
* dset1
*/
/* Create a new dataset as sample object */
- dset1 = H5Dcreate2(fileid1, "/dset1", datatype, dataspace,
+ dset1 = H5Dcreate2(fileid1, "/dset1", H5T_NATIVE_INT, dataspace,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (dset1 < 0)
{
@@ -588,7 +583,7 @@ static int gent_softlink2(void)
* dset2
*/
/* Create a new dataset as sample object */
- dset2 = H5Dcreate2(fileid1, "/dset2", datatype, dataspace,
+ dset2 = H5Dcreate2(fileid1, "/dset2", H5T_NATIVE_INT, dataspace,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (dset2 < 0)
{
@@ -708,13 +703,34 @@ out:
/*
* Close/release resources.
*/
- H5Sclose(dataspace);
- H5Gclose(gid1);
- H5Gclose(gid2);
- H5Tclose(datatype);
- H5Dclose(dset1);
- H5Dclose(dset2);
- H5Fclose(fileid1);
+ if(dataspace >= 0 && H5Sclose(dataspace) < 0) {
+ fprintf(stderr, "Error: %s> H5Sclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
+ if(gid1 >= 0 && H5Gclose(gid1) < 0) {
+ fprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
+ if(gid2 >= 0 && H5Gclose(gid2) < 0) {
+ fprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
+ if(datatype >= 0 && H5Tclose(datatype) < 0) {
+ fprintf(stderr, "Error: %s> H5Tclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
+ if(dset1 >= 0 && H5Dclose(dset1) < 0) {
+ fprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
+ if(dset2 >= 0 && H5Dclose(dset2) < 0) {
+ fprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
+ if(fileid1 >= 0 && H5Fclose(fileid1) < 0) {
+ fprintf(stderr, "Error: %s> H5Fclose failed.\n", FILE4_1);
+ status = FAIL;
+ }
return status;
}
@@ -1368,7 +1384,8 @@ static void gent_loop2(void)
(dset1) (udlink)
*/
-static void gent_many(void)
+static void
+gent_many(void)
{
hid_t fid, group, attr, dataset, space, space2, type, create_plist, type2;
hid_t array_dt;
@@ -1391,79 +1408,79 @@ static void gent_many(void)
hsize_t dim[4];
herr_t ret;
- fid = H5Fcreate(FILE12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(FILE12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- create_plist = H5Pcreate(H5P_DATASET_CREATE);
+ create_plist = H5Pcreate(H5P_DATASET_CREATE);
- sdim = 2;
- H5Pset_chunk(create_plist, 1, &sdim);
+ sdim = 2;
+ H5Pset_chunk(create_plist, 1, &sdim);
- group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0]));
+ type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0]));
- dim[0] = dim[1] = dim[2] = dim[3] = 2;
- array_dt = H5Tarray_create2(H5T_STD_I32BE, 4, dim);
- H5Tinsert(type, "a_array", HOFFSET(dset1_t, a), array_dt);
- H5Tclose(array_dt);
+ dim[0] = dim[1] = dim[2] = dim[3] = 2;
+ array_dt = H5Tarray_create2(H5T_STD_I32BE, 4, dim);
+ H5Tinsert(type, "a_array", HOFFSET(dset1_t, a), array_dt);
+ H5Tclose(array_dt);
- array_dt = H5Tarray_create2(H5T_IEEE_F64BE, 4, dim);
- H5Tinsert(type, "b_array", HOFFSET(dset1_t, b), array_dt);
- H5Tclose(array_dt);
+ array_dt = H5Tarray_create2(H5T_IEEE_F64BE, 4, dim);
+ H5Tinsert(type, "b_array", HOFFSET(dset1_t, b), array_dt);
+ H5Tclose(array_dt);
- array_dt = H5Tarray_create2(H5T_IEEE_F64BE, 4, dim);
- H5Tinsert(type, "c_array", HOFFSET(dset1_t, c), array_dt);
- H5Tclose(array_dt);
+ array_dt = H5Tarray_create2(H5T_IEEE_F64BE, 4, dim);
+ H5Tinsert(type, "c_array", HOFFSET(dset1_t, c), array_dt);
+ H5Tclose(array_dt);
- type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0]));
+ type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0]));
- array_dt = H5Tarray_create2(H5T_NATIVE_INT, 4, dim);
- H5Tinsert(type2, "a_array", HOFFSET(dset1_t, a), array_dt);
- H5Tclose(array_dt);
+ array_dt = H5Tarray_create2(H5T_NATIVE_INT, 4, dim);
+ H5Tinsert(type2, "a_array", HOFFSET(dset1_t, a), array_dt);
+ H5Tclose(array_dt);
- array_dt = H5Tarray_create2(H5T_NATIVE_DOUBLE, 4, dim);
- H5Tinsert(type2, "b_array", HOFFSET(dset1_t, b), array_dt);
- H5Tclose(array_dt);
+ array_dt = H5Tarray_create2(H5T_NATIVE_DOUBLE, 4, dim);
+ H5Tinsert(type2, "b_array", HOFFSET(dset1_t, b), array_dt);
+ H5Tclose(array_dt);
- array_dt = H5Tarray_create2(H5T_NATIVE_DOUBLE, 4, dim);
- H5Tinsert(type2, "c_array", HOFFSET(dset1_t, c), array_dt);
- H5Tclose(array_dt);
+ array_dt = H5Tarray_create2(H5T_NATIVE_DOUBLE, 4, dim);
+ H5Tinsert(type2, "c_array", HOFFSET(dset1_t, c), array_dt);
+ H5Tclose(array_dt);
- /* dset1 */
- sdim = 6;
- maxdim = H5S_UNLIMITED;
- space = H5Screate_simple(1, &sdim, &maxdim);
- dataset = H5Dcreate2(group, "dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
+ /* dset1 */
+ sdim = 6;
+ maxdim = H5S_UNLIMITED;
+ space = H5Screate_simple(1, &sdim, &maxdim);
+ dataset = H5Dcreate2(group, "dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
- /* add attributes to dset1 */
- dims[0] = 10;
- space2 = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
- H5Awrite(attr, H5T_NATIVE_CHAR, buf);
- H5Sclose(space2);
- H5Aclose(attr);
+ /* add attributes to dset1 */
+ dims[0] = 10;
+ space2 = H5Screate_simple(1, dims, NULL);
+ attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT);
+ sprintf(buf, "abcdefghi");
+ H5Awrite(attr, H5T_NATIVE_CHAR, buf);
+ H5Sclose(space2);
+ H5Aclose(attr);
- dims[0] = 2; dims[1] = 2;
- space2 = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate2(dataset, "attr2", H5T_STD_I32BE, space2, H5P_DEFAULT, H5P_DEFAULT);
- data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3;
- H5Awrite(attr, H5T_NATIVE_INT, data);
- H5Sclose(space2);
- H5Aclose(attr);
+ dims[0] = 2; dims[1] = 2;
+ space2 = H5Screate_simple(2, dims, NULL);
+ attr = H5Acreate2(dataset, "attr2", H5T_STD_I32BE, space2, H5P_DEFAULT, H5P_DEFAULT);
+ data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3;
+ H5Awrite(attr, H5T_NATIVE_INT, data);
+ H5Sclose(space2);
+ H5Aclose(attr);
- dims[0] = 10;
- space2 = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(dataset, "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT);
- for(i = 0; i < 10; i++)
- d[i] = 0.1 * i;
- H5Awrite(attr, H5T_NATIVE_DOUBLE, d);
- H5Sclose(space2);
- H5Aclose(attr);
+ dims[0] = 10;
+ space2 = H5Screate_simple(1, dims, NULL);
+ attr = H5Acreate2(dataset, "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ d[i] = 0.1 * i;
+ H5Awrite(attr, H5T_NATIVE_DOUBLE, d);
+ H5Sclose(space2);
+ H5Aclose(attr);
for(j=0; j<(int)sdim; j++) {
for(i3 = 0; i3 < 2; i3++) {
@@ -1479,89 +1496,88 @@ static void gent_many(void)
}
}
- H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
+ H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
- H5Dclose(dataset);
- H5Sclose(space);
+ H5Dclose(dataset);
+ H5Sclose(space);
- H5Tclose(type);
- H5Tclose(type2);
- H5Gclose(group);
+ H5Tclose(type);
+ H5Tclose(type2);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Lcreate_hard(group, "/g1/g1.1/dset1", H5L_SAME_LOC, "link1", H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Lcreate_hard(group, "/g1/g1.1/dset1", H5L_SAME_LOC, "link1", H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Lcreate_soft("/g1", group, "slink2", H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Lcreate_soft("/g1", group, "slink2", H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- /* dset2 */
- dims[0] = 10; dims[1] = 10;
- space = H5Screate_simple(2, dims, NULL);
+ /* dset2 */
+ dims[0] = 10; dims[1] = 10;
+ space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate2(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for(i = 0; i < 10; i++)
- for(j = 0; j < 10; j++)
+ dataset = H5Dcreate2(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 10; j++)
dset2[i][j] = j;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
- H5Dclose(dataset);
+ H5Dclose(dataset);
- H5Sclose(space);
- H5Gclose(group);
+ H5Sclose(space);
+ H5Gclose(group);
- group = H5Gopen2(fid, "/g3", H5P_DEFAULT);
- H5Lcreate_hard(group, "/g4/dset2", H5L_SAME_LOC, "link3", H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gopen2(fid, "/g3", H5P_DEFAULT);
+ H5Lcreate_hard(group, "/g4/dset2", H5L_SAME_LOC, "link3", H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- /* dset3 */
- dims[0] = 10; dims[1] = 10;
- space = H5Screate_simple(2, dims, NULL);
+ group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ /* dset3 */
+ dims[0] = 10; dims[1] = 10;
+ space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate2(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for(i = 0; i < 10; i++)
- for(j = 0; j < 10; j++)
+ dataset = H5Dcreate2(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 10; j++)
dset3[i][j] = i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3);
-
- H5Dclose(dataset);
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3);
- H5Sclose(space);
- H5Gclose(group);
+ H5Dclose(dataset);
- group = H5Gopen2(fid, "/g5", H5P_DEFAULT);
- H5Lcreate_soft("/g6/dset3", group, "slink4", H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
- H5Pclose(create_plist);
+ H5Sclose(space);
+ H5Gclose(group);
- group = H5Gcreate2(fid, "/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
- group = H5Gcreate2(fid, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ group = H5Gopen2(fid, "/g5", H5P_DEFAULT);
+ H5Lcreate_soft("/g6/dset3", group, "slink4", H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
+ H5Pclose(create_plist);
- /* Create dangling external and UD links */
- H5Lcreate_external("somefile", "somepath", fid, "/g8/elink", H5P_DEFAULT, H5P_DEFAULT);
- H5Lregister(UD_link_class);
- H5Lcreate_ud(fid, "/g8/udlink", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
+ group = H5Gcreate2(fid, "/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
+ group = H5Gcreate2(fid, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(group);
- /* Create links to external and UD links */
- ret= H5Lcreate_soft("/g8/elink", fid, "/g7/slink5", H5P_DEFAULT, H5P_DEFAULT);
- HDassert(ret >= 0);
- ret= H5Lcreate_soft("/g8/udlink", fid, "/g7/slink6", H5P_DEFAULT, H5P_DEFAULT);
- HDassert(ret >= 0);
+ /* Create dangling external and UD links */
+ H5Lcreate_external("somefile", "somepath", fid, "/g8/elink", H5P_DEFAULT, H5P_DEFAULT);
+ H5Lregister(UD_link_class);
+ H5Lcreate_ud(fid, "/g8/udlink", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
- H5Fclose(fid);
+ /* Create links to external and UD links */
+ ret = H5Lcreate_soft("/g8/elink", fid, "/g7/slink5", H5P_DEFAULT, H5P_DEFAULT);
+ HDassert(ret >= 0);
+ ret = H5Lcreate_soft("/g8/udlink", fid, "/g7/slink6", H5P_DEFAULT, H5P_DEFAULT);
+ HDassert(ret >= 0);
+ H5Fclose(fid);
}
static hid_t mkstr(int size, H5T_str_t pad) {
@@ -2523,7 +2539,8 @@ static void gent_vldatatypes(void)
assert(ret >= 0);
}
-static void gent_vldatatypes2(void)
+static void
+gent_vldatatypes2(void)
{
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
hvl_t *t1; /* Temporary pointer to VL information */
@@ -2536,16 +2553,16 @@ static void gent_vldatatypes2(void)
herr_t ret; /* Generic return value */
/* Allocate and initialize VL data to write */
- for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+1)*sizeof(hvl_t));
- if(wdata[i].p==NULL) {
- printf("Cannot allocate memory for VL data! i=%u\n",i);
+ for(i = 0; i < SPACE1_DIM1; i++) {
+ wdata[i].p = (hvl_t *)malloc((i + 1) * sizeof(hvl_t));
+ if(wdata[i].p == NULL) {
+ printf("Cannot allocate memory for VL data! i=%u\n", i);
return;
} /* end if */
- wdata[i].len=i+1;
- for(t1=wdata[i].p,j=0; j<(i+1); j++, t1++) {
- t1->p=malloc((j+1)*sizeof(unsigned int));
- if(t1->p==NULL) {
+ wdata[i].len = i + 1;
+ for(t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) {
+ t1->p = (unsigned *)malloc((j + 1) * sizeof(unsigned));
+ if(t1->p == NULL) {
printf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
return;
} /* end if */
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 55434ab..1c152da 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -144,6 +144,58 @@ TOOLTEST1() {
}
+# same as TOOLTEST1 but compares generated file to expected output
+# and compares the generated data file to the expected data file
+# used for the binary tests that expect a full path in -o without -b
+TOOLTEST2() {
+
+ expectdata="$srcdir/../testfiles/$1"
+ expect="$srcdir/../testfiles/`basename $1 .exp`.ddl"
+ actualdata="../testfiles/`basename $1 .exp`.txt"
+ actual="../testfiles/`basename $1 .exp`.out"
+ actual_err="../testfiles/`basename $1 .exp`.err"
+ shift
+
+ # Run test.
+ TESTING $DUMPER $@
+ (
+
+ cd $srcdir/../testfiles
+ $RUNSERIAL $DUMPER_BIN $@
+ ) >$actual 2>$actual_err
+ cat $actual_err >> $actual
+
+ if [ ! -f $expect ]; then
+ # Create the expect file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actual $expect
+ elif $CMP $expect $actual; then
+ if [ ! -f $expectdata ]; then
+ # Create the expect data file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actualdata $expectdata
+ elif $CMP $expectdata $actualdata; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected datafile (*.exp) differs from actual datafile (*.txt)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /'
+ fi
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.ddl) differs from actual result (*.out)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actualdata $actual_err
+ fi
+
+}
+
# Print a "SKIP" message
SKIP() {
@@ -383,6 +435,12 @@ TOOLTEST tindicessub3.ddl -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.
# 4D case
TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5
+#Exceed the dimensions for subsetting
+TOOLTEST1 texceedsubstart.ddl -d 1d -s 1,3 taindices.h5
+TOOLTEST1 texceedsubcount.ddl -d 1d -c 1,3 taindices.h5
+TOOLTEST1 texceedsubstride.ddl -d 1d -S 1,3 taindices.h5
+TOOLTEST1 texceedsubblock.ddl -d 1d -k 1,3 taindices.h5
+
# tests for filters
# SZIP
@@ -482,14 +540,19 @@ if test -z "$HDF5_NOCLEANUP"; then
rm -f $TESTDIR/out3.h5
fi
-
-
# test for dataset region references
TOOLTEST tdatareg.ddl tdatareg.h5
TOOLTEST tdataregR.ddl -R tdatareg.h5
TOOLTEST tattrreg.ddl tattrreg.h5
TOOLTEST tattrregR.ddl -R tattrreg.h5
+TOOLTEST2 tbinregR.exp -d /Dataset1 -s 0 -R -y -o $TESTDIR/tbinregR.txt tdatareg.h5
+
+# Clean up text output files
+if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $TESTDIR/tbinregR.txt
+fi
+
# tests for group creation order
# "1" tracked, "2" name, root tracked
TOOLTEST tordergr1.ddl --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5
@@ -504,7 +567,6 @@ TOOLTEST torderattr2.ddl -H --sort_by=name --sort_order=descending torderattr.h5
TOOLTEST torderattr3.ddl -H --sort_by=creation_order --sort_order=ascending torderattr.h5
TOOLTEST torderattr4.ddl -H --sort_by=creation_order --sort_order=descending torderattr.h5
-
# tests for floating point user defined printf format
TOOLTEST tfpformat.ddl -m %.7f tfpformat.h5
@@ -515,6 +577,7 @@ TOOLTEST textlinkfar.ddl textlinkfar.h5
# tests for Fixed Array chunk indices
TOOLTEST tdset_idx.ddl -p -H tdset_idx.h5
+# Report test results and exit
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index c4c8657..c9f1ad2 100755
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -188,6 +188,9 @@ TOOLTEST torderattr2.h5.xml --xml -H --sort_by=name --sort_order=descending tord
TOOLTEST torderattr3.h5.xml --xml -H --sort_by=creation_order --sort_order=ascending torderattr.h5
TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=descending torderattr.h5
+# tests for floating point user defined printf format
+TOOLTEST tfpformat.h5.xml -u -m %.7f tfpformat.h5
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."