From 61b6ca5a3d4c73ebe4e49e6b0b702149653f21f0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 13 Jan 2016 17:03:49 -0500 Subject: [svn-r28893] Merge of r28863, 28872, 28874, 28879, 28880, 28889 from revise_chunks. Brings all recent changes from trunk/revise_chunks. autogen.sh -p run on THG machines. Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1 cmake serial w/ C++ and Fortran autotools serial w/ C++ and Fortran autotools parallel w/ Fortran --- MANIFEST | 3 + bin/ltmain.sh | 23 +- bin/switch_maint_mode | 83 +++++ configure | 96 +++-- configure.ac | 3 - m4/libtool.m4 | 27 +- m4/ltversion.m4 | 10 +- src/H5AClog.c | 32 +- src/H5Eprivate.h | 2 +- test/error_test.c | 4 +- test/tarray.c | 640 +++++++++++++++++++-------------- tools/h5dump/CMakeTests.cmake | 39 +- tools/h5dump/errfiles/non_existing.err | 1 + tools/h5dump/h5dump.c | 64 ++-- tools/h5dump/testh5dump.sh.in | 65 ++-- tools/testfiles/non_existing.ddl | 31 ++ 16 files changed, 691 insertions(+), 432 deletions(-) create mode 100755 bin/switch_maint_mode create mode 100644 tools/h5dump/errfiles/non_existing.err create mode 100644 tools/testfiles/non_existing.ddl diff --git a/MANIFEST b/MANIFEST index b151cf7..78405b9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -66,6 +66,7 @@ ./bin/runtest _DO_NOT_DISTRIBUTE_ ./bin/snapshot ./bin/snapshot_version _DO_NOT_DISTRIBUTE_ +./bin/switch_maint_mode _DO_NOT_DISTRIBUTE_ ./bin/timekeeper _DO_NOT_DISTRIBUTE_ ./bin/trace ./bin/yodconfigure @@ -1445,6 +1446,7 @@ ./tools/testfiles/filter_fail.h5 ./tools/testfiles/filter_fail.ddl ./tools/testfiles/h5dump-help.txt +./tools/testfiles/non_existing.ddl ./tools/testfiles/packedbits.ddl ./tools/testfiles/taindices.h5 ./tools/testfiles/tall-1.ddl @@ -1704,6 +1706,7 @@ # h5dump test error files ./tools/h5dump/errfiles/filter_fail.err +./tools/h5dump/errfiles/non_existing.err ./tools/h5dump/errfiles/tall-1.err ./tools/h5dump/errfiles/tall-2A.err ./tools/h5dump/errfiles/tall-2A0.err diff --git a/bin/ltmain.sh b/bin/ltmain.sh index b891526..0f0a2da 100644 --- a/bin/ltmain.sh +++ b/bin/ltmain.sh @@ -2,7 +2,7 @@ ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.5 +# libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.5 -package_revision=2.4.5 +VERSION=2.4.6 +package_revision=2.4.6 ## ------ ## @@ -64,7 +64,7 @@ package_revision=2.4.5 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2014-01-03.01; # UTC +scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 @@ -192,7 +192,7 @@ func_path_progs () _G_path_prog_max=0 _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. @@ -1977,7 +1977,7 @@ func_version () # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.5' +scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... @@ -2039,7 +2039,12 @@ usage_message="Options: " # Additional text appended to 'usage_message' in response to '--help'. -long_help_message=$long_help_message" +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message MODE must be one of the following: @@ -2063,13 +2068,15 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.5 + version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." + exit 0 +} # func_lo2o OBJECT-NAME diff --git a/bin/switch_maint_mode b/bin/switch_maint_mode new file mode 100755 index 0000000..2b62545 --- /dev/null +++ b/bin/switch_maint_mode @@ -0,0 +1,83 @@ +#!/bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. +# +# Switch AM_MAINTAINER_MODE value in configure.ac +# Usage: See USAGE() +# Programmer: Dana Robinson +# Creation date: January 2016 + +USAGE() +{ +cat < + +EOF +} + +MODE="notset" +CONFIG_AC_PATH= + +# Display help/usage if any options were passed in +while [ $# -gt 0 ]; do + case "$1" in + -enable) + MODE="enable" + ;; + -disable) + MODE="disable" + ;; + -help) + USAGE + exit 0 + ;; + *) + CONFIG_AC_PATH="$1" + ;; + esac + shift +done + +# Did we get a file path? +if test -z $CONFIG_AC_PATH ; then + USAGE + exit 1 +fi + +# Did we get a mode? +if test -z $MODE ; then + USAGE + exit 1 +fi + +# Run perl over configure.ac +if test "X-$MODE" = "X-enable" ; then + perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1enable$3/g' $CONFIG_AC_PATH +fi +if test "X-$MODE" = "X-disable" ; then + perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1disable$3/g' $CONFIG_AC_PATH +fi + diff --git a/configure b/configure index 856add3..8343730 100755 --- a/configure +++ b/configure @@ -9515,8 +9515,8 @@ esac -macro_version='2.4.5' -macro_revision='2.4.5' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -12803,7 +12803,7 @@ func_munge_path_list () x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -16372,13 +16372,20 @@ if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi -# lt_cv_sys_lib... is unaugmented for libtool script decls... -lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec -# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for -# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -20391,13 +20398,17 @@ if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi -# lt_cv_sys_lib... is unaugmented for libtool script decls... -lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec -# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for -# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + @@ -23487,13 +23498,17 @@ if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi -# lt_cv_sys_lib... is unaugmented for libtool script decls... -lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec -# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for -# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + @@ -28756,9 +28771,6 @@ fi ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## -## ---------------------------------------------------------------------- -## Check if Direct I/O driver is enabled by --enable-direct-vfd -## if ${hdf5_cv_direct_io+:} false; then : $as_echo_n "(cached) " >&6 else @@ -30377,7 +30389,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_lib_dlsearch_path_spec='`$ECHO "$lt_cv_sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -30653,7 +30666,8 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -lt_cv_sys_lib_dlsearch_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ reload_cmds_CXX \ reload_cmds_FC \ old_archive_cmds_CXX \ @@ -30759,7 +30773,7 @@ $as_echo "$as_me: creating $ofile" >&6;} available_tags='CXX FC ' # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -31010,8 +31024,11 @@ hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_lt_cv_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -31177,9 +31194,8 @@ compiler_lib_search_path=$lt_compiler_lib_search_path _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- @@ -31201,7 +31217,7 @@ func_munge_path_list () x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -31232,6 +31248,8 @@ func_cc_basename () } +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -32538,7 +32556,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_lib_dlsearch_path_spec='`$ECHO "$lt_cv_sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -32814,7 +32833,8 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -lt_cv_sys_lib_dlsearch_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ reload_cmds_CXX \ reload_cmds_FC \ old_archive_cmds_CXX \ @@ -33725,7 +33745,7 @@ $as_echo X"$file" | available_tags='CXX FC ' # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -33976,8 +33996,11 @@ hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_lt_cv_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -34143,9 +34166,8 @@ compiler_lib_search_path=$lt_compiler_lib_search_path _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- @@ -34167,7 +34189,7 @@ func_munge_path_list () x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -34198,6 +34220,8 @@ func_cc_basename () } +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in diff --git a/configure.ac b/configure.ac index 122afe8..fa3428f 100644 --- a/configure.ac +++ b/configure.ac @@ -2287,9 +2287,6 @@ fi ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## -## ---------------------------------------------------------------------- -## Check if Direct I/O driver is enabled by --enable-direct-vfd -## AC_CACHE_VAL([hdf5_cv_direct_io], AC_CHECK_DECL([O_DIRECT], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no], [[#include ]])) AC_CACHE_VAL([hdf5_cv_posix_memalign], diff --git a/m4/libtool.m4 b/m4/libtool.m4 index f796d7b..a3bc337 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -738,7 +738,7 @@ _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS @@ -748,13 +748,14 @@ _LT_LIBTOOL_TAG_VARS _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -2256,7 +2257,7 @@ func_munge_path_list () x) ;; *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \$@S|@1\" + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" @@ -3100,13 +3101,15 @@ if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi -# lt_cv_sys_lib... is unaugmented for libtool script decls... -lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec -# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for -# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -3139,8 +3142,10 @@ _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index a4c5ed4..fa04b52 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4171 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.5]) -m4_define([LT_PACKAGE_REVISION], [2.4.5]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.5' -macro_revision='2.4.5' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/src/H5AClog.c b/src/H5AClog.c index 11579d8..cdfb932 100644 --- a/src/H5AClog.c +++ b/src/H5AClog.c @@ -116,7 +116,7 @@ H5AC__write_create_cache_log_msg(H5AC_t *cache) \"messages\":\n\ [\n\ " - , (long long)time(NULL)); + , (long long)HDtime(NULL)); /* Since we're about to override the current logging flag, * check the "log enabled" flag to see if we didn't get here @@ -170,7 +170,7 @@ H5AC__write_destroy_cache_log_msg(H5AC_t *cache) \"close_time\":%lld,\n\ }\n\ " - , (long long)time(NULL)); + , (long long)HDtime(NULL)); /* Since we're about to override the current logging flag, * check the "log enabled" flag to see if we didn't get here @@ -226,7 +226,7 @@ H5AC__write_evict_cache_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (int)fxn_ret_value); + , (long long)HDtime(NULL), (int)fxn_ret_value); /* Write the log message to the file */ if(H5C_write_log_message(cache, msg) < 0) @@ -274,7 +274,7 @@ H5AC__write_expunge_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)address, (int)type_id, (int)fxn_ret_value); + , (long long)HDtime(NULL), (unsigned long)address, (int)type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -319,7 +319,7 @@ H5AC__write_flush_cache_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (int)fxn_ret_value); + , (long long)HDtime(NULL), (int)fxn_ret_value); /* Write the log message to the file */ if(H5C_write_log_message(cache, msg) < 0) @@ -372,7 +372,7 @@ H5AC__write_insert_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)address, flags, type_id, + , (long long)HDtime(NULL), (unsigned long)address, flags, type_id, (int)size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -420,7 +420,7 @@ H5AC__write_mark_dirty_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if(H5C_write_log_message(cache, msg) < 0) @@ -470,7 +470,7 @@ H5AC__write_move_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)old_addr, + , (long long)HDtime(NULL), (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -518,7 +518,7 @@ H5AC__write_pin_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -570,7 +570,7 @@ H5AC__write_create_fd_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)parent->addr, + , (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -627,7 +627,7 @@ H5AC__write_protect_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, rw_s, (int)entry->size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -677,7 +677,7 @@ H5AC__write_resize_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -725,7 +725,7 @@ H5AC__write_unpin_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -777,7 +777,7 @@ H5AC__write_destroy_fd_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)parent->addr, + , (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -829,7 +829,7 @@ H5AC__write_unprotect_entry_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, type_id, flags, (int)fxn_ret_value); HDsnprintf(msg, MSG_SIZE, " "); @@ -878,7 +878,7 @@ H5AC__write_set_cache_config_log_msg(const H5AC_t *cache, \"returned\":%d\ },\n\ " - , (long long)time(NULL), (int)fxn_ret_value); + , (long long)HDtime(NULL), (int)fxn_ret_value); /* Write the log message to the file */ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index ba17ada..db413e3 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -125,7 +125,7 @@ extern int H5E_mpi_error_str_len; #define HMPI_ERROR(mpierr){ \ MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \ - HERROR(H5E_INTERNAL, H5E_MPIERRSTR, H5E_mpi_error_str); \ + HERROR(H5E_INTERNAL, H5E_MPIERRSTR, "%s", H5E_mpi_error_str); \ } #define HMPI_DONE_ERROR(retcode, str, mpierr){ \ HMPI_ERROR(mpierr); \ diff --git a/test/error_test.c b/test/error_test.c index 4e4c0ef..ee181b1 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -498,7 +498,7 @@ test_create(void) if(err_num != 0) TEST_ERROR /* Push an error with a long description */ - if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, err_msg) < 0) TEST_ERROR; + if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); @@ -543,7 +543,7 @@ test_copy(void) herr_t ret; /* Generic return value */ /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, err_msg) < 0) TEST_ERROR; + if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(H5E_DEFAULT); diff --git a/test/tarray.c b/test/tarray.c index cb5fef9..b05a975 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -26,49 +26,75 @@ #include "hdf5.h" -#define FILENAME "tarray1.h5" -#define TESTFILE "tarrold.h5" +#define FILENAME "tarray1.h5" +#define TESTFILE "tarrold.h5" /* 1-D array datatype */ -#define ARRAY1_RANK 1 -#define ARRAY1_DIM1 4 +#define ARRAY1_RANK 1 +#define ARRAY1_DIM1 4 /* 3-D array datatype */ -#define ARRAY2_RANK 3 -#define ARRAY2_DIM1 3 -#define ARRAY2_DIM2 4 -#define ARRAY2_DIM3 5 +#define ARRAY2_RANK 3 +#define ARRAY2_DIM1 3 +#define ARRAY2_DIM2 4 +#define ARRAY2_DIM3 5 /* 2-D array datatype */ -#define ARRAY3_RANK 2 -#define ARRAY3_DIM1 6 -#define ARRAY3_DIM2 3 +#define ARRAY3_RANK 2 +#define ARRAY3_DIM1 6 +#define ARRAY3_DIM2 3 /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 -/**************************************************************** -** -** test_array_atomic_1d(): Test basic array datatype code. -** Tests 1-D array of atomic datatypes -** -****************************************************************/ +/* Parameters used with the test_array_bkg() test */ +#define FIELDNAME "ArrayofStructures" +#define LENGTH 5 +#define ALEN 10 +#define RANK 1 +#define NMAX 100 + +/* Struct used with test_array_bkg() test */ +typedef struct +{ + int nsubfields; + char *name[NMAX]; + size_t offset[NMAX]; + hid_t datatype[NMAX]; + +} CmpDTSinfo; + +/* Forward declarations for custom vlen memory manager functions */ +void *test_array_alloc_custom(size_t size, void *info); +void test_array_free_custom(void *mem, void *info); + + +/*------------------------------------------------------------------------- + * Function: test_array_atomic_1d + * + * Purpose: Test basic array datatype code. + * Tests 1-D array of atomic datatypes. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_atomic_1d(void) { - int wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - int rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int ndims; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - int i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + int wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + int rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int ndims; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + int i,j; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Array of Atomic Datatypes Functionality\n")); @@ -167,23 +193,28 @@ test_array_atomic_1d(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_atomic_1d() */ -/**************************************************************** -** -** test_array_funcs(): Test some type functions that are and -** aren't supposed to work with array type. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_funcs + * + * Purpose: Test some type functions that are and aren't supposed to + * work with array type. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_funcs(void) { - hid_t type; /* Datatype ID */ - hsize_t tdims1[] = {ARRAY1_DIM1}; - size_t size; - H5T_pad_t inpad; - H5T_norm_t norm; - H5T_cset_t cset; - H5T_str_t strpad; - herr_t ret; /* Generic return value */ + hid_t type; /* Datatype ID */ + hsize_t tdims1[] = {ARRAY1_DIM1}; + size_t size; + H5T_pad_t inpad; + H5T_norm_t norm; + H5T_cset_t cset; + H5T_str_t strpad; + herr_t ret; /* Generic return value */ /* Create a datatype to refer to */ type = H5Tarray_create2(H5T_IEEE_F32BE, ARRAY1_RANK, tdims1); @@ -223,29 +254,34 @@ test_array_funcs(void) /* Close datatype */ ret = H5Tclose(type); CHECK(ret, FAIL, "H5Tclose"); -} /* end test_array_funcs */ +} /* end test_array_funcs() */ -/**************************************************************** -** -** test_array_atomic_3d(): Test basic array datatype code. -** Tests 3-D array of atomic datatypes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_atomic_3d + * + * Purpose: Test basic array datatype code. + * Tests 3-D array of atomic datatypes. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_atomic_3d(void) { int wdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information to write */ int rdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information read in */ - hid_t fid; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3}; - int ndims; /* Array rank for reading */ - hsize_t rdims2[H5S_MAX_RANK]; /* Array dimensions for reading */ - int i,j,k,l; /* counting variables */ - herr_t ret; /* Generic return value */ + hid_t fid; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3}; + int ndims; /* Array rank for reading */ + hsize_t rdims2[H5S_MAX_RANK]; /* Array dimensions for reading */ + int i,j,k,l; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 3-D Array of Atomic Datatypes Functionality\n")); @@ -349,31 +385,36 @@ test_array_atomic_3d(void) } /* end test_array_atomic_3d() */ -/**************************************************************** -** -** test_array_array_atomic(): Test basic array datatype code. -** Tests 1-D array 2-D arrays of atomic datatypes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_array_atomic + * + * Purpose: Test basic array datatype code. + * Tests 1-D array 2-D arrays of atomic datatypes. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_array_atomic(void) { int wdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information to write */ int rdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information read in */ - hid_t fid; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid1; /* 1-D array Datatype ID */ - hid_t tid2; /* 2-D array Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2}; - int ndims1; /* Array rank for reading */ - int ndims2; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - hsize_t rdims2[H5S_MAX_RANK]; /* Array dimensions for reading */ - int i,j,k,l; /* counting variables */ - herr_t ret; /* Generic return value */ + hid_t fid; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid1; /* 1-D array Datatype ID */ + hid_t tid2; /* 2-D array Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2}; + int ndims1; /* Array rank for reading */ + int ndims2; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + hsize_t rdims2[H5S_MAX_RANK]; /* Array dimensions for reading */ + int i,j,k,l; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Array 2-D Arrays of Atomic Datatypes Functionality\n")); @@ -503,12 +544,17 @@ test_array_array_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_array_atomic() */ -/**************************************************************** -** -** test_array_compound_atomic(): Test basic array datatype code. -** Tests 1-D array of compound datatypes (with no array fields) -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_compound_atomic + * + * Purpose: Test basic array datatype code. + * Tests 1-D array of compound datatypes (with no array fields). + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_compound_atomic(void) { @@ -516,23 +562,24 @@ test_array_compound_atomic(void) int i; float f; } s1_t; - s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* Compound Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int ndims; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - int nmemb; /* Number of compound members */ - char *mname; /* Name of compound field */ - size_t off; /* Offset of compound field */ - hid_t mtid; /* Datatype ID for field */ - int i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + + s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* Compound Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int ndims; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + int nmemb; /* Number of compound members */ + char *mname; /* Name of compound field */ + size_t off; /* Offset of compound field */ + hid_t mtid; /* Datatype ID for field */ + int i,j; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Array of Compound Atomic Datatypes Functionality\n")); @@ -704,12 +751,17 @@ test_array_compound_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_compound_atomic() */ -/**************************************************************** -** -** test_array_compound_array(): Test basic array datatype code. -** Tests 1-D array of compound datatypes (with array fields) -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_compound_array + * + * Purpose: Test basic array datatype code. + * Tests 1-D array of compound datatypes (with array fields). + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_compound_array(void) { @@ -717,25 +769,26 @@ test_array_compound_array(void) int i; float f[ARRAY1_DIM1]; } s1_t; - s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* Compound Datatype ID */ - hid_t tid3; /* Nested Array Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int ndims; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - int nmemb; /* Number of compound members */ - char *mname; /* Name of compound field */ - size_t off; /* Offset of compound field */ - hid_t mtid; /* Datatype ID for field */ - H5T_class_t mclass; /* Datatype class for field */ - int i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + + s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* Compound Datatype ID */ + hid_t tid3; /* Nested Array Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int ndims; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + int nmemb; /* Number of compound members */ + char *mname; /* Name of compound field */ + size_t off; /* Offset of compound field */ + hid_t mtid; /* Datatype ID for field */ + H5T_class_t mclass; /* Datatype class for field */ + int i,j,k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Array of Compound Array Datatypes Functionality\n")); @@ -949,9 +1002,6 @@ test_array_compound_array(void) } /* end test_array_compound_array() */ -void *test_array_alloc_custom(size_t size, void *info); -void test_array_free_custom(void *mem, void *info); - /**************************************************************** ** ** test_array_alloc_custom(): Test VL datatype custom memory @@ -960,11 +1010,29 @@ void test_array_free_custom(void *mem, void *info); ** allocated. ** ****************************************************************/ -void *test_array_alloc_custom(size_t size, void *info) + +/*------------------------------------------------------------------------- + * Function: test_array_alloc_custom + * + * Purpose: Memory allocator for testing VL datatype custom memory + * allocation routines. + * + * This routine just uses malloc to allocate the memory and + * increments the amount of memory allocated. + * + * Return: + * + * Success: A memory buffer + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +void * +test_array_alloc_custom(size_t size, void *info) { - void *ret_value = NULL; /* Pointer to return */ - size_t *mem_used = (size_t *)info; /* Get the pointer to the memory used */ - size_t extra; /* Extra space needed */ + void *ret_value = NULL; /* Pointer to return */ + size_t *mem_used = (size_t *)info; /* Pointer to the memory used */ + size_t extra; /* Extra space needed */ /* * This weird contortion is required on the DEC Alpha to keep the @@ -976,23 +1044,31 @@ void *test_array_alloc_custom(size_t size, void *info) *(size_t *)ret_value = size; *mem_used += size; } /* end if */ + ret_value = ((unsigned char *)ret_value) + extra; return ret_value; -} +} /* end test_array_alloc_custom() */ -/**************************************************************** -** -** test_array_free_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses free to -** release the memory and decrements the amount of memory -** allocated. -** -****************************************************************/ -void test_array_free_custom(void *_mem, void *info) + +/*------------------------------------------------------------------------- + * Function: test_array_free_custom + * + * Purpose: Memory free function for testing VL datatype custom memory + * allocation routines. + * + * This routine just uses free to free the memory and + * decrements the amount of memory allocated. + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +test_array_free_custom(void *_mem, void *info) { - unsigned char *mem = NULL; - size_t *mem_used = (size_t *)info; /* Get the pointer to the memory used */ - size_t extra; /* Extra space needed */ + unsigned char *mem = NULL; /* Pointer to mem to be freed */ + size_t *mem_used = (size_t *)info; /* Pointer to the memory used */ + size_t extra; /* Extra space needed */ /* * This weird contortion is required on the DEC Alpha to keep the @@ -1005,35 +1081,42 @@ void test_array_free_custom(void *_mem, void *info) *mem_used -= *(size_t *)mem; HDfree(mem); } /* end if */ -} -/**************************************************************** -** -** test_array_vlen_atomic(): Test basic array datatype code. -** Tests 1-D array of atomic VL datatypes -** -****************************************************************/ + return; +} /* end test_array_free_custom() */ + + +/*------------------------------------------------------------------------- + * Function: test_array_vlen_atomic + * + * Purpose: Test basic array datatype code. + * Tests 1-D array of atomic VL datatypes. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_vlen_atomic(void) { - hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - hvl_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* VL Datatype ID */ - hid_t tid3; /* Atomic Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int ndims; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - H5T_class_t mclass; /* Datatype class for VL */ - hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t size; /* Number of bytes which will be used */ - size_t mem_used=0; /* Memory used during allocation */ - int i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + hvl_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* VL Datatype ID */ + hid_t tid3; /* Atomic Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int ndims; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + H5T_class_t mclass; /* Datatype class for VL */ + hid_t xfer_pid; /* Dataset transfer property list ID */ + hsize_t size; /* Number of bytes which will be used */ + size_t mem_used=0; /* Memory used during allocation */ + int i,j,k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Array of Atomic Variable-Length Datatypes Functionality\n")); @@ -1217,34 +1300,39 @@ test_array_vlen_atomic(void) } /* end test_array_vlen_atomic() */ -/**************************************************************** -** -** test_array_vlen_array(): Test basic array datatype code. -** Tests 1-D array of 1-D array VL datatypes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_vlen_array + * + * Purpose: Test basic array datatype code. + * Tests 1-D array of 1-D array VL datatypes. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_vlen_array(void) { - hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - hvl_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* VL Datatype ID */ - hid_t tid3; /* Nested Array Datatype ID */ - hid_t tid4; /* Atomic Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int ndims; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - H5T_class_t mclass; /* Datatype class for VL */ - hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t size; /* Number of bytes which will be used */ - size_t mem_used=0; /* Memory used during allocation */ - int i,j,k,l; /* Index variables */ - herr_t ret; /* Generic return value */ + hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + hvl_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* VL Datatype ID */ + hid_t tid3; /* Nested Array Datatype ID */ + hid_t tid4; /* Atomic Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int ndims; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + H5T_class_t mclass; /* Datatype class for VL */ + hid_t xfer_pid; /* Dataset transfer property list ID */ + hsize_t size; /* Number of bytes which will be used */ + size_t mem_used=0; /* Memory used during allocation */ + int i,j,k,l; /* Index variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Array of 1-D Array Variable-Length Datatypes Functionality\n")); @@ -1467,28 +1555,18 @@ test_array_vlen_array(void) } /* end test_array_vlen_array() */ -#define FIELDNAME "ArrayofStructures" -#define LENGTH 5 -#define ALEN 10 -#define RANK 1 -#define NMAX 100 - -typedef struct -{ - int nsubfields; - char *name[NMAX]; - size_t offset[NMAX]; - hid_t datatype[NMAX]; - -} CmpDTSinfo; - -/**************************************************************** -** -** test_array_bkg(): Test basic array datatype code. -** Tests reading compound datatype with array fields and -** writing partial fields. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array_bkg + * + * Purpose: Test basic array datatype code. + * Tests reading compound datatype with array fields and + * writing partial fields. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_array_bkg(void) { @@ -1531,10 +1609,10 @@ test_array_bkg(void) CHECK(dtsinfo, NULL, "HDmalloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { - for (j = 0; j < ALEN; j++) { - cf[i].a[j] = 100 * (i + 1) + j; - cf[i].b[j] = 100.0F * ((float)i + 1.0F) + 0.01F * (float)j; - cf[i].c[j] = (double)(100.0F * ((float)i + 1.0F) + 0.02F * (float)j); + for (j = 0; j < ALEN; j++) { + cf[i].a[j] = 100 * (i + 1) + j; + cf[i].b[j] = 100.0F * ((float)i + 1.0F) + 0.01F * (float)j; + cf[i].c[j] = (double)(100.0F * ((float)i + 1.0F) + 0.02F * (float)j); } /* end for */ } /* end for */ @@ -1561,9 +1639,9 @@ test_array_bkg(void) for (i = 0; i < dtsinfo->nsubfields; i++) dtsinfo->name[i] = (char *)HDcalloc((size_t)20, sizeof(char)); - strcpy(dtsinfo->name[0], "One"); - strcpy(dtsinfo->name[1], "Two"); - strcpy(dtsinfo->name[2], "Three"); + HDstrcpy(dtsinfo->name[0], "One"); + HDstrcpy(dtsinfo->name[1], "Two"); + HDstrcpy(dtsinfo->name[2], "Three"); /* Create file */ @@ -1745,7 +1823,7 @@ test_array_bkg(void) /* Reset the data to read in */ /* ------------------------- */ - memset(cfr, 0, sizeof(CmpField)*LENGTH); + HDmemset(cfr, 0, sizeof(CmpField)*LENGTH); status = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfr); CHECK(status, FAIL, "H5Dread"); @@ -1781,32 +1859,38 @@ test_array_bkg(void) HDfree(dtsinfo); } /* end test_array_bkg() */ -/**************************************************************** -** -** test_compat(): Test array datatype compatibility code. -** Reads file containing old version of datatype object header -** messages for compound datatypes and verifies reading the older -** version of the is working correctly. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_compat + * + * Purpose: Test array datatype compatibility code. + * + * Reads file containing old version of datatype object header + * messages for compound datatypes and verifies reading the older + * version of the is working correctly. + * + * Return: void + * + *------------------------------------------------------------------------- + */ static void test_compat(void) { const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* Datatype ID */ - hsize_t tdims1[] = {ARRAY1_DIM1}; - int ndims; /* Array rank for reading */ - hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ - H5T_class_t mclass; /* Datatype class for VL */ - int nmemb; /* Number of compound members */ - char *mname; /* Name of compound field */ - size_t off; /* Offset of compound field */ - hid_t mtid; /* Datatype ID for field */ - int i; /* Index variables */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* Datatype ID */ + hsize_t tdims1[] = {ARRAY1_DIM1}; + int ndims; /* Array rank for reading */ + hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */ + H5T_class_t mclass; /* Datatype class for VL */ + int nmemb; /* Number of compound members */ + char *mname; /* Name of compound field */ + size_t off; /* Offset of compound field */ + hid_t mtid; /* Datatype ID for field */ + int i; /* Index variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Array Datatypes Compatibility Functionality\n")); @@ -2064,17 +2148,22 @@ test_compat(void) /* Close the file */ ret = H5Fclose(fid1); CHECK_I(ret, "H5Fclose"); - } + } /* end if */ else printf("***cannot open the pre-created compound datatype test file (%s)\n",testfile); } /* end test_compat() */ -/**************************************************************** -** -** test_array(): Main array datatype testing routine. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_array + * + * Purpose: Main array datatype testing routine. + * + * Return: void + * + *------------------------------------------------------------------------- + */ void test_array(void) { @@ -2082,39 +2171,38 @@ test_array(void) MESSAGE(5, ("Testing Array Datatypes\n")); /* These tests use the same file... */ - test_array_atomic_1d(); /* Test 1-D array of atomic datatypes */ - test_array_atomic_3d(); /* Test 3-D array of atomic datatypes */ - test_array_array_atomic(); /* Test 1-D array of 2-D arrays of atomic datatypes */ - test_array_compound_atomic(); /* Test 1-D array of compound datatypes (with no array fields) */ - test_array_compound_array(); /* Test 1-D array of compound datatypes (with array fields) */ - test_array_vlen_atomic(); /* Test 1-D array of atomic VL datatypes */ - test_array_vlen_array(); /* Test 1-D array of 1-D array VL datatypes */ - test_array_funcs(); /* Test type functions with array types */ + test_array_atomic_1d(); /* Test 1-D array of atomic datatypes */ + test_array_atomic_3d(); /* Test 3-D array of atomic datatypes */ + test_array_array_atomic(); /* Test 1-D array of 2-D arrays of atomic datatypes */ + test_array_compound_atomic(); /* Test 1-D array of compound datatypes (with no array fields) */ + test_array_compound_array(); /* Test 1-D array of compound datatypes (with array fields) */ + test_array_vlen_atomic(); /* Test 1-D array of atomic VL datatypes */ + test_array_vlen_array(); /* Test 1-D array of 1-D array VL datatypes */ + test_array_funcs(); /* Test type functions with array types */ - test_array_bkg(); /* Read compound datatype with array fields and background fields read */ + test_array_bkg(); /* Read compound datatype with array fields and background fields read */ /* This test uses a custom file */ - test_compat(); /* Test compatibility changes for compound datatype fields */ -} /* test_array() */ + test_compat(); /* Test compatibility changes for compound datatype fields */ + +} /* end test_array() */ /*------------------------------------------------------------------------- - * Function: cleanup_array + * Function: cleanup_array * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: void * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_array(void) { remove(FILENAME); -} +} /* end cleanup_array() */ diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 00ec760..c256e11 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -4,7 +4,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - + # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- @@ -12,6 +12,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/non_existing.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl @@ -284,6 +285,7 @@ ) set (HDF5_ERROR_REFERENCE_TEST_FILES ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err + ${PROJECT_SOURCE_DIR}/errfiles/non_existing.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err @@ -325,7 +327,7 @@ ARGS -E copy_if_different ${tst_h5_file} ${dest} ) endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - + foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) @@ -373,7 +375,7 @@ COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl ) - + if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") @@ -385,7 +387,7 @@ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp ) endif (WIN32) - + ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -730,7 +732,7 @@ add_test ( NAME H5DUMP-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove h5dump-help.out charsets.out charsets.out.err @@ -738,6 +740,8 @@ file_space.out.err filter_fail.out filter_fail.out.err + non_existing.out + non_existing.out.err packedbits.out packedbits.out.err tall-1.out @@ -1075,9 +1079,9 @@ ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) ADD_H5_TEST_EXPORT (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -y -o) - + ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o) - + # test for maximum display datasets ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) @@ -1147,7 +1151,7 @@ # test for named data types ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) ADD_H5_TEST_N (tcomp-2 0 --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5) - # test for unamed type + # test for unamed type ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") # test complicated compound datatype ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) @@ -1169,7 +1173,7 @@ # test for loop detection ADD_H5_TEST (tloop-1 0 --enable-error-stack tloop.h5) - # test for string + # test for string ADD_H5_TEST (tstr-1 0 --enable-error-stack tstr.h5) ADD_H5_TEST (tstr-2 0 --enable-error-stack tstr2.h5) @@ -1202,7 +1206,7 @@ #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) @@ -1263,7 +1267,7 @@ ADD_H5_TEST (tcontiguos 0 --enable-error-stack -H -p -d contiguous tfilters.h5) # chunked ADD_H5_TEST (tchunked 0 --enable-error-stack -H -p -d chunked tfilters.h5) - # external + # external ADD_H5_TEST (texternal 0 --enable-error-stack -H -p -d external tfilters.h5) # fill values @@ -1331,7 +1335,7 @@ # don't have). Do this by searching H5pubconf.h to see which # filters are defined. -# detect whether the encoder is present. +# detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") endif (H5_HAVE_FILTER_DEFLATE) @@ -1352,12 +1356,12 @@ # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) - # dimensions over 4GB, print boundary + # dimensions over 4GB, print boundary ADD_H5_TEST (tbigdims 0 --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5) # hyperslab read ADD_H5_TEST (thyperslab 0 --enable-error-stack thyperslab.h5) - + # test for displaying dataset and attribute of null space ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) @@ -1391,7 +1395,7 @@ ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - # test for dataset region references + # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5) @@ -1414,7 +1418,7 @@ # tests for link references and order ADD_H5ERR_MASK_TEST (torderlinks1 0 --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5) ADD_H5ERR_MASK_TEST (torderlinks2 0 --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5) - + # tests for floating point user defined printf format ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5) @@ -1430,3 +1434,6 @@ # test for -o -y for dataset with attributes ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) + + # test for non-existing file + ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5) diff --git a/tools/h5dump/errfiles/non_existing.err b/tools/h5dump/errfiles/non_existing.err new file mode 100644 index 0000000..f7e3afa --- /dev/null +++ b/tools/h5dump/errfiles/non_existing.err @@ -0,0 +1 @@ +h5dump error: unable to open file "non_existing.h5" diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 68889c9..ffba581 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -620,7 +620,7 @@ parse_hsize_list(const char *h_list, subset_d *d) size_count++; last_digit = 1; - } + } else { last_digit = 0; } @@ -643,7 +643,7 @@ parse_hsize_list(const char *h_list, subset_d *d) } d->data = p_list; d->len = size_count; - + return; } @@ -705,7 +705,7 @@ parse_subset_params(char *dset) * * Purpose: Parse a list of comma or space separated integers and fill * the packed_bits list and counter. The string being passed into this function - * should be at the start of the list you want to parse. + * should be at the start of the list you want to parse. * * Return: Success: SUCCEED * @@ -831,7 +831,7 @@ static void free_handler(struct handler_t *hand, int len) { int i; - + if(hand) { for (i = 0; i < len; i++) { if(hand[i].obj) { @@ -1161,7 +1161,7 @@ parse_start: } if (HDstrcmp(opt_arg,":") == 0) { xmlnsprefix = ""; - } + } else { xmlnsprefix = opt_arg; } @@ -1187,7 +1187,7 @@ parse_start: * the two. */ s = last_dset->subset_info; - } + } else { last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); } @@ -1358,7 +1358,7 @@ main(int argc, const char *argv[]) /* Disable tools error reporting */ H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - + if((hand = parse_command_line(argc, argv))==NULL) { goto done; } @@ -1444,12 +1444,12 @@ main(int argc, const char *argv[]) if (xml_dtd_uri == NULL) { if (useschema) { xml_dtd_uri = DEFAULT_XSD; - } + } 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"); @@ -1486,7 +1486,7 @@ main(int argc, const char *argv[]) /* start to dump - display file header information */ if (!doxml) { begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); - } + } else { PRINTVALSTREAM(rawoutstream, "\n"); @@ -1495,7 +1495,7 @@ main(int argc, const char *argv[]) if (HDstrcmp(xmlnsprefix,"") == 0) { PRINTSTREAM(rawoutstream, "\n", xml_dtd_uri); - } + } else { /* TO DO: make -url option work in this case (may need new option) */ char *ns; @@ -1511,7 +1511,7 @@ main(int argc, const char *argv[]) "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); HDfree(ns); } - } + } else { PRINTSTREAM(rawoutstream, "\n", xml_dtd_uri); PRINTVALSTREAM(rawoutstream, "\n"); @@ -1570,7 +1570,7 @@ main(int argc, const char *argv[]) if (!doxml) { end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); PRINTVALSTREAM(rawoutstream, "\n"); - } + } else { PRINTSTREAM(rawoutstream, "\n", xmlnsprefix); } @@ -1581,13 +1581,17 @@ main(int argc, const char *argv[]) if (H5Fclose(fid) < 0) h5tools_setstatus(EXIT_FAILURE); - if(prefix) + if(prefix) { HDfree(prefix); - if(fname) + prefix = NULL; + } + if(fname) { HDfree(fname); + fname = NULL; + } } /* end while */ - if(hand) + if(hand) free_handler(hand, argc); /* To Do: clean up XML table */ @@ -1601,13 +1605,17 @@ done: if(fid >=0) if (H5Fclose(fid) < 0) h5tools_setstatus(EXIT_FAILURE); - - if(prefix) + + if(prefix) { HDfree(prefix); - if(fname) + prefix = NULL; + } + if(fname) { HDfree(fname); + fname = NULL; + } - if(hand) + if(hand) free_handler(hand, argc); /* To Do: clean up XML table */ @@ -1660,20 +1668,20 @@ h5_fileaccess(void) if (!HDstrcmp(name, "sec2")) { /* Unix read() and write() system calls */ if (H5Pset_fapl_sec2(fapl)<0) return -1; - } + } else if (!HDstrcmp(name, "stdio")) { /* Standard C fread() and fwrite() system calls */ if (H5Pset_fapl_stdio(fapl)<0) return -1; - } + } else if (!HDstrcmp(name, "core")) { /* In-core temporary file with 1MB increment */ if (H5Pset_fapl_core(fapl, 1024*1024, FALSE)<0) return -1; - } + } else if (!HDstrcmp(name, "split")) { /* Split meta data and raw data each using default driver */ if (H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) return -1; - } + } else if (!HDstrcmp(name, "multi")) { /* Multi-file driver, general case of the split driver */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; @@ -1699,7 +1707,7 @@ h5_fileaccess(void) if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) return -1; - } + } else if (!HDstrcmp(name, "family")) { hsize_t fam_size = 100*1024*1024; /*100 MB*/ @@ -1708,7 +1716,7 @@ h5_fileaccess(void) fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1; - } + } else if (!HDstrcmp(name, "log")) { long log_flags = H5FD_LOG_LOC_IO; @@ -1718,12 +1726,12 @@ h5_fileaccess(void) if (H5Pset_fapl_log(fapl, NULL, (unsigned)log_flags, 0) < 0) return -1; - } + } else if (!HDstrcmp(name, "direct")) { /* Substitute Direct I/O driver with sec2 driver temporarily because * some output has sec2 driver as the standard. */ if (H5Pset_fapl_sec2(fapl)<0) return -1; - } + } else { /* Unknown driver */ return -1; diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 95f8091..267ac44 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -27,10 +27,10 @@ EXIT_FAILURE=1 DUMPER=h5dump # The tool name DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary -H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF=../h5diff/h5diff # The h5diff tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary -H5IMPORT=../h5import/h5import # The h5import tool name +H5IMPORT=../h5import/h5import # The h5import tool name H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary RM='rm -rf' @@ -176,6 +176,7 @@ LIST_OTHER_TEST_FILES=" $SRC_H5DUMP_TESTFILES/charsets.ddl $SRC_H5DUMP_TESTFILES/file_space.ddl $SRC_H5DUMP_TESTFILES/filter_fail.ddl +$SRC_H5DUMP_TESTFILES/non_existing.ddl $SRC_H5DUMP_TESTFILES/packedbits.ddl $SRC_H5DUMP_TESTFILES/tall-1.ddl $SRC_H5DUMP_TESTFILES/tall-2.ddl @@ -266,7 +267,7 @@ $SRC_H5DUMP_TESTFILES/tindicessub4.ddl $SRC_H5DUMP_TESTFILES/tindicesyes.ddl $SRC_H5DUMP_TESTFILES/tintsattrs.ddl $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl -#$SRC_H5DUMP_TESTFILES/tldouble.ddl +#$SRC_H5DUMP_TESTFILES/tldouble.ddl $SRC_H5DUMP_TESTFILES/tlonglinks.ddl $SRC_H5DUMP_TESTFILES/tloop-1.ddl $SRC_H5DUMP_TESTFILES/tmulti.ddl @@ -347,6 +348,7 @@ $SRC_H5DUMP_TESTFILES/tbinregR.exp LIST_ERROR_TEST_FILES=" ${SRC_H5DUMP_ERRORFILES}/filter_fail.err +${SRC_H5DUMP_ERRORFILES}/non_existing.err ${SRC_H5DUMP_ERRORFILES}/tall-1.err ${SRC_H5DUMP_ERRORFILES}/tall-2A.err ${SRC_H5DUMP_ERRORFILES}/tall-2A0.err @@ -393,10 +395,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -441,14 +443,14 @@ TESTING() { TOOLTEST() { # check if caseless compare and diff requested if [ "$1" = ignorecase ]; then - caseless="-i" - # replace cmp with diff which runs much longer. - xCMP="$DIFF -i" - shift + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift else - caseless="" - # stick with faster cmp if ignorecase is not requested. - xCMP="$CMP" + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" fi expect="$TESTDIR/$1" @@ -537,7 +539,7 @@ TOOLTEST2() { 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 @@ -545,7 +547,7 @@ TOOLTEST2() { } -# same as TOOLTEST2 but compares generated file to expected ddl file +# same as TOOLTEST2 but compares generated file to expected ddl file # 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 # ADD_H5_TEST_EXPORT @@ -603,7 +605,7 @@ TOOLTEST2A() { 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 $actualmeta @@ -642,7 +644,7 @@ TOOLTEST2B() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err @@ -859,7 +861,7 @@ TOOLTEST_HELP() { echo " Expected output (*.txt) differs from actual output (*.out)" nerrors="`expr $nerrors + 1`" fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actual_err @@ -872,7 +874,7 @@ SKIP() { TESTING $DUMPER $@ echo " -SKIP-" } - + # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { @@ -883,7 +885,7 @@ PRINT_H5DIFF() { # Call the h5diff tool # -DIFFTEST() +DIFFTEST() { PRINT_H5DIFF $@ ( @@ -897,7 +899,7 @@ DIFFTEST() else echo " PASSED" fi - + } # Print a line-line message left justified in a field of 70 characters @@ -910,7 +912,7 @@ PRINT_H5IMPORT() { # Call the h5import tool # -IMPORTTEST() +IMPORTTEST() { # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" @@ -921,7 +923,7 @@ IMPORTTEST() PRINT_H5IMPORT $@ ( cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? if [ $RET != 0 ] ; then @@ -930,7 +932,7 @@ IMPORTTEST() else echo " PASSED" fi - + } @@ -1021,7 +1023,7 @@ TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5 # test for named data types TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5 -# test for unamed type +# test for unamed type TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 @@ -1041,7 +1043,7 @@ TOOLTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5 # test for loop detection TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5 -# test for string +# test for string TOOLTEST tstr-1.ddl --enable-error-stack tstr.h5 TOOLTEST tstr-2.ddl --enable-error-stack tstr2.h5 @@ -1136,7 +1138,7 @@ TOOLTEST tcompact.ddl --enable-error-stack -H -p -d compact tfilters.h5 TOOLTEST tcontiguos.ddl --enable-error-stack -H -p -d contiguous tfilters.h5 # chunked TOOLTEST tchunked.ddl --enable-error-stack -H -p -d chunked tfilters.h5 -# external +# external TOOLTEST texternal.ddl --enable-error-stack -H -p -d external tfilters.h5 # fill values @@ -1205,7 +1207,7 @@ fi # test for displaying objects with very long names TOOLTEST tlonglinks.ddl --enable-error-stack tlonglinks.h5 -# dimensions over 4GB, print boundary +# dimensions over 4GB, print boundary TOOLTEST tbigdims.ddl --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5 # hyperslab read @@ -1213,7 +1215,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # - + # test for displaying dataset and attribute of null space TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 @@ -1252,7 +1254,7 @@ IMPORTTEST out3.bin -c tbin3.ddl -o out3D.h5 DIFFTEST tbinary.h5 out3D.h5 /integer /integer TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5 - + # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then rm -f out[1-4].bin @@ -1260,7 +1262,7 @@ if test -z "$HDF5_NOCLEANUP"; then rm -f out3.h5 fi -# test for dataset region references +# test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 @@ -1306,6 +1308,9 @@ TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5 +# test for non-existing file +TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5 + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/testfiles/non_existing.ddl b/tools/testfiles/non_existing.ddl new file mode 100644 index 0000000..4377f8d --- /dev/null +++ b/tools/testfiles/non_existing.ddl @@ -0,0 +1,31 @@ +HDF5 "tgroup.h5" { +GROUP "/" { + GROUP "g1" { + GROUP "g1.1" { + } + GROUP "g1.2" { + } + } + GROUP "g2" { + GROUP "g2.1" { + GROUP "g2.1.1" { + } + GROUP "g2.1.2" { + } + GROUP "g2.1.3" { + } + } + } + GROUP "g3" { + GROUP "g3.1" { + } + GROUP "g3.2" { + } + GROUP "g3.3" { + } + GROUP "g3.4" { + } + } +} +} +h5dump error: unable to open file "non_existing.h5" -- cgit v0.12