diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
commit | eb89d7b53ab95623ab454186a602e1cafc7391f0 (patch) | |
tree | ceafe458b3011e38853e765352d3c7e59bbecce1 /tools/misc | |
parent | 3e468e6ff65d540a439e99ea568a6bff7add7cea (diff) | |
download | hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.zip hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.gz hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.bz2 |
[svn-r22105] Description:
Bring r20557:22085 from trunk to this branch, also fixing some other
issues/failures in the branch simultaneously. The h5repack tests are still
failing, but Neil will be checking into those, so the branch can be fully
functional again.
Tested on:
Mac OSX/64 10.7.3 (amazon) w/debug
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/CMakeLists.txt | 26 | ||||
-rw-r--r-- | tools/misc/Makefile.in | 3 | ||||
-rw-r--r-- | tools/misc/h5debug.c | 162 | ||||
-rw-r--r-- | tools/misc/h5mkgrp.c | 8 | ||||
-rw-r--r-- | tools/misc/testh5mkgrp.sh | 10 |
5 files changed, 117 insertions, 92 deletions
diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index b4e7078..72930c9 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_MISC) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the misc executables @@ -14,14 +13,17 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5debug @@ -43,12 +45,14 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -134,14 +138,18 @@ IF (BUILD_TESTING) ${PROJECT_BINARY_DIR}/${resultfile}.out ${PROJECT_BINARY_DIR}/${resultfile}.out.err ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile}${resultoption} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5MKGRP-${resultfile}${resultoption} COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}${resultoption}) + SET (last_test "H5MKGRP-${resultfile}${resultoption}") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5MKGRP-H5LS-${resultfile}${resultoption} + NAME H5MKGRP-h5ls-${resultfile}${resultoption} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" @@ -152,7 +160,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-H5LS-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) + SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) + SET (last_test "H5MKGRP-h5ls-${resultfile}${resultoption}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (NOT ${resultoption} STREQUAL " ") ADD_TEST ( @@ -163,14 +172,18 @@ IF (BUILD_TESTING) ${PROJECT_BINARY_DIR}/${resultfile}.out ${PROJECT_BINARY_DIR}/${resultfile}.out.err ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5MKGRP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}) + SET (last_test "H5MKGRP-${resultfile}") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5MKGRP-H5LS-${resultfile} + NAME H5MKGRP-h5ls-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" @@ -181,7 +194,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-H5LS-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}) + SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}) + SET (last_test "H5MKGRP-h5ls-${resultfile}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDIF (NOT ${resultoption} STREQUAL " ") ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index b761859..ce8e991 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -229,6 +229,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -249,10 +250,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 2b3b85d..2a7d73f 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -62,15 +62,15 @@ /*------------------------------------------------------------------------- * Function: get_H5B2_class * - * Purpose: Determine the v2 B-tree class from the buffer read in. + * Purpose: Determine the v2 B-tree class from the buffer read in. * B-trees are debugged through the B-tree subclass. The subclass * identifier is two bytes after the B-tree signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -130,7 +130,7 @@ get_H5B2_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } /* end switch */ @@ -141,15 +141,15 @@ get_H5B2_class(const uint8_t *sig) /*------------------------------------------------------------------------- * Function: get_H5EA_class * - * Purpose: Determine the extensible array class from the buffer read in. + * Purpose: Determine the extensible array class from the buffer read in. * Extensible arrays are debugged through the array subclass. * The subclass identifier is two bytes after the signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -173,7 +173,7 @@ get_H5EA_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -184,15 +184,15 @@ get_H5EA_class(const uint8_t *sig) /*------------------------------------------------------------------------- * Function: get_H5FA_class * - * Purpose: Determine the fixed array class from the buffer read in. + * Purpose: Determine the fixed array class from the buffer read in. * Extensible arrays are debugged through the array subclass. * The subclass identifier is two bytes after the signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -216,7 +216,7 @@ get_H5FA_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -242,7 +242,7 @@ get_H5FA_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl, dxpl; + hid_t fid, fapl, dxpl; H5F_t *f; haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; @@ -250,13 +250,13 @@ main(int argc, char *argv[]) herr_t status = SUCCEED; if(argc == 1) { - fprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); - HDexit(1); + HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); + HDexit(1); } /* end if */ /* Initialize the library */ if(H5open() < 0) { - fprintf(stderr, "cannot initialize the library\n"); + HDfprintf(stderr, "cannot initialize the library\n"); HDexit(1); } /* end if */ @@ -264,27 +264,27 @@ main(int argc, char *argv[]) * Open the file and get the file descriptor. */ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) { - fprintf(stderr, "cannot create dataset transfer property list\n"); + HDfprintf(stderr, "cannot create dataset transfer property list\n"); HDexit(1); } /* end if */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - fprintf(stderr, "cannot create file access property list\n"); + HDfprintf(stderr, "cannot create file access property list\n"); HDexit(1); } /* end if */ - if(strchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + if(HDstrchr(argv[1], '%')) + H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { - fprintf(stderr, "cannot open file\n"); + HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ if(NULL == (f = (H5F_t *)H5I_object(fid))) { - fprintf(stderr, "cannot obtain H5F_t pointer\n"); + HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } /* end if */ /* Ignore metadata tags while using h5debug */ if(H5AC_ignore_tags(f) < 0) { - fprintf(stderr, "cannot ignore metadata tags\n"); + HDfprintf(stderr, "cannot ignore metadata tags\n"); HDexit(1); } @@ -307,7 +307,7 @@ main(int argc, char *argv[]) */ HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) { - fprintf(stderr, "cannot read signature\n"); + HDfprintf(stderr, "cannot read signature\n"); HDexit(3); } if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) { @@ -335,9 +335,9 @@ main(int argc, char *argv[]) /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - fprintf(stderr, "Symbol table node usage:\n"); - fprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n"); + HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); + HDfprintf(stderr, "Symbol table node usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n"); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -355,9 +355,9 @@ main(int argc, char *argv[]) case H5B_SNODE_ID: /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - fprintf(stderr, "B-tree symbol table node usage:\n"); - fprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n"); + HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); + HDfprintf(stderr, "B-tree symbol table node usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n"); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -366,9 +366,9 @@ main(int argc, char *argv[]) case H5B_CHUNK_ID: /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); - fprintf(stderr, "B-tree chunked storage node usage:\n"); - fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n"); + HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); + HDfprintf(stderr, "B-tree chunked storage node usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n"); HDexit(4); } /* end if */ @@ -377,7 +377,7 @@ main(int argc, char *argv[]) break; default: - fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } @@ -415,10 +415,10 @@ main(int argc, char *argv[]) HDexit(4); } else if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); - fprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); - fprintf(stderr, "v2 B-tree internal node usage:\n"); - fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\n"); + HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); + HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); + HDfprintf(stderr, "v2 B-tree internal node usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\n"); HDexit(4); } /* end if */ @@ -441,9 +441,9 @@ main(int argc, char *argv[]) HDexit(4); } else if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); - fprintf(stderr, "v2 B-tree leaf node usage:\n"); - fprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n"); + HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); + HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n"); HDexit(4); } /* end if */ @@ -462,9 +462,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); - fprintf(stderr, "Fractal heap direct block usage:\n"); - fprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n"); + HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); + HDfprintf(stderr, "Fractal heap direct block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n"); HDexit(4); } /* end if */ @@ -477,9 +477,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); - fprintf(stderr, "Fractal heap indirect block usage:\n"); - fprintf(stderr, "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n"); + HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); + HDfprintf(stderr, "Fractal heap indirect block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n"); HDexit(4); } /* end if */ @@ -499,9 +499,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); - fprintf(stderr, "Free space serialized sections usage:\n"); - fprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header address> <client address>\n"); + HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); + HDfprintf(stderr, "Free space serialized sections usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header address> <client address>\n"); HDexit(4); } /* end if */ @@ -521,9 +521,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra2 == 0) { - fprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); - fprintf(stderr, "Shared message list usage:\n"); - fprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n"); + HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); + HDfprintf(stderr, "Shared message list usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n"); HDexit(4); } /* end if */ @@ -536,11 +536,11 @@ main(int argc, char *argv[]) const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); - /* Check for enough valid parameters */ + /* Check for enough valid parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); - fprintf(stderr, "Extensible array header block usage:\n"); - fprintf(stderr, "\th5debug <filename> <Extensible Array header address> <object header address>\n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "Extensible array header block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <Extensible Array header address> <object header address>\n"); HDexit(4); } /* end if */ @@ -555,9 +555,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n"); - fprintf(stderr, "Extensible array index block usage:\n"); - fprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n"); + HDfprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n"); + HDfprintf(stderr, "Extensible array index block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n"); HDexit(4); } /* end if */ @@ -572,9 +572,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n"); - fprintf(stderr, "Extensible array super block usage:\n"); - fprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\n"); + HDfprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n"); + HDfprintf(stderr, "Extensible array super block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\n"); HDexit(4); } /* end if */ @@ -589,9 +589,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n"); - fprintf(stderr, "Extensible array data block usage:\n"); - fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n"); + HDfprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n"); + HDfprintf(stderr, "Extensible array data block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n"); HDexit(4); } /* end if */ @@ -604,11 +604,11 @@ main(int argc, char *argv[]) const H5FA_class_t *cls = get_H5FA_class(sig); HDassert(cls); - /* Check for enough valid parameters */ + /* Check for enough valid parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); - fprintf(stderr, "Fixed array header block usage:\n"); - fprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "Fixed array header block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n"); HDexit(4); } /* end if */ @@ -623,9 +623,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); - fprintf(stderr, "fixed array data block usage:\n"); - fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n"); + HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); + HDfprintf(stderr, "fixed array data block usage:\n"); + HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n"); HDexit(4); } /* end if */ @@ -661,13 +661,13 @@ main(int argc, char *argv[]) } HDputchar('\n'); - fprintf(stderr, "unknown signature\n"); + HDfprintf(stderr, "unknown signature\n"); HDexit(4); } /* end else */ /* Check for an error when dumping information */ if(status < 0) { - fprintf(stderr, "An error occurred!\n"); + HDfprintf(stderr, "An error occurred!\n"); H5Eprint2(H5E_DEFAULT, stderr); HDexit(5); } /* end if */ diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 09f23ef..b4ac6f6 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -63,7 +63,7 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } /* end leave() */ @@ -81,7 +81,7 @@ leave(int ret) static void usage(void) { - fprintf(stdout, "\ + HDfprintf(stdout, "\ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ OPTIONS\n\ -h, --help Print a usage message and exit\n\ @@ -97,8 +97,8 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ * * Purpose: Parses command line and sets up global variable to control output * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * * Programmer: Quincey Koziol, 2/13/2007 * diff --git a/tools/misc/testh5mkgrp.sh b/tools/misc/testh5mkgrp.sh index 46264c2..7bb98cb 100644 --- a/tools/misc/testh5mkgrp.sh +++ b/tools/misc/testh5mkgrp.sh @@ -51,6 +51,9 @@ TESTING() echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # @@ -97,6 +100,7 @@ H5LSTEST() { expect="$INDIR/`basename $1 .h5`.ls" actual="$OUTDIR/`basename $1 .h5`.out" + actual_sav=${actual}-sav # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. @@ -108,6 +112,10 @@ H5LSTEST() $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual + # save actual in case it is needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + STDERR_FILTER $actual if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. @@ -124,7 +132,7 @@ H5LSTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_sav fi } |