diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-02-11 20:28:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-02-11 20:28:56 (GMT) |
commit | 4ec2df9ac08f0c28eb32211c3cb0139a73f82981 (patch) | |
tree | 5fd3daa9f8168cfb46902bd62ad070c6639796de | |
parent | bd5d6e4e772fe557ab52f881df17f73a4028184b (diff) | |
download | hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.zip hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.tar.gz hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.tar.bz2 |
Merge from dev, sanitizer, fortran, warnings and tools ids
50 files changed, 946 insertions, 887 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index faeac44..0127bcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required (VERSION 3.10) project (HDF5 C) -if(POLICY CMP0074) - cmake_policy(SET CMP0074 NEW) -endif() +if (POLICY CMP0074) + cmake_policy (SET CMP0074 NEW) +endif () #----------------------------------------------------------------------------- # Instructions for use : Normal Build @@ -15,7 +15,7 @@ endif() # Make install can be used to install all components for system-wide use. # if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) - MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n" + message (FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n" "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" " == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n" "NEXT STEPS:\n" @@ -100,7 +100,7 @@ mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX) # # Add the sub project # add_subdirectory (Utilities/hdf5-1.8) #----------------------------------------------------------------------------- -string(TIMESTAMP CONFIG_DATE "%Y-%m-%d") +string (TIMESTAMP CONFIG_DATE "%Y-%m-%d") #----------------------------------------------------------------------------- # Allow Visual Studio solution directories @@ -440,6 +440,7 @@ set (H5_ENABLE_STATIC_LIB NO) option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) set (H5_ENABLE_SHARED_LIB NO) option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF) +mark_as_advanced (ONLY_SHARED_LIBS) if (BUILD_STATIC_LIBS) set (H5_ENABLE_STATIC_LIB YES) @@ -460,6 +461,12 @@ endif () set (CMAKE_POSITION_INDEPENDENT_CODE ON) +if (NOT BUILD_SHARED_LIBS) + set (tgt_file_ext "") +else () + set (tgt_file_ext "-shared") +endif () + #----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- @@ -485,7 +492,7 @@ option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" O if (HDF5_ENABLE_COVERAGE) include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake) if(CODE_COVERAGE AND CODE_COVERAGE_ADDED) - add_code_coverage() # Adds instrumentation to all targets + add_code_coverage () # Adds instrumentation to all targets else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage") @@ -776,8 +783,8 @@ if (HDF5_ENABLE_THREADSAFE) message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") endif () endif () - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) + set (THREADS_PREFER_PTHREAD_FLAG ON) + find_package (Threads REQUIRED) if (Threads_FOUND) set (H5_HAVE_THREADSAFE 1) endif () @@ -139,6 +139,12 @@ ./config/pgi-flags ./config/solaris +#warnings files for both autotools and CMake +./config/gnu-warnings-general +./config/gnu-warnings-developer-general +./config/gnu-warnings-no-developer-general +./config/intel-warnings-general + ./config/site-specific/BlankForm ./examples/Attributes.txt diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 1b8d7d7..5a0947c 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -25,6 +25,7 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION # "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" # "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" "src.ZLIB.*:[ \t]*warning" + "warning LNK4197:.*ZLIB-prefix" "src.SZIP.*:[ \t]*warning" # "POSIX name for this item is deprecated" "disabling jobserver mode" diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index c803384..100ada3 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -12,6 +12,24 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED TRUE) +macro (ADD_H5_FLAGS h5_flag_var infile) + file (STRINGS ${infile} TEST_FLAG_STREAM) + #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + list (LENGTH TEST_FLAG_STREAM len_flag) + if (len_flag GREATER 0) + math (EXPR _FP_LEN "${len_flag} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET TEST_FLAG_STREAM ${line} str_flag) + string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") + #message (STATUS "str_flag=${str_flag}") + if (str_flag) + set (${h5_flag_var} "${${h5_flag_var}} ${str_flag}") + endif () + endforeach () + endif () + #message (STATUS "h5_flag_var=${${h5_flag_var}}") +endmacro () + message (STATUS "Warnings Configuration:") set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") #----------------------------------------------------------------------------- @@ -95,7 +113,9 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it at configure time. if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcheck -Wall") + ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/intel-warnings-general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith") set (H5_CFLAGS0 "${H5_CFLAGS0} -Wreturn-type -Wstrict-prototypes -Wuninitialized") set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunknown-pragmas -Wunused-function -Wunused-variable") @@ -106,16 +126,19 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) set (H5_CFLAGS0 "${H5_CFLAGS0} -Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wno-c++-compat -Wcast-align") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings") + ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wcast-align") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wdeclaration-after-statement -Wdisabled-optimization") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-declarations") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default") + set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunused-macros -Wunsafe-loop-optimizations") # gcc automatically inlines based on the optimization level # this is just a failsafe set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions") + message (STATUS "H5_CFLAGS0=${H5_CFLAGS0}") endif () endif () @@ -129,11 +152,13 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "Intel") set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Wreorder -Wport -Wstrict-aliasing") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn") + ADD_H5_FLAGS (CMAKE_C_FLAGS_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-developer-general") + set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_DEV_GENERAL}") endif () else () if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn") + ADD_H5_FLAGS (CMAKE_C_FLAGS_NO_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-no-developer-general") + set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_NO_DEV_GENERAL}") endif () endif () diff --git a/config/gnu-flags b/config/gnu-flags index a5f3258..f23ad68 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -17,6 +17,21 @@ # if the compiler is not GNU; otherwise 'cc_flags_set' is set to 'yes' # +# +# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_gcc_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/gnu-${arg} + done) + IFS=' ' echo "$*" +} + + # Get the compiler version in a way that works for gcc # unless a compiler version is already known # @@ -138,7 +153,7 @@ if test "X-gcc" = "X-$cc_vendor"; then ################ # Optimization # ################ - + if test $cc_vers_major -le 4; then HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS= @@ -171,12 +186,13 @@ if test "X-gcc" = "X-$cc_vendor"; then # NOTE: Due to the divergence in the C and C++, we're dropping support for # compiling the C library with a C++ compiler and dropping the -Wc++-compat # warning. - H5_CFLAGS="$H5_CFLAGS -pedantic -Wall -Wextra -Wbad-function-cast -Wno-c++-compat -Wcast-align" - H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" - H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments warnings-general)" + H5_CFLAGS="$H5_CFLAGS -Wbad-function-cast -Wcast-align" + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wdisabled-optimization" + H5_CFLAGS="$H5_CFLAGS -Wmissing-declarations" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked" - H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default" - H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" + H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default" + H5_CFLAGS="$H5_CFLAGS -Wunused-macros -Wunsafe-loop-optimizations" ###################### # Developer warnings # @@ -184,8 +200,8 @@ if test "X-gcc" = "X-$cc_vendor"; then # (suggestions from gcc, not code problems) # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS) - DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn -Wformat-nonliteral" - NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn" + NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-developer-general) ####################### # gcc 4 special cases # @@ -196,11 +212,11 @@ if test "X-gcc" = "X-$cc_vendor"; then H5_CFLAGS="$H5_CFLAGS -Wno-long-long" fi - # -Wvolatile-register-var was later incorporated into -Wall and - # only needs to be specified explicitly for gcc 4.2-4.3 + # -Wvolatile-register-var was later incorporated into -Wall and + # only needs to be specified explicitly for gcc 4.2-4.3 if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then - H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" - fi + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" + fi # -Wstrict-aliasing was later incorporated into -Wall and # only needs to be specified explicitly for gcc 4.5-4.6 @@ -223,10 +239,10 @@ if test "X-gcc" = "X-$cc_vendor"; then # Version-specific warnings # ############################# - # gcc 4.3 + # gcc 4.3 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" - fi + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" + fi # gcc 4.4 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then diff --git a/config/gnu-warnings-developer-general b/config/gnu-warnings-developer-general new file mode 100644 index 0000000..698f0e0 --- /dev/null +++ b/config/gnu-warnings-developer-general @@ -0,0 +1,8 @@ +# (suggestions from gcc, not code problems) +# NOTE: -Wformat-nonliteral added back in here (from being disabled in +# H5_CFLAGS) +-Waggregate-return +-Wformat-nonliteral +-Winline +-Wmissing-format-attribute +-Wmissing-noreturn diff --git a/config/gnu-warnings-general b/config/gnu-warnings-general new file mode 100644 index 0000000..9e67b71 --- /dev/null +++ b/config/gnu-warnings-general @@ -0,0 +1,32 @@ +# Note that some of the flags listed here really should be developer +# flags (listed in separate files, gnu-warnings-developer*) but we put +# them here because they are not raised by the current code and we'd like to +# know if they do start showing up. +# +# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) +# warnings that are emitted. If you need it, add it from the +# environment variable at configure time. +-Wall +-Wcast-qual +-Wconversion +-Wextra +-Wfloat-equal +-Wformat=2 +-Winit-self +-Winvalid-pch +-Wmissing-include-dirs +# +# NOTE: Due to the divergence in the C and C++, we're dropping support for +# compiling the C library with a C++ compiler and dropping the -Wc++-compat +# warning. +# +-Wno-c++-compat +# +# NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add +# it to the developer flags. +# +-Wno-format-nonliteral +-Wshadow +-Wundef +-Wwrite-strings +-pedantic
\ No newline at end of file diff --git a/config/gnu-warnings-no-developer-general b/config/gnu-warnings-no-developer-general new file mode 100644 index 0000000..85dc0a3 --- /dev/null +++ b/config/gnu-warnings-no-developer-general @@ -0,0 +1,4 @@ +-Wno-aggregate-return +-Wno-inline +-Wno-missing-format-attribute +-Wno-missing-noreturn diff --git a/config/intel-flags b/config/intel-flags index dad210c..6b4e406 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -17,6 +17,20 @@ # if the compiler is not Intel; otherwise `cc_flags_set' is set to `yes' # +# +# Prepend `$srcdir/config/intel-` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_intel_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/intel-${arg} + done) + IFS=' ' echo "$*" +} + # Get the compiler version in a way that works for icc # icc unless a compiler version is already known # @@ -66,7 +80,8 @@ if test "X-icc" = "X-$cc_vendor"; then # General # Default to C99 standard. - H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -Wcheck -Wall" + H5_CFLAGS="$H5_CFLAGS $arch -std=c99" + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments warnings-general)" # Production PROD_CFLAGS= diff --git a/config/intel-warnings-general b/config/intel-warnings-general new file mode 100644 index 0000000..f4ed24c --- /dev/null +++ b/config/intel-warnings-general @@ -0,0 +1,10 @@ +# Note that some of the flags listed here really should be developer +# flags (listed in separate files, gnu-warnings-developer*) but we put +# them here because they are not raised by the current code and we'd like to +# know if they do start showing up. +# +# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) +# warnings that are emitted. If you need it, add it from the +# environment variable at configure time. +-Wall +-Wcheck
\ No newline at end of file diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index dda9c5a..d42c8fe 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -266,7 +266,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>" ) target_compile_definitions(${HDF5_F90_LIB_TARGET} PRIVATE @@ -306,7 +306,7 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>" ) target_compile_definitions(${HDF5_F90_LIBSH_TARGET} PUBLIC diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 03f42ea..2bdb90c 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -132,7 +132,7 @@ if (NOT BUILD_SHARED_LIBS) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>" ) target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET} PRIVATE @@ -165,7 +165,7 @@ else () PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>" ) target_compile_definitions(${HDF5_F90_TEST_LIBSH_TARGET} PUBLIC diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 17aa6c3..a64b773 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,13 @@ project (HDF5_FORTRAN_TESTPAR C Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${CMAKE_Fortran_MODULE_DIRECTORY}/static ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS}) +if (NOT BUILD_SHARED_LIBS) + set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +else () + set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) +endif () +set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -24,11 +30,30 @@ target_compile_options(parallel_test PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) -target_link_libraries (parallel_test - PRIVATE - ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} - $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib"> -) +if (NOT BUILD_SHARED_LIBS) + target_link_libraries (parallel_test + PRIVATE + ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} + $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib"> + ) + set_target_properties (parallel_test PROPERTIES + FOLDER test/fortran + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + ) +else () + target_link_libraries (parallel_test + PRIVATE + ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS} + $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib"> + ) + set_target_properties (parallel_test PROPERTIES + FOLDER test/fortran + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + ) +endif () + #set_property(TARGET parallel_test APPEND PROPERTY # LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> #) @@ -38,12 +63,6 @@ target_link_libraries (parallel_test if(MSVC) set_property(TARGET parallel_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() -set_target_properties (parallel_test PROPERTIES - FOLDER test/fortran - LINKER_LANGUAGE Fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static -) -endif () if (HDF5_TEST_FORTRAN AND HDF5_TEST_PARALLEL) include (CMakeTests.cmake) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index e532fff..91ec669 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -164,7 +164,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>" ) target_compile_definitions(${HDF5_HL_F90_LIB_TARGET} PUBLIC @@ -201,7 +201,7 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>" ) target_compile_definitions(${HDF5_HL_F90_LIBSH_TARGET} PUBLIC diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake index 8537d7c..094a7b5 100644 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ b/hl/tools/gif2h5/CMakeTests.cmake @@ -27,12 +27,6 @@ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/h52giftst.h5" "$ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/ex_image2.h5" "${PROJECT_BINARY_DIR}/testfiles/ex_image2.h5" "gif2h5_files") add_custom_target(gif2h5_files ALL COMMENT "Copying files needed by gif2h5 tests" DEPENDS ${gif2h5_files_list}) -if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") -else () - set (tgt_ext "-shared") -endif () - # Remove any output file left over from previous test run add_test ( NAME HL_TOOLS-clear-objects @@ -45,29 +39,29 @@ add_test ( ) set_tests_properties (HL_TOOLS-clear-objects PROPERTIES FIXTURES_SETUP clear_tools_hl) -add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_ext}> testfiles/image1.gif image1.h5) +add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_file_ext}> testfiles/image1.gif image1.h5) set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES FIXTURES_REQUIRED clear_tools_hl ) -add_test (NAME HL_TOOLS_h52gif COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image1.gif -i image) +add_test (NAME HL_TOOLS_h52gif COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/h52giftst.h5 image1.gif -i image) set_tests_properties (HL_TOOLS_h52gif PROPERTIES FIXTURES_REQUIRED clear_tools_hl ) -add_test (NAME HL_TOOLS_h52gif_none COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image.gif -i nosuch_image) +add_test (NAME HL_TOOLS_h52gif_none COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/h52giftst.h5 image.gif -i nosuch_image) set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES WILL_FAIL "true" FIXTURES_REQUIRED clear_tools_hl ) -#add_test (NAME HL_TOOLS_h52gifpal COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image.gif -i palette) +#add_test (NAME HL_TOOLS_h52gifpal COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/h52giftst.h5 image.gif -i palette) #set_tests_properties (HL_TOOLS_h52gifpal PROPERTIES # WILL_FAIL "true" # FIXTURES_REQUIRED clear_tools_hl #) -add_test (NAME HL_TOOLS_h52gif24bits COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/ex_image2.h5 image24.gif -i image24bitpixel) +add_test (NAME HL_TOOLS_h52gif24bits COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_file_ext}> testfiles/ex_image2.h5 image24.gif -i image24bitpixel) set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES WILL_FAIL "true" FIXTURES_REQUIRED clear_tools_hl diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index 0424140..19d47cb 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -68,19 +68,13 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5WATCH_ARGS-h5watch-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -102,7 +96,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes NAME H5WATCH_ARGS-h5watch-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -131,7 +125,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes NAME H5WATCH-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3755106..bc388f6 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,15 @@ New Features Configuration: ------------- + - Added common warnings files for gnu and intel + + Added warnings files to use one common set of flags + during configure for both autotools and CMake build + systems. The initial implementation only affects a + general set of flags for gnu and intel compilers. + + (ADB - 2020/01/17) + - Added new options to CMake for control of testing Added CMake options (default ON); @@ -61,9 +70,18 @@ New Features (ADB - 2020/01/15, HDFFV-11001) - - Added Clang sanitizers to CMake for analyzer support + - Added Clang sanitizers to CMake for analyzer support if compiler is clang. - Added CMake code and files to execute the Clang sanitizers. + Added CMake code and files to execute the Clang sanitizers if + HDF5_ENABLE_SANITIZERS is enabled and the USE_SANITIZER option + is set to one of the following: + Address + Memory + MemoryWithOrigins + Undefined + Thread + Leak + 'Address;Undefined' (ADB - 2019/12/12, TRILAB-135) @@ -367,6 +385,13 @@ Bug Fixes since HDF5-1.10.5 release Configuration ------------- + - Fixed CMake include properties for Fortran libraries + + Corrected the library properties for Fortran to use the + correct path for the Fortran module files. + + (ADB - 2020/02/04, HDFFV-11012) + - Correct option for default API version CMake options for default API version are not mutually exclusive. diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 257a047..f5234f4 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -219,8 +219,8 @@ leave(int ret) static int convert(hid_t fid, const char *dname) { - hid_t dcpl = -1; - hid_t did = -1; + hid_t dcpl = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; H5D_layout_t layout_type; H5D_chunk_index_t idx_type; @@ -399,7 +399,7 @@ main(int argc, const char *argv[]) { H5E_auto2_t func; void *edata; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index bd1689f..81f9a32 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1086,12 +1086,12 @@ out: */ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) { - hid_t group_id = -1; - hid_t dset_id = -1; - hid_t space_id = -1; - hid_t mspace_id = -1; - hid_t type_id = -1; - hid_t handle = -1; + hid_t group_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t mspace_id = H5I_INVALID_HID; + hid_t type_id = H5I_INVALID_HID; + hid_t handle = H5I_INVALID_HID; char *str1 = NULL; char *str2 = NULL; char *str3 = NULL; diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 4f3e7a4..de316c3 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -197,8 +197,8 @@ main (int argc, const char *argv[]) int ofid = -1; void *edata; H5E_auto2_t func; - hid_t ifile = -1; - hid_t plist = -1; + hid_t ifile = H5I_INVALID_HID; + hid_t plist = H5I_INVALID_HID; herr_t status; htri_t testval; hsize_t usize; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index ffe2aca..33c5a1b 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -199,8 +199,8 @@ main(int argc, const char *argv[]) { void *edata; H5E_auto2_t func; - hid_t ifile = -1; - hid_t plist = -1; + hid_t ifile = H5I_INVALID_HID; + hid_t plist = H5I_INVALID_HID; off_t fsize; hsize_t usize; htri_t testval; diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index ae57031..927167b 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -252,8 +252,8 @@ int main (int argc, const char *argv[]) { char *fname = NULL; /* File name */ - hid_t fapl = -1; /* File access property list */ - hid_t fid = -1; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ haddr_t image_addr; hsize_t image_len; unsigned flags = H5F_ACC_RDWR; /* file access flags */ diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index b0d1615..4ce0318 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -45,12 +45,6 @@ endforeach () add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -71,7 +65,7 @@ add_test ( NAME H5COPY_F-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -85,7 +79,7 @@ if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY_F-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if (${resultcode} EQUAL 1) @@ -105,7 +99,7 @@ add_test ( NAME H5COPY-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -119,7 +113,7 @@ if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} EQUAL 1) @@ -149,7 +143,7 @@ add_test ( NAME H5COPY-${testname}-prefill - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -161,14 +155,14 @@ add_test ( NAME H5COPY-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} EQUAL 1) @@ -188,7 +182,7 @@ add_test ( NAME H5COPY_SAME-${testname}-prefill - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -200,14 +194,14 @@ add_test ( NAME H5COPY_SAME-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY_SAME-${testname}-DIFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if (${resultcode} EQUAL 1) @@ -223,7 +217,7 @@ macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if (${resultcode} EQUAL 1) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () @@ -240,7 +234,7 @@ NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_file_ext}>" -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=./testfiles/${testname}.out.out" diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index f6aa72f..a519f22 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -338,14 +338,14 @@ static void gent_att_compound_vlstr(hid_t loc_id) const char *v; } s1; hsize_t dim[1] = {1}; /* Dimension size */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group ID */ - hid_t vl_str_tid = -1; /* Variable length datatype ID */ - hid_t cmpd_tid = -1; /* Compound datatype ID */ - hid_t null_sid = -1; /* Null dataspace ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t vl_str_tid = H5I_INVALID_HID; /* Variable length datatype ID */ + hid_t cmpd_tid = H5I_INVALID_HID; /* Compound datatype ID */ + hid_t null_sid = H5I_INVALID_HID; /* Null dataspace ID */ s1 buf; /* Buffer */ buf.i = 9; @@ -725,7 +725,7 @@ out: *------------------------------------------------------------------------*/ static void Test_Obj_Copy(void) { - hid_t fid = -1; /* File id */ + hid_t fid = H5I_INVALID_HID; /* File id */ hid_t fapl_new = (-1); /* File access property id */ unsigned new_format; /* New format or old format */ diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index bc550a7..2e4d969 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -350,12 +350,6 @@ endif () add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -366,7 +360,7 @@ if (HDF5_TEST_SERIAL) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN}) + add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") @@ -379,7 +373,7 @@ NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -401,7 +395,7 @@ macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN}) + add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff${tgt_file_ext}> ${MPIEXEC_POSTFLAGS} ${ARGN}) set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") if (${resultcode}) set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") @@ -413,7 +407,7 @@ add_test ( NAME MPI_TEST_H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff>;${MPIEXEC_POSTFLAGS}" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff${tgt_file_ext}>;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index d60e393..bb71a89 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -303,8 +303,8 @@ int main(void) static int test_basic(const char *fname1, const char *fname2, const char *fname3) { - hid_t fid1 = -1, fid2 = -1; - hid_t gid1 = -1, gid2 = -1, gid3 = -1; + hid_t fid1 = -1, fid2 = H5I_INVALID_HID; + hid_t gid1 = -1, gid2 = -1, gid3 = H5I_INVALID_HID; hsize_t dims1[1] = { 6 }; hsize_t dims2[2] = { 3, 2 }; @@ -662,11 +662,11 @@ out: static int test_types(const char *fname) { - hid_t fid1 = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; - hid_t tid1 = -1; - hid_t tid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; + hid_t tid1 = H5I_INVALID_HID; + hid_t tid2 = H5I_INVALID_HID; herr_t status; hsize_t dims[1] = { 1 }; typedef struct s1_t { @@ -787,8 +787,8 @@ int test_types(const char *fname) static int test_datatypes(const char *fname) { - hid_t fid1 = -1; - hid_t dset = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; hsize_t dims[2] = { 3, 2 }; herr_t status; char buf1a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; @@ -977,11 +977,11 @@ int test_datatypes(const char *fname) static int test_attributes(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid = -1; - hid_t did = -1; - hid_t gid = -1; - hid_t root_id = -1; - hid_t sid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; + hid_t root_id = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1] = { 2 }; herr_t status; @@ -1039,14 +1039,14 @@ int test_attributes(const char *file, int make_diffs /* flag to modify data buff static int test_attributes_verbose_level(const char *fname1, const char *fname2) { herr_t status = SUCCEED; - hid_t fid1 = -1, fid2 = -1; - hid_t f1_gid = -1, f2_gid = -1; - hid_t f1_gid2 = -1, f2_gid2 = -1; - hid_t f1_gid3 = -1, f2_gid3 = -1; - hid_t f1_gid4 = -1, f2_gid4 = -1; - hid_t f1_did = -1, f2_did = -1; - hid_t f1_sid = -1, f2_sid = -1; - hid_t f1_tid = -1, f2_tid = -1; + hid_t fid1 = -1, fid2 = H5I_INVALID_HID; + hid_t f1_gid = -1, f2_gid = H5I_INVALID_HID; + hid_t f1_gid2 = -1, f2_gid2 = H5I_INVALID_HID; + hid_t f1_gid3 = -1, f2_gid3 = H5I_INVALID_HID; + hid_t f1_gid4 = -1, f2_gid4 = H5I_INVALID_HID; + hid_t f1_did = -1, f2_did = H5I_INVALID_HID; + hid_t f1_sid = -1, f2_sid = H5I_INVALID_HID; + hid_t f1_tid = -1, f2_tid = H5I_INVALID_HID; /* dset */ hsize_t dset_dims[1] = { 3 }; int dset_data[3] = { 0, 1, 2 }; @@ -1304,10 +1304,10 @@ out: static int test_datasets(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid = -1; - hid_t did = -1; - hid_t gid = -1; - hid_t sid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1] = { 2 }; herr_t status; int buf[2] = { 1, 2 }; @@ -1357,10 +1357,10 @@ int test_datasets(const char *file, int make_diffs /* flag to modify data buffer static int test_special_datasets(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid0 = -1; - hid_t sid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid0 = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims0[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 }; hsize_t dims[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 }; herr_t status; @@ -1413,9 +1413,9 @@ int test_special_datasets(const char *file, int make_diffs /* flag to modify dat *-------------------------------------------------------------------------*/ static int test_link_name(const char *fname1) { - hid_t fid1 = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; herr_t status = SUCCEED; /*----------------------------------------------------------------------- @@ -1486,8 +1486,8 @@ out: *-------------------------------------------------------------------------*/ static int test_soft_links(const char *fname1) { - hid_t fid1 = -1; - hid_t gid1 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -1605,10 +1605,10 @@ out: *-------------------------------------------------------------------------*/ static int test_linked_softlinks(const char *fname1) { - hid_t fid1 = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; - hid_t gid3 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; + hid_t gid3 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -1786,10 +1786,10 @@ out: *-------------------------------------------------------------------------*/ static int test_external_links(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -1931,9 +1931,9 @@ out: *-------------------------------------------------------------------------*/ static int test_ext2soft_links(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -2060,12 +2060,12 @@ out: static int gen_dataset_idx(const char *file, int format) { - hid_t fid = -1; /* file id */ - hid_t did = -1; - hid_t did2 = -1; /* dataset id */ - hid_t sid = -1; /* space id */ - hid_t fapl = -1; /* file access property id */ - hid_t dcpl = -1; /* dataset creation property id */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t did = H5I_INVALID_HID; + hid_t did2 = H5I_INVALID_HID; /* dataset id */ + hid_t sid = H5I_INVALID_HID; /* space id */ + hid_t fapl = H5I_INVALID_HID; /* file access property id */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */ hsize_t dims[1] = { 10 }; /* dataset dimension */ hsize_t c_dims[1] = { 2 }; /* chunk dimension */ herr_t status; /* return status */ @@ -2146,8 +2146,8 @@ int gen_dataset_idx(const char *file, int format) *-------------------------------------------------------------------------*/ static int test_dangle_links(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -2346,10 +2346,10 @@ out: *-------------------------------------------------------------------------*/ static int test_group_recurse(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid1_f1 = -1, gid2_f1 = -1, gid3_f1 = -1, gid10_f1 = -1; - hid_t gid1_f2 = -1, gid2_f2 = -1, gid3_f2 = -1, gid11_f2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid1_f1 = H5I_INVALID_HID, gid2_f1 = H5I_INVALID_HID, gid3_f1 = H5I_INVALID_HID, gid10_f1 = H5I_INVALID_HID; + hid_t gid1_f2 = H5I_INVALID_HID, gid2_f2 = H5I_INVALID_HID, gid3_f2 = H5I_INVALID_HID, gid11_f2 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 } }; int data2[4][2] = { { 0, 2 }, { 0, 2 }, { 2, 0 }, { 2, 0 } }; @@ -2758,18 +2758,18 @@ out: #define GRP_R_DSETNAME2 "dset2" static int test_group_recurse2(void) { - hid_t fileid1 = -1; - hid_t grp1 = -1; - hid_t grp2 = -1; - hid_t grp3 = -1; - hid_t grp4 = -1; - hid_t dset1 = -1; - hid_t dset2 = -1; - hid_t datatype = -1; - hid_t dataspace = -1; - hid_t fileid2 = -1; - hid_t fileid3 = -1; - hid_t fileid4 = -1; + hid_t fileid1 = H5I_INVALID_HID; + hid_t grp1 = H5I_INVALID_HID; + hid_t grp2 = H5I_INVALID_HID; + hid_t grp3 = H5I_INVALID_HID; + hid_t grp4 = H5I_INVALID_HID; + hid_t dset1 = H5I_INVALID_HID; + hid_t dset2 = H5I_INVALID_HID; + hid_t datatype = H5I_INVALID_HID; + hid_t dataspace = H5I_INVALID_HID; + hid_t fileid2 = H5I_INVALID_HID; + hid_t fileid3 = H5I_INVALID_HID; + hid_t fileid4 = H5I_INVALID_HID; hsize_t dimsf[2]; /* dataset dimensions */ herr_t status = 0; int data1[4][2] = { { 0, 0 }, { 1, 1 }, { 2, 2 }, { 3, 3 } }; @@ -3069,10 +3069,10 @@ out: *-------------------------------------------------------------------------*/ static int test_exclude_obj1(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; @@ -3189,11 +3189,11 @@ out: *-------------------------------------------------------------------------*/ static int test_exclude_obj2(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; - hid_t gid3 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; + hid_t gid3 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; @@ -3320,9 +3320,9 @@ out: *-------------------------------------------------------------------------*/ static int test_exclude_obj3(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid1 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; hsize_t dims2[2] = { 2, 4 }; int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; herr_t status = SUCCEED; @@ -3416,8 +3416,8 @@ out: static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new) { int i; - hid_t fid1 = -1; /* file id */ - hid_t gid = -1; + hid_t fid1 = H5I_INVALID_HID; /* file id */ + hid_t gid = H5I_INVALID_HID; /* compound1 datatype */ typedef struct comp1_t { @@ -3534,21 +3534,21 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int } comp9_t; /* vlen string */ - hid_t sid_vlen_str = -1; /* dataspace ID */ - hid_t tid_vlen_str = -1; /* datatype ID */ + hid_t sid_vlen_str = H5I_INVALID_HID; /* dataspace ID */ + hid_t tid_vlen_str = H5I_INVALID_HID; /* datatype ID */ char vlen_str_buf[] = { "Variable length string" }; hsize_t dims_vlen_str[] = { VLEN_STR_DIM }; /* fixlen string */ - hid_t sid_fixlen_str = -1; /* dataspace ID */ - hid_t tid_fixlen_str = -1; /* datatype ID */ + hid_t sid_fixlen_str = H5I_INVALID_HID; /* dataspace ID */ + hid_t tid_fixlen_str = H5I_INVALID_HID; /* datatype ID */ const char fixlen_str_buf[FIXLEN_STR_SIZE] = { "Fixed length string" }; hsize_t dims_fixlen_str[] = { FIXLEN_STR_DIM }; /* vlen string array */ - hid_t sid_vlen_str_array = -1; /* dataspace ID */ - hid_t tid_vlen_str_array_pre = -1; /* datatype ID */ - hid_t tid_vlen_str_array = -1; /* datatype ID */ + hid_t sid_vlen_str_array = H5I_INVALID_HID; /* dataspace ID */ + hid_t tid_vlen_str_array_pre = H5I_INVALID_HID; /* datatype ID */ + hid_t tid_vlen_str_array = H5I_INVALID_HID; /* datatype ID */ const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM] = { "1 - Variable length string Array", "2 - Testing variable length string array in compound type", @@ -3556,9 +3556,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int hsize_t dims_vlen_str_array[] = { VLEN_STR_ARRY_DIM }; /* fixlen string array */ - hid_t sid_fixlen_str_array = -1; /* dataspace ID */ - hid_t tid_fixlen_str_array_pre = -1; /* datatype ID */ - hid_t tid_fixlen_str_array = -1; /* datatype ID */ + hid_t sid_fixlen_str_array = H5I_INVALID_HID; /* dataspace ID */ + hid_t tid_fixlen_str_array_pre = H5I_INVALID_HID; /* datatype ID */ + hid_t tid_fixlen_str_array = H5I_INVALID_HID; /* datatype ID */ const char *fixlen_str_array_buf[FIXLEN_STR_ARRY_DIM] = { "1 - Fixed length string Array", "2 - Fixed length string Array", "3 - Fixed length string Array" }; @@ -3567,17 +3567,17 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /*------------------------------------------ * compound dataset *------------------------------------------*/ - hid_t sid_comp = -1; /* dataspace ID */ - hid_t tid1_comp = -1; /* datatype ID */ - hid_t tid2_comp = -1; /* datatype ID */ - hid_t tid3_comp = -1; /* datatype ID */ - hid_t tid4_comp = -1; /* datatype ID */ - hid_t tid5_comp = -1; /* datatype ID */ - hid_t tid6_comp = -1; /* datatype ID */ - hid_t tid7_comp = -1; /* datatype ID */ - hid_t tid8_comp = -1; /* datatype ID */ - hid_t tid9_comp = -1; /* datatype ID */ - hid_t did_comp = -1; /* dataset ID */ + hid_t sid_comp = H5I_INVALID_HID; /* dataspace ID */ + hid_t tid1_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid2_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid3_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid4_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid5_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid6_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid7_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid8_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t tid9_comp = H5I_INVALID_HID; /* datatype ID */ + hid_t did_comp = H5I_INVALID_HID; /* dataset ID */ hsize_t dims_comp[] = { COMP_DIM }; herr_t status = SUCCEED; @@ -4020,7 +4020,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int } H5Dclose(did_comp); - did_comp = -1; + did_comp = H5I_INVALID_HID; out: /*----------------------------------------------------------------------- @@ -4091,9 +4091,9 @@ out: static int test_enums(const char *fname) { - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; - hid_t tid = -1; + hid_t tid = H5I_INVALID_HID; int enum_val = -1; /* The data in the two arrays cover the following cases: @@ -4217,13 +4217,13 @@ static void test_comps_array(const char *fname, const char *dset, const char *at cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */ - hid_t fid = -1; /* HDF5 File IDs */ - hid_t did_dset = -1; /* Dataset ID */ - hid_t sid_dset = -1; /* Dataset space ID */ - hid_t tid_cmpd1 = -1; /* Compound1 type ID */ - hid_t tid_arry1 = -1; /* Array type ID in compound1 */ - hid_t tid_cmpd2 = -1; /* Compound2 type ID */ - hid_t tid_attr = -1; + hid_t fid = H5I_INVALID_HID; /* HDF5 File IDs */ + hid_t did_dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid_dset = H5I_INVALID_HID; /* Dataset space ID */ + hid_t tid_cmpd1 = H5I_INVALID_HID; /* Compound1 type ID */ + hid_t tid_arry1 = H5I_INVALID_HID; /* Array type ID in compound1 */ + hid_t tid_cmpd2 = H5I_INVALID_HID; /* Compound2 type ID */ + hid_t tid_attr = H5I_INVALID_HID; hsize_t sdims_dset[] = { SDIM_DSET }; hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; int i, j; @@ -4326,13 +4326,13 @@ static void test_comps_vlen(const char * fname, const char *dset, const char *at cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ - hid_t fid = -1; /* HDF5 File ID */ - hid_t did_dset = -1; /* dataset ID */ - hid_t sid_dset = -1; /* dataset space ID */ - hid_t tid_attr = -1; - hid_t tid_cmpd2 = -1; /* compound2 type ID */ - hid_t tid_cmpd1 = -1; /* compound1 type ID */ - hid_t tid_cmpd1_vlen = -1; + hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */ + hid_t did_dset = H5I_INVALID_HID; /* dataset ID */ + hid_t sid_dset = H5I_INVALID_HID; /* dataset space ID */ + hid_t tid_attr = H5I_INVALID_HID; + hid_t tid_cmpd2 = H5I_INVALID_HID; /* compound2 type ID */ + hid_t tid_cmpd1 = H5I_INVALID_HID; /* compound1 type ID */ + hid_t tid_cmpd1_vlen = H5I_INVALID_HID; hsize_t sdims_dset[] = { SDIM_DSET }; unsigned i, j; /* counting variables */ @@ -4442,15 +4442,15 @@ static void test_comps_array_vlen(const char * fname, const char *dset, const ch } cmpd1_t; cmpd1_t wdata[SDIM_DSET]; /* Information to write */ - hid_t fid = -1; /* HDF5 File IDs */ - hid_t did_dset = -1; /* Dataset ID */ - hid_t sid_dset = -1; /* Dataspace ID */ - hid_t tid_attr = -1; - hid_t tid_cmpd1 = -1; /* Compound1 Datatype ID */ - hid_t tid_arry1 = -1; /* Array Datatype ID */ - hid_t tid_cmpd2 = -1; /* Compound2 Datatype ID */ - hid_t tid_cmpd2_vlen = -1; - hid_t tid_cmpd3 = -1; /* Compound3 Datatype ID */ + hid_t fid = H5I_INVALID_HID; /* HDF5 File IDs */ + hid_t did_dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid_dset = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid_attr = H5I_INVALID_HID; + hid_t tid_cmpd1 = H5I_INVALID_HID; /* Compound1 Datatype ID */ + hid_t tid_arry1 = H5I_INVALID_HID; /* Array Datatype ID */ + hid_t tid_cmpd2 = H5I_INVALID_HID; /* Compound2 Datatype ID */ + hid_t tid_cmpd2_vlen = H5I_INVALID_HID; + hid_t tid_cmpd3 = H5I_INVALID_HID; /* Compound3 Datatype ID */ hsize_t sdims_dset[] = { SDIM_DSET }; hsize_t sdims_arry[] = { SDIM_CMPD_ARRAY }; unsigned i, j, k; /* counting variables */ @@ -4584,15 +4584,15 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ - hid_t fid = -1; /* HDF5 File ID */ - hid_t did_dset = -1; /* dataset ID */ - hid_t sid_dset = -1; /* dataset space ID */ - hid_t tid_attr = -1; - hid_t tid_cmpd3 = -1; /* compound3 type ID */ - hid_t tid_cmpd2 = -1; /* compound2 type ID */ - hid_t tid_cmpd2_arry = -1; - hid_t tid_cmpd1 = -1; /* compound1 type ID */ - hid_t tid_cmpd1_vlen = -1; + hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */ + hid_t did_dset = H5I_INVALID_HID; /* dataset ID */ + hid_t sid_dset = H5I_INVALID_HID; /* dataset space ID */ + hid_t tid_attr = H5I_INVALID_HID; + hid_t tid_cmpd3 = H5I_INVALID_HID; /* compound3 type ID */ + hid_t tid_cmpd2 = H5I_INVALID_HID; /* compound2 type ID */ + hid_t tid_cmpd2_arry = H5I_INVALID_HID; + hid_t tid_cmpd1 = H5I_INVALID_HID; /* compound1 type ID */ + hid_t tid_cmpd1_vlen = H5I_INVALID_HID; hsize_t sdims_dset[] = { SDIM_DSET }; hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; @@ -4717,14 +4717,14 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha #define DIM_ARRY 3 static void test_data_nocomparables(const char * fname, int make_diffs) { - hid_t fid = -1; - hid_t gid1 = -1; - hid_t gid2 = -1; - hid_t did1 = -1; - hid_t did2 = -1; - hid_t sid1 = -1; - hid_t tid_dset1 = -1; - hid_t tid_attr1 = -1; + hid_t fid = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; + hid_t did1 = H5I_INVALID_HID; + hid_t did2 = H5I_INVALID_HID; + hid_t sid1 = H5I_INVALID_HID; + hid_t tid_dset1 = H5I_INVALID_HID; + hid_t tid_attr1 = H5I_INVALID_HID; hsize_t dims1_1[1] = { DIM_ARRY }; hsize_t dims1_2[1] = { DIM_ARRY + 1 }; hsize_t dims2[2] = { DIM_ARRY, 1 }; @@ -4913,14 +4913,14 @@ out: static void test_objs_nocomparables(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t topgid1 = -1; - hid_t topgid2 = -1; - hid_t gid1 = -1; - hid_t tid1 = -1; - hid_t gid2 = -1; - hid_t tid2 = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t topgid1 = H5I_INVALID_HID; + hid_t topgid2 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID; + hid_t tid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; + hid_t tid2 = H5I_INVALID_HID; hsize_t dims[1] = { DIM_ARRY }; int data1[DIM_ARRY] = { 1, 1, 1 }; int data2[DIM_ARRY] = { 2, 2, 2 }; @@ -5039,12 +5039,12 @@ static hid_t mkstr(int size, H5T_str_t pad) *-------------------------------------------------------------------------*/ static void test_objs_strings(const char *fname1, const char *fname2) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t dataset = -1; - hid_t space = -1; - hid_t f_type = -1; - hid_t m_type = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t f_type = H5I_INVALID_HID; + hid_t m_type = H5I_INVALID_HID; hsize_t dims1[] = { 3, 4 }; char string1A[12][3] = { "s1", "s2", "s3", "s4", "s5", "s6", "s", "s", "s9", "s0", "s1", "s2" }; @@ -5211,9 +5211,9 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make RED, GREEN } e_t; - hid_t aid = -1; - hid_t sid = -1; - hid_t tid = -1; + hid_t aid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; herr_t status; int val, i, j, k, l, n; float f; @@ -6202,9 +6202,9 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff RED, GREEN } e_t; - hid_t aid = -1; - hid_t sid = -1; - hid_t tid = -1; + hid_t aid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; herr_t status; int val, i, j, k, l, n; float f; @@ -7193,10 +7193,10 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff RED, GREEN } e_t; - hid_t did = -1; - hid_t sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; int val, i, j, k, l, n; float f; @@ -7417,9 +7417,9 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff { double *dbuf; /* information to write */ - hid_t ldid = -1; /* dataset ID */ - hid_t lsid = -1; /* dataspace ID */ - hid_t ltid = -1; /* datatype ID */ + hid_t ldid = H5I_INVALID_HID; /* dataset ID */ + hid_t lsid = H5I_INVALID_HID; /* dataspace ID */ + hid_t ltid = H5I_INVALID_HID; /* datatype ID */ size_t size; hsize_t sdims[] = { 1 }; hsize_t tdims[] = { H5TOOLS_MALLOCSIZE / sizeof(double) + 1 }; @@ -7820,13 +7820,13 @@ static void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) { /* data dataset */ - hid_t did1 = -1; /* dataset ID */ - hid_t sid1 = -1; /* dataspace ID */ + hid_t did1 = H5I_INVALID_HID; /* dataset ID */ + hid_t sid1 = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims1[2] = { 10, 10 };/* dimensions */ int *buf; /* dataset buffer */ /* reference dataset */ - hid_t did2 = -1; /* dataset ID */ - hid_t sid2 = -1; /* dataspace ID */ + hid_t did2 = H5I_INVALID_HID; /* dataset ID */ + hid_t sid2 = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims2[] = { 2 }; /* 2 references */ hdset_reg_ref_t *rbuf; /* buffer for write the references */ hsize_t start[10]; /* starting location of hyperslab */ @@ -7931,12 +7931,12 @@ void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) static int test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers */) { - hid_t did = -1; - hid_t fid = -1; - hid_t f_sid = -1; - hid_t m_sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t did = H5I_INVALID_HID; + hid_t fid = H5I_INVALID_HID; + hid_t f_sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; hsize_t dims[1] = { GBLL }; /* dataset dimensions */ hsize_t hs_size[1] = { GBLL / (1024 * 1024) }; /* hyperslab dimensions */ hsize_t chunk_dims[1] = { GBLL / 1024 }; /* chunk dimensions */ @@ -8030,8 +8030,8 @@ out: static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf) { - hid_t aid = -1; - hid_t sid = -1; + hid_t aid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; /* create a space */ if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) @@ -8070,8 +8070,8 @@ out: static herr_t write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf) { - hid_t did = -1; - hid_t sid = -1; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; /* create a space */ if((sid = H5Screate_simple(rank, dims, NULL)) < 0) diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 8f6fe45..02c991f 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -396,16 +396,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (last_test) set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) @@ -416,7 +410,7 @@ NAME H5DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=h5dump-${testname}.out" @@ -447,7 +441,7 @@ macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -465,7 +459,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -480,7 +474,7 @@ macro (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") @@ -498,7 +492,7 @@ NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}-N.out" @@ -513,7 +507,7 @@ macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -531,7 +525,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -554,7 +548,7 @@ macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -574,7 +568,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -609,7 +603,7 @@ set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-output-${resultfile} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN} ${resultfile}.txt ${targetfile} ) set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) @@ -630,7 +624,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -648,7 +642,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -665,7 +659,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -683,7 +677,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" @@ -711,7 +705,7 @@ NAME H5DUMP-IMPORT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${conffile}.out" @@ -720,10 +714,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") - add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) - add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer) + add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${testfile} ${resultfile}.h5 /integer /integer) set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) endif () @@ -735,7 +729,7 @@ NAME H5DUMP_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index a6be9ae..1e16875 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -119,16 +119,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -141,7 +135,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 036609c..ae7193c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -115,16 +115,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -137,7 +131,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" -D "TEST_OUTPUT=${resultfile}.out" @@ -151,7 +145,7 @@ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN}) set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" @@ -167,7 +161,7 @@ NAME H5DUMP_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" -D "TEST_OUTPUT=${resultfile}.out" @@ -183,7 +177,7 @@ macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> -p ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -196,7 +190,7 @@ NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 6d73cb1..985d940 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -160,12 +160,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -182,7 +176,7 @@ macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN}) + add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> --xml ${ARGN}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (${resultcode}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true") @@ -195,7 +189,7 @@ NAME H5DUMP_XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=--xml;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake index 0a345ef..337cfe2 100644 --- a/tools/test/h5dump/CMakeVFDTests.cmake +++ b/tools/test/h5dump/CMakeVFDTests.cmake @@ -53,19 +53,13 @@ add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF ############################################################################## ############################################################################## -if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") -else () - set (tgt_ext "-shared") -endif () - macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 611dd10..966d613 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -637,11 +637,11 @@ static void gent_softlink(void) #define NY 2 static int gent_softlink2(void) { - hid_t fileid1 = -1; - hid_t gid1 = -1, gid2 = -1; - hid_t datatype = -1; - hid_t dset1 = -1, dset2 = -1; - hid_t dataspace = -1; + hid_t fileid1 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; + hid_t datatype = H5I_INVALID_HID; + hid_t dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID; + hid_t dataspace = H5I_INVALID_HID; hsize_t dimsf[2]; /* dataset dimensions */ int data1[NX][NY] = {{0,0},{1,1},{2,2},{3,3}}; int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}}; @@ -2547,7 +2547,7 @@ static void gent_opaque(void) static void gent_bitfields(void) { - hid_t file, grp=-1, type=-1, space=-1, dset=-1; + hid_t file, grp=H5I_INVALID_HID, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; size_t i; hsize_t nelmts; unsigned char buf[32]; @@ -3470,10 +3470,10 @@ static void gent_array7(void) /* Test the boundary of the display output buffer at the reallocation event */ static void gent_array8(void) { - hid_t file = -1; /* Handles */ - hid_t filetype = -1; /* Handles */ - hid_t space = -1; /* Handles */ - hid_t dset = -1; /* Handles */ + hid_t file = H5I_INVALID_HID; /* Handles */ + hid_t filetype = H5I_INVALID_HID; /* Handles */ + hid_t space = H5I_INVALID_HID; /* Handles */ + hid_t dset = H5I_INVALID_HID; /* Handles */ herr_t status = -1; hsize_t sdims[] = {F64_DIM0}; hsize_t tdims[] = {F64_DIM1}; @@ -6352,12 +6352,12 @@ gent_binary(void) static void gent_bigdims(void) { - hid_t fid = -1; - hid_t did = -1; - hid_t f_sid = -1; - hid_t m_sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t f_sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; hsize_t dims[1]={DIM_4GB}; /* dataset dimensions */ hsize_t chunk_dims[1]={1024}; /* chunk dimensions */ hsize_t hs_start[1]; @@ -6417,19 +6417,19 @@ gent_bigdims(void) /* close */ if(H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; if(H5Sclose(f_sid) < 0) goto out; - f_sid = -1; + f_sid = H5I_INVALID_HID; if(H5Sclose(m_sid) < 0) goto out; - m_sid = -1; + m_sid = H5I_INVALID_HID; if(H5Pclose(dcpl) < 0) goto out; - dcpl = -1; + dcpl = H5I_INVALID_HID; if(H5Dclose(did) < 0) goto out; - did = -1; + did = H5I_INVALID_HID; ret = H5Fclose(fid); HDassert(ret >= 0); @@ -6493,10 +6493,10 @@ gent_hyperslab(void) static void gent_group_creation_order(void) { - hid_t fid = -1; /* file ID */ - hid_t gid = -1; /* group ID */ - hid_t gcpl_id = -1; /* group creation property list ID */ - hid_t fcpl_id = -1; /* file creation property list ID (to set root group order) */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t gid = H5I_INVALID_HID; /* group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* group creation property list ID */ + hid_t fcpl_id = H5I_INVALID_HID; /* file creation property list ID (to set root group order) */ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) goto out; @@ -6522,45 +6522,45 @@ gent_group_creation_order(void) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- @@ -6575,56 +6575,56 @@ gent_group_creation_order(void) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if(H5Pclose(gcpl_id) < 0) goto out; - gcpl_id = -1; + gcpl_id = H5I_INVALID_HID; if(H5Pclose(fcpl_id) < 0) goto out; - fcpl_id = -1; + fcpl_id = H5I_INVALID_HID; if(H5Fclose(fid) < 0) goto out; - fid = -1; + fid = H5I_INVALID_HID; return; @@ -6652,15 +6652,15 @@ gent_group_creation_order(void) static void gent_attr_creation_order(void) { - hid_t fid = -1; /* file id */ - hid_t gid = -1; /* group id */ - hid_t did = -1; /* dataset id */ - hid_t sid = -1; /* space id */ - hid_t aid = -1; /* attribute id */ - hid_t tid = -1; /* datatype id */ - hid_t gcpl_id = -1; /* group creation property list ID */ - hid_t dcpl_id = -1; /* dataset creation property list ID */ - hid_t tcpl_id = -1; /* datatype creation property list ID */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t gid = H5I_INVALID_HID; /* group id */ + hid_t did = H5I_INVALID_HID; /* dataset id */ + hid_t sid = H5I_INVALID_HID; /* space id */ + hid_t aid = H5I_INVALID_HID; /* attribute id */ + hid_t tid = H5I_INVALID_HID; /* datatype id */ + hid_t gcpl_id = H5I_INVALID_HID; /* group creation property list ID */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation property list ID */ + hid_t tcpl_id = H5I_INVALID_HID; /* datatype creation property list ID */ int i; const char *attr_name[3] = {"c", "b", "a" }; @@ -6713,12 +6713,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Dclose(did) < 0) goto out; - did = -1; + did = H5I_INVALID_HID; /*------------------------------------------------------------------------- @@ -6739,12 +6739,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Dclose(did) < 0) goto out; - did = -1; + did = H5I_INVALID_HID; @@ -6765,12 +6765,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * create a group without creation order tracked for attributes and atributes in it @@ -6789,12 +6789,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * create a named datatype with creation order tracked for attributes and atributes in it @@ -6816,12 +6816,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * create a named datatype without creation order tracked for attributes and atributes in it @@ -6843,12 +6843,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * add some attributes to the root group @@ -6866,12 +6866,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * close @@ -6879,19 +6879,19 @@ gent_attr_creation_order(void) */ if(H5Sclose(sid) < 0) goto out; - sid = -1; + sid = H5I_INVALID_HID; if(H5Pclose(dcpl_id) < 0) goto out; - dcpl_id = -1; + dcpl_id = H5I_INVALID_HID; if(H5Pclose(gcpl_id) < 0) goto out; - gcpl_id = -1; + gcpl_id = H5I_INVALID_HID; if(H5Pclose(tcpl_id) < 0) goto out; - tcpl_id = -1; + tcpl_id = H5I_INVALID_HID; if(H5Fclose(fid) < 0) goto out; - fid = -1; + fid = H5I_INVALID_HID; @@ -9797,7 +9797,7 @@ static void gent_bitnopaquefields(void) uint64_t d; } s_t; - hid_t file, grp=-1, type=-1, space=-1, dset=-1; + hid_t file_id=H5I_INVALID_HID, grp=H5I_INVALID_HID, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; size_t i; hsize_t nelmts = F80_DIM32; uint8_t buf[F80_DIM32]; /* bitfield, opaque */ @@ -9806,9 +9806,9 @@ static void gent_bitnopaquefields(void) uint64_t buf4[F80_DIM32]; /* bitfield, opaque */ s_t buf5[F80_DIM32]; /* compound */ - file = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file_id = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if ((grp = H5Gcreate2(file, "bittypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if ((grp = H5Gcreate2(file_id, "bittypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { /* bitfield_1 */ if ((type = H5Tcopy(H5T_STD_B8LE)) >= 0) { if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { @@ -9872,7 +9872,7 @@ static void gent_bitnopaquefields(void) H5Gclose(grp); } - if ((grp = H5Gcreate2(file, "opaquetypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if ((grp = H5Gcreate2(file_id, "opaquetypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { /* opaque_1 */ if ((type = H5Tcreate(H5T_OPAQUE, 1)) >= 0) { if ((H5Tset_tag(type, "1-byte opaque type")) >= 0) { @@ -9908,7 +9908,7 @@ static void gent_bitnopaquefields(void) H5Gclose(grp); } - if ((grp = H5Gcreate2(file, "cmpdtypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if ((grp = H5Gcreate2(file_id, "cmpdtypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { /* compound_1 */ if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); @@ -9934,7 +9934,7 @@ static void gent_bitnopaquefields(void) H5Gclose(grp); } - H5Fclose(file); + H5Fclose(file_id); } /*------------------------------------------------------------------------- @@ -10033,9 +10033,9 @@ static void gent_compound_complex2(void) compound *buf; /* compound */ - hid_t file, type=-1, space=-1, dset=-1; + hid_t file, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; hid_t dset_array_a, dset_array_b, dset_array_c; - hid_t cmpd_tid1 = -1, cmpd_tid2 = -1, cmpd_tid3 = -1; + hid_t cmpd_tid1 = H5I_INVALID_HID, cmpd_tid2 = H5I_INVALID_HID, cmpd_tid3 = H5I_INVALID_HID; size_t i; size_t j, k; unsigned dset_array_ndims; @@ -10321,7 +10321,7 @@ static void gent_vlenstr_array(void) }; const char *buffer[F83_DIM*F83_ARRAYDIM]; - hid_t file, type=-1, space=-1, dset=-1; + hid_t file, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; hid_t cmpd_tid1, array_tid; int i, j; diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 398866c..7bc33ce 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -97,12 +97,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_OUTPUT testname resultfile resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -123,7 +117,7 @@ NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -139,7 +133,7 @@ NAME H5FC-${testname}-NA COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -172,7 +166,7 @@ NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -204,7 +198,7 @@ NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -237,7 +231,7 @@ NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};./testfiles/tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" @@ -280,7 +274,7 @@ NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" @@ -317,7 +311,7 @@ NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" @@ -330,7 +324,7 @@ NAME H5FC_CHECK_DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}_chk.out" diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index 8369668..ad1742b 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -45,8 +45,8 @@ main(int argc, char *argv[]) { char *fname = NULL; char *dname = NULL; - hid_t fid = -1; - hid_t did = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; H5D_chunk_index_t idx_type; /* h5fc_chk_idx fname dname */ diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index b482dee..1e9e2cf 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -77,12 +77,12 @@ const char *FILENAME[] = { static void gen_non(const char *fname) { - hid_t fid = -1; /* file id */ - hid_t fcpl = -1; /* file creation property list */ - hid_t gid = -1; /* group id */ - hid_t sid = -1; /* space id */ - hid_t dcpl = -1; /* dataset creation property id */ - hid_t did1 = -1, did2 = -1; /* dataset id */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t fcpl = H5I_INVALID_HID; /* file creation property list */ + hid_t gid = H5I_INVALID_HID; /* group id */ + hid_t sid = H5I_INVALID_HID; /* space id */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */ + hid_t did1 = -1, did2 = H5I_INVALID_HID; /* dataset id */ hsize_t dims1[1] = {10}; /* dataset dimension */ hsize_t dims2[2] = {4, 6}; /* dataset dimension */ hsize_t max_dims[2]; /* maximum dataset dimension */ @@ -307,11 +307,11 @@ error: static void gen_edge(const char *fname) { - hid_t fid = -1; /* file id */ - hid_t fapl = -1; /* file access property list */ - hid_t sid = -1; /* dataspace id */ - hid_t dcpl = -1; /* dataset creation property id */ - hid_t did = -1; /* dataset id */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t fapl = H5I_INVALID_HID; /* file access property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace id */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */ + hid_t did = H5I_INVALID_HID; /* dataset id */ hsize_t dims2[2] = {12, 6}; /* Dataset dimensions */ hsize_t c_dims[2] = {5, 5}; /* Chunk dimensions */ float buf[12][6]; /* Buffer for writing data */ @@ -395,14 +395,14 @@ error: static void gen_err_level(const char *fname) { - hid_t fid = -1; /* file ID */ - hid_t fapl = -1; /* file access property list */ - hid_t fcpl = -1; /* file creation property list */ - hid_t sid = -1; /* dataspace id */ - hid_t dcpl = -1; /* dataset creation property list */ - hid_t did = -1; /* dataset ID */ - hid_t fsid = -1; /* file dataspace ID */ - hid_t msid = -1; /* memory dataspace ID */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl = H5I_INVALID_HID; /* file access property list */ + hid_t fcpl = H5I_INVALID_HID; /* file creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace id */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */ + hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */ unsigned char *buf = NULL; /* buffer for data */ hsize_t dims[2] = {0, 1}; /* dataset dimension sizes */ hsize_t max_dims[2] = {1, H5S_UNLIMITED}; /* dataset maximum dimension sizes */ @@ -534,13 +534,13 @@ error: static void gen_ext(const char *fname, unsigned new_format, unsigned what) { - hid_t fid = -1; /* file id */ - hid_t fapl = -1; /* file access property list */ - hid_t fcpl = -1; /* file creation property list */ - hid_t gid = -1; /* group id */ - hid_t sid = -1; /* space id */ - hid_t dcpl = -1; /* dataset creation property id */ - hid_t did1 = -1, did2 = -1; /* dataset id */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t fapl = H5I_INVALID_HID; /* file access property list */ + hid_t fcpl = H5I_INVALID_HID; /* file creation property list */ + hid_t gid = H5I_INVALID_HID; /* group id */ + hid_t sid = H5I_INVALID_HID; /* space id */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* dataset id */ hsize_t dims1[1] = {10}; /* dataset dimension */ hsize_t dims2[2] = {4, 6}; /* dataset dimension */ hsize_t max_dims[2]; /* maximum dataset dimension */ diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 22ab848..00d5009 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -96,16 +96,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile}) set_tests_properties (H5IMPORT-${testname} PROPERTIES FIXTURES_REQUIRED set_h5importtest ) @@ -118,7 +112,7 @@ FIXTURES_REQUIRED set_h5importtest ) - add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile}) set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects ) @@ -127,7 +121,7 @@ NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testfile}.new" @@ -143,7 +137,7 @@ NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testfile}.out" @@ -176,7 +170,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" @@ -189,7 +183,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" @@ -206,7 +200,7 @@ NAME H5IMPORT-DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>" -D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.imp" @@ -222,7 +216,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>" -D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dff" @@ -254,7 +248,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.dmp" @@ -270,7 +264,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>" -D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.imp" @@ -285,7 +279,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-p;d-${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d-${testname}.dmp" diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index f108afc..aaa9a5c 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -47,12 +47,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - # ============================================================ # TEST_H5JAM_OUTPUT # For the purpose to verify only output & exitcode from h5jam @@ -60,7 +54,7 @@ macro (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN}) + add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") endif () @@ -69,7 +63,7 @@ NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${expectfile}.out" @@ -89,7 +83,7 @@ macro (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN}) + add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") endif () @@ -98,7 +92,7 @@ NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${expectfile}.out" @@ -116,7 +110,7 @@ NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=testfiles/${expected}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${actual}.new" @@ -130,7 +124,7 @@ NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=${actual}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${actual}.out" @@ -165,7 +159,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${ufile} ) set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile}) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> -i ${infile} -u ${ufile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test ${ufile}) else () @@ -174,7 +168,7 @@ NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_file_ext}>" -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${outfile}.ufile.txt" @@ -185,7 +179,7 @@ set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "${outfile}.ufile.txt") else () - add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile}) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> -i ${infile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "") endif () @@ -247,7 +241,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) endif () - add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) if (NOT HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) set (compare_test ${outfile}) @@ -302,7 +296,7 @@ ) set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) - add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) set (compare_test ${chkfile}) diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 26a427d..f496a7a 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -81,7 +81,7 @@ parse_command_line(int argc, const char *argv[]) int main(int argc, const char *argv[]) { - int fd = -1; + int fd = H5I_INVALID_HID; unsigned size; char *filename = NULL; long res; diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 7ff17ff..2b7aa96 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -134,16 +134,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") @@ -154,7 +148,7 @@ NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -168,7 +162,7 @@ macro (ADD_H5_ERR_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") @@ -178,7 +172,7 @@ NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -196,7 +190,7 @@ NAME H5LS_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index cf5b6d7..3fc8aab 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -80,16 +80,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") @@ -99,7 +93,7 @@ NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" -D "TEST_OUTPUT=${resultfile}.out" @@ -113,7 +107,7 @@ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -126,7 +120,7 @@ NAME H5LS_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index c8db1c3..49a1680 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -176,16 +176,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN}) + add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN}) set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) @@ -194,7 +188,7 @@ NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=h5repack-${testname}.out" @@ -226,14 +220,14 @@ ) add_test ( NAME H5REPACK_OLD-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects ) add_test ( NAME H5REPACK_OLD-${testname}_DFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname} @@ -261,14 +255,14 @@ ) add_test ( NAME H5REPACK-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects ) add_test ( NAME H5REPACK-${testname}_DFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname} @@ -290,7 +284,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) else () add_test ( @@ -304,7 +298,7 @@ NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -334,7 +328,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES FIXTURES_REQUIRED clear_h5repack @@ -351,7 +345,7 @@ NAME H5REPACK_MASK-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -385,7 +379,7 @@ ) add_test ( NAME H5REPACK_DMP-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects @@ -395,7 +389,7 @@ NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -429,7 +423,7 @@ ) add_test ( NAME H5REPACK_STAT-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} ) set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects @@ -439,7 +433,7 @@ NAME H5REPACK_STAT-h5stat-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>" -D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" @@ -474,14 +468,14 @@ ) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects ) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname} @@ -491,7 +485,7 @@ NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -517,7 +511,7 @@ NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -555,7 +549,7 @@ ) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -565,7 +559,7 @@ NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-d;${testdset};-p;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -593,7 +587,7 @@ ) add_test ( NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects @@ -602,7 +596,7 @@ NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testfile}-${testname}-v.out" @@ -627,7 +621,7 @@ ) add_test ( NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects @@ -648,20 +642,20 @@ ) add_test ( NAME H5REPACK_META-${testname}_N - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects ) add_test ( NAME H5REPACK_META-${testname}_M - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N ) - add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true" DEPENDS H5REPACK_META-${testname}_M @@ -719,100 +713,100 @@ endmacro () macro (ADD_H5_EXTERNAL_TEST testname testtype testfile) - # canonical file = h5repack_${testfile}.h5 - preexist - # external file = h5repack_${testfile}_ex.h5 - preexist - # repacked file = h5repack_${testfile}_rp.h5 - created - # external data file = h5repack_${testfile}_ex-0.dat - if ("${testtype}" STREQUAL "SKIP") - if (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # canonical file = h5repack_${testfile}.h5 - preexist + # external file = h5repack_${testfile}_ex.h5 - preexist + # repacked file = h5repack_${testfile}_rp.h5 - created + # external data file = h5repack_${testfile}_ex-0.dat + if ("${testtype}" STREQUAL "SKIP") add_test ( NAME H5REPACK_EXTERNAL-${testname} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) set_property(TEST H5REPACK_EXTERNAL-${testname} PROPERTY DISABLED) + else () + add_test ( + NAME H5REPACK_EXTERNAL-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + FIXTURES_REQUIRED clear_h5repack + ) + # make sure external data file 0 is available + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_CPY + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects + ) + # comparison of known files + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF1 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_CPY + ) + # repack the external file to the repacked file + add_test ( + NAME H5REPACK_EXTERNAL-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1 + ) + # comparison of repacked file to known files + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF2 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname} + ) + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF3 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2 + ) + # invalidate external file by removing its first data file + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV + COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3 + ) + # verify comparison of repacked file to known file + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF4 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV + ) + # verify comparison of repacked file to known external file fails + add_test ( + NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4 + WILL_FAIL "true" + ) endif () - else () - add_test ( - NAME H5REPACK_EXTERNAL-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - FIXTURES_REQUIRED clear_h5repack - ) - # make sure external data file 0 is available - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_CPY - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects - ) - # comparison of known files - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF1 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_CPY - ) - # repack the external file to the repacked file - add_test ( - NAME H5REPACK_EXTERNAL-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1 - ) - # comparison of repacked file to known files - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF2 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname} - ) - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF3 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2 - ) - # invalidate external file by removing its first data file - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV - COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3 - ) - # verify comparison of repacked file to known file - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF4 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV - ) - # verify comparison of repacked file to known external file fails - add_test ( - NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 - ) - set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4 - WILL_FAIL "true" - ) endif () endmacro () diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index ec8df3c..83c0dad 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -1779,9 +1779,9 @@ error: static int make_testfiles(void) { - hid_t fid = -1; - hid_t fcpl = -1; /* File creation property list */ - hid_t fapl = -1; /* File access property list */ + hid_t fid = H5I_INVALID_HID; + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ unsigned j; /* Local index variable */ /*------------------------------------------------------------------------- @@ -2210,12 +2210,12 @@ out: static int make_all_objects(hid_t loc_id) { - hid_t did = -1; - hid_t gid = -1; - hid_t tid = -1; - hid_t rid = -1; - hid_t sid = -1; - hid_t gcplid = -1; + hid_t did = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t rid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t gcplid = H5I_INVALID_HID; hsize_t dims[1] = {2}; /* compound datatype */ typedef struct s_t @@ -2332,10 +2332,10 @@ out: static int make_attributes(hid_t loc_id) { - hid_t did = -1; - hid_t gid = -1; - hid_t rid = -1; - hid_t sid = -1; + hid_t did = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; + hid_t rid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1] = {2}; /*------------------------------------------------------------------------- @@ -2403,8 +2403,8 @@ static int make_hlinks(hid_t loc_id) { hid_t g1id =- 1; - hid_t g2id = -1; - hid_t g3id = -1; + hid_t g2id = H5I_INVALID_HID; + hid_t g3id = H5I_INVALID_HID; hsize_t dims[2] = {3,2}; int buf[3][2] = {{1,1}, {1,2}, {2,2}}; @@ -2473,8 +2473,8 @@ out: static int make_szip(hid_t loc_id) { - hid_t dcpl = -1; /* dataset creation property list */ - hid_t sid = -1; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ unsigned szip_options_mask = H5_SZIP_ALLOW_K13_OPTION_MASK | H5_SZIP_NN_OPTION_MASK; unsigned szip_pixels_per_block = 8; hsize_t dims[RANK] = {DIM1, DIM2}; @@ -2544,8 +2544,8 @@ out: static int make_deflate(hid_t loc_id) { - hid_t dcpl = -1; /* dataset creation property list */ - hid_t sid = -1; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf[DIM1][DIM2]; @@ -2684,8 +2684,8 @@ out: static int make_fletcher32(hid_t loc_id) { - hid_t dcpl = -1; /* dataset creation property list */ - hid_t sid = -1; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK]={DIM1,DIM2}; hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; int buf[DIM1][DIM2]; @@ -2751,10 +2751,10 @@ out: static int make_nbit(hid_t loc_id) { - hid_t dcpl = -1; /* dataset creation property list */ - hid_t sid = -1; /* dataspace ID */ - hid_t dtid = -1; - hid_t dsid = -1; + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dtid = H5I_INVALID_HID; + hid_t dsid = H5I_INVALID_HID; hsize_t dims[RANK]={DIM1,DIM2}; hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; int buf[DIM1][DIM2]; @@ -2832,10 +2832,10 @@ out: static int make_scaleoffset(hid_t loc_id) { - hid_t dcpl = -1; /* dataset creation property list */ - hid_t sid = -1; /* dataspace ID */ - hid_t dtid = -1; - hid_t dsid = -1; + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dtid = H5I_INVALID_HID; + hid_t dsid = H5I_INVALID_HID; hsize_t dims[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf[DIM1][DIM2]; @@ -3077,11 +3077,11 @@ int make_early(void) { hsize_t dims[1] ={3000}; hsize_t cdims[1]={30}; - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t tid=-1; - hid_t dcpl=-1; + hid_t fid=H5I_INVALID_HID; + hid_t did=H5I_INVALID_HID; + hid_t sid=H5I_INVALID_HID; + hid_t tid=H5I_INVALID_HID; + hid_t dcpl=H5I_INVALID_HID; int i; char name[16]; int iter=100; @@ -3172,8 +3172,8 @@ out: static int make_layout(hid_t loc_id) { - hid_t dcpl=-1; /* dataset creation property list */ - hid_t sid=-1; /* dataspace ID */ + hid_t dcpl=H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid=H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK]={DIM1,DIM2}; hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; int buf[DIM1][DIM2]; @@ -3286,12 +3286,12 @@ static int make_layout2(hid_t loc_id) { - hid_t contig_dcpl = -1; /* dataset creation property list */ - hid_t chunked_dcpl = -1; /* dataset creation property list */ + hid_t contig_dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t chunked_dcpl = H5I_INVALID_HID; /* dataset creation property list */ int i, j, n; /* Local index variables */ int ret_value = -1; /* Return value */ - hid_t s_sid = -1; /* dataspace ID */ + hid_t s_sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t s_dims[RANK] = {S_DIM1,S_DIM2}; /* Dataspace (< 1 k) */ hsize_t chunk_dims[RANK] = {S_DIM1/2, S_DIM2/2}; /* Dimension sizes for chunks */ @@ -3361,11 +3361,11 @@ out: static int make_layout3(hid_t loc_id) { - hid_t dcpl1=-1; /* dataset creation property list */ - hid_t dcpl2=-1; /* dataset creation property list */ - hid_t dcpl3=-1; /* dataset creation property list */ - hid_t sid1=-1; /* dataspace ID */ - hid_t sid2=-1; /* dataspace ID */ + hid_t dcpl1=H5I_INVALID_HID; /* dataset creation property list */ + hid_t dcpl2=H5I_INVALID_HID; /* dataset creation property list */ + hid_t dcpl3=H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid1=H5I_INVALID_HID; /* dataspace ID */ + hid_t sid2=H5I_INVALID_HID; /* dataspace ID */ hsize_t dims1[RANK]={DIM1_L3,DIM2_L3}; hsize_t dims2[RANK]={SDIM1_L3,SDIM2_L3}; hsize_t maxdims[RANK]={H5S_UNLIMITED, H5S_UNLIMITED}; @@ -3494,8 +3494,8 @@ out: static int make_fill(hid_t loc_id) { - hid_t did=-1; - hid_t sid=-1; + hid_t did=H5I_INVALID_HID; + hid_t sid=H5I_INVALID_HID; hid_t dcpl; hsize_t dims[2]={3,2}; int buf[3][2]= {{1,1},{1,2},{2,2}}; @@ -3547,9 +3547,9 @@ out: static int make_big(hid_t loc_id) { - hid_t did=-1; - hid_t f_sid=-1; - hid_t m_sid=-1; + hid_t did=H5I_INVALID_HID; + hid_t f_sid=H5I_INVALID_HID; + hid_t m_sid=H5I_INVALID_HID; hid_t tid; hid_t dcpl; hsize_t dims[1]={ H5TOOLS_MALLOCSIZE + 1}; /* dataset dimensions */ @@ -3628,8 +3628,8 @@ out: static int make_external(hid_t loc_id) { - hid_t did=-1; - hid_t sid=-1; + hid_t did=H5I_INVALID_HID; + hid_t sid=H5I_INVALID_HID; hid_t dcpl; int buf[2]={1,2}; hsize_t cur_size[1]; /* data space current size */ @@ -3682,8 +3682,8 @@ out: static int make_userblock(void) { - hid_t fid = -1; - hid_t fcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t fcpl = H5I_INVALID_HID; int fd = -1; /* File descriptor for writing userblock */ char ub[USERBLOCK_SIZE]; /* User block data */ ssize_t nwritten; /* # of bytes written */ @@ -3744,8 +3744,8 @@ out: static int verify_userblock( const char* filename) { - hid_t fid = -1; - hid_t fcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t fcpl = H5I_INVALID_HID; int fd = -1; /* File descriptor for writing userblock */ char ub[USERBLOCK_SIZE]; /* User block data */ hsize_t ub_size = 0; /* User block size */ @@ -3874,10 +3874,10 @@ int write_dset_in(hid_t loc_id, GREEN } e_t; - hid_t did=-1; - hid_t sid=-1; - hid_t tid=-1; - hid_t pid=-1; + hid_t did=H5I_INVALID_HID; + hid_t sid=H5I_INVALID_HID; + hid_t tid=H5I_INVALID_HID; + hid_t pid=H5I_INVALID_HID; unsigned i, j; int val, k, n; float f; @@ -4620,10 +4620,10 @@ out: static int make_dset_reg_ref(hid_t loc_id) { - hid_t did1=-1; /* Dataset ID */ - hid_t did2=-1; /* Dereferenced dataset ID */ - hid_t sid1=-1; /* Dataspace ID #1 */ - hid_t sid2=-1; /* Dataspace ID #2 */ + hid_t did1=H5I_INVALID_HID; /* Dataset ID */ + hid_t did2=H5I_INVALID_HID; /* Dereferenced dataset ID */ + hid_t sid1=H5I_INVALID_HID; /* Dataspace ID #1 */ + hid_t sid2=H5I_INVALID_HID; /* Dataspace ID #2 */ hsize_t dims1[] = {SPACE1_DIM1}; hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ @@ -4739,9 +4739,9 @@ int write_attr_in(hid_t loc_id, GREEN } e_t; - hid_t aid = -1; - hid_t sid = -1; - hid_t tid = -1; + hid_t aid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; int val, j, k, n; unsigned i; float f; @@ -4824,7 +4824,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_BITFIELD @@ -4854,7 +4854,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_OPAQUE @@ -4881,7 +4881,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_COMPOUND @@ -4919,7 +4919,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_REFERENCE @@ -4968,7 +4968,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_VLEN @@ -5013,13 +5013,13 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; if (H5Sclose(sid) < 0) goto out; - sid = -1; + sid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_ARRAY @@ -5054,7 +5054,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT @@ -5132,7 +5132,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_BITFIELD @@ -5165,7 +5165,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_OPAQUE @@ -5193,7 +5193,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_COMPOUND @@ -5229,7 +5229,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_REFERENCE @@ -5284,7 +5284,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_VLEN @@ -5335,13 +5335,13 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; if (H5Sclose(sid) < 0) goto out; - sid = -1; + sid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_ARRAY @@ -5384,7 +5384,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT @@ -5504,7 +5504,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_BITFIELD @@ -5558,7 +5558,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_OPAQUE @@ -5572,7 +5572,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_COMPOUND @@ -5658,7 +5658,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_REFERENCE @@ -5743,7 +5743,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_VLEN @@ -5797,13 +5797,13 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; if (H5Sclose(sid) < 0) goto out; - sid = -1; + sid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_ARRAY @@ -5837,7 +5837,7 @@ int write_attr_in(hid_t loc_id, goto out; if (H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT @@ -5917,7 +5917,7 @@ int make_dset(hid_t loc_id, hid_t dcpl, void *buf) { - hid_t did=-1; + hid_t did=H5I_INVALID_HID; if ((did = H5Dcreate2(loc_id, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) return -1; @@ -5954,8 +5954,8 @@ int write_dset( hid_t loc_id, hid_t tid, void *buf ) { - hid_t did=-1; - hid_t sid=-1; + hid_t did=H5I_INVALID_HID; + hid_t sid=H5I_INVALID_HID; if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) return -1; @@ -6040,11 +6040,11 @@ static int make_named_dtype(hid_t loc_id) { hsize_t dims[1] ={3}; - hid_t did=-1; - hid_t aid=-1; - hid_t sid=-1; - hid_t tid=-1; - hid_t gid=-1; + hid_t did=H5I_INVALID_HID; + hid_t aid=H5I_INVALID_HID; + hid_t sid=H5I_INVALID_HID; + hid_t tid=H5I_INVALID_HID; + hid_t gid=H5I_INVALID_HID; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 9674a77..0c07418 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -93,16 +93,10 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -111,7 +105,7 @@ NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${resultfile}.out" @@ -125,7 +119,7 @@ macro (ADD_H5_ERR_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -134,7 +128,7 @@ NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c index 2edfcf6..0bf1001 100644 --- a/tools/test/h5stat/h5stat_gentest.c +++ b/tools/test/h5stat/h5stat_gentest.c @@ -54,14 +54,14 @@ static void gen_newgrat_file(const char *fname) { - hid_t fcpl = -1; /* File creation property */ - hid_t fapl = -1; /* File access property */ - hid_t fid = -1; /* File id */ - hid_t gid = -1; /* Group id */ - hid_t tid = -1; /* Datatype id */ - hid_t sid = -1; /* Dataspace id */ - hid_t attr_id = -1; /* Attribute id */ - hid_t did = -1; /* Dataset id */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property */ + hid_t fapl = H5I_INVALID_HID; /* File access property */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t gid = H5I_INVALID_HID; /* Group id */ + hid_t tid = H5I_INVALID_HID; /* Datatype id */ + hid_t sid = H5I_INVALID_HID; /* Dataspace id */ + hid_t attr_id = H5I_INVALID_HID; /* Attribute id */ + hid_t did = H5I_INVALID_HID; /* Dataset id */ char name[30]; /* Group name */ char attrname[30]; /* Attribute name */ int i; /* Local index variable */ @@ -139,15 +139,15 @@ error: static void gen_threshold_file(const char *fname) { - hid_t fid = -1; /* File ID */ - hid_t sid0 = -1; /* Dataspace IDs */ - hid_t sid1 = -1; /* Dataspace IDs */ - hid_t sid2 = -1; /* Dataspace IDs */ - hid_t sid3 = -1; /* Dataspace IDs */ - hid_t sid4 = -1; /* Dataspace IDs */ - hid_t did = -1; /* Dataset ID */ - hid_t attr_id = -1; /* Attribute ID */ - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t sid0 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t sid1 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t sid3 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t sid4 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t attr_id = H5I_INVALID_HID; /* Attribute ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ hsize_t two_dims[] = {2, 5}; /* Dimension array */ hsize_t one_dims[] = {6}; /* Dimension array */ hsize_t zero_dims[] = {0}; /* Dimension array */ @@ -323,11 +323,11 @@ error: static void gen_idx_file(const char *fname) { - hid_t fapl = -1; /* file access property id */ - hid_t fid = -1; /* file id */ - hid_t sid = -1; /* space id */ - hid_t dcpl = -1; /* dataset creation property id */ - hid_t did = -1, did2 = -1; /* dataset id */ + hid_t fapl = H5I_INVALID_HID; /* file access property id */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t sid = H5I_INVALID_HID; /* space id */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */ + hid_t did = -1, did2 = H5I_INVALID_HID; /* dataset id */ hsize_t dims[1] = {10}; /* dataset dimension */ hsize_t c_dims[1] = {2}; /* chunk dimension */ int i; /* local index variable */ @@ -413,12 +413,12 @@ error: static void gen_err_refcount(const char *fname) { - hid_t fid = -1; /* File identifier */ - hid_t sid = -1; /* Dataspace message */ - hid_t did = -1; /* Dataset identifier */ - hid_t gid = -1; /* Group identifier */ - hid_t aid1 = -1, aid2 = -1; /* Attribute identifier */ - hid_t tid = -1; /* Datatype identifier */ + hid_t fid = H5I_INVALID_HID; /* File identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace message */ + hid_t did = H5I_INVALID_HID; /* Dataset identifier */ + hid_t gid = H5I_INVALID_HID; /* Group identifier */ + hid_t aid1 = -1, aid2 = H5I_INVALID_HID; /* Attribute identifier */ + hid_t tid = H5I_INVALID_HID; /* Datatype identifier */ int i, n; /* Local index variables */ int buf[10]; /* Data buffer */ hsize_t dims[1]; /* Dimension size */ diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index a2c494d..cb285e4 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -83,12 +83,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - # Need special dependencies for tests that use the same reference file # This is an issue on Windows macro (ADD_H5_CMP testname resultfile resultcode) @@ -97,7 +91,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -114,7 +108,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -144,7 +138,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -176,7 +170,7 @@ NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN};${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}.out" @@ -195,7 +189,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR_RET-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> ${ARGN} ) set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -222,7 +216,7 @@ NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_before_size.out" @@ -236,12 +230,12 @@ if (NOT ${incr_size} MATCHES "NONE") add_test ( NAME H5CLEAR_FILESIZE_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> --increment=${incr_size} ${testname}.h5 ) else () add_test ( NAME H5CLEAR_FILESIZE_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> --increment ${testname}.h5 ) endif () set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES @@ -253,7 +247,7 @@ NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_after_size.out" @@ -285,7 +279,7 @@ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_before_size.out" @@ -299,12 +293,12 @@ if (NOT ${incr_size} MATCHES "NONE") add_test ( NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment=${incr_size} ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s --increment=${incr_size} ${testname}.h5 ) else () add_test ( NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s --increment ${testname}.h5 ) endif () set_tests_properties (H5CLEAR_FILESIZE_FAIL_INCR-${testname} PROPERTIES @@ -315,7 +309,7 @@ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_after_size.out" @@ -352,7 +346,7 @@ # After "h5clear" the file, the subsequent file open succeeds add_test ( NAME H5CLEAR-h5clr-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s ${testfile}.h5 ) set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode} diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake index c947e0e..fb9e5ba 100644 --- a/tools/test/misc/CMakeTestsMkgrp.cmake +++ b/tools/test/misc/CMakeTestsMkgrp.cmake @@ -54,34 +54,33 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - macro (ADD_H5_TEST resultfile resultcode resultoption) - add_test ( - NAME H5MKGRP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 - ) - set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - ) - add_test ( - NAME H5MKGRP-${resultfile} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} - ) - set_tests_properties (H5MKGRP-${resultfile} PROPERTIES - DEPENDS H5MKGRP-${resultfile}-clear-objects - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - ) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5MKGRP-${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} + ) + else () + add_test ( + NAME H5MKGRP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ) + set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5MKGRP-${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} + ) + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES + DEPENDS H5MKGRP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) add_test ( NAME H5MKGRP-${resultfile}-h5ls COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -96,7 +95,7 @@ macro (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${ARGN}) + add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${ARGN}) else () add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects @@ -109,7 +108,7 @@ NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_ext}>" + -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_file_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index fa49c53..14b349c 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -58,12 +58,6 @@ ############################################################################## ############################################################################## - if (NOT BUILD_SHARED_LIBS) - set (tgt_ext "") - else () - set (tgt_ext "-shared") - endif () - # Remove any output file left over from previous test run add_test ( NAME H5REPART-clearall-objects @@ -82,7 +76,7 @@ # repartition family member size to 20,000 bytes. add_test ( NAME H5REPART-h5repart_20K - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5 ) set_tests_properties (H5REPART-h5repart_20K PROPERTIES FIXTURES_REQUIRED clear_testrepart @@ -91,7 +85,7 @@ # repartition family member size to 5 KB. add_test ( NAME H5REPART-h5repart_5K - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5 ) set_tests_properties (H5REPART-h5repart_5K PROPERTIES FIXTURES_REQUIRED clear_testrepart @@ -100,7 +94,7 @@ # convert family file to sec2 file of 20,000 bytes add_test ( NAME H5REPART-h5repart_single - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5 ) set_tests_properties (H5REPART-h5repart_single PROPERTIES FIXTURES_REQUIRED clear_testrepart @@ -109,7 +103,7 @@ # convert family file to sec2 file of 20,000 bytes (old argument) add_test ( NAME H5REPART-h5repart_sec2 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5 ) set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES FIXTURES_REQUIRED clear_testrepart diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 96d7e75e7..d5f415e 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -56,10 +56,10 @@ const char *FILENAME_ENHANCE[] = { static int gen_cache_image_file(const char *fname) { - hid_t fid = -1; /* File ID */ - hid_t did = -1, sid = -1; /* Dataset ID, dataspace ID */ - hid_t fapl = -1; /* File access property list */ - hid_t dcpl = -1; /* Dataset creation property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t did = -1, sid = H5I_INVALID_HID; /* Dataset ID, dataspace ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ hsize_t dims[2]; /* Dimension sizes */ hsize_t chunks[2]; /* Chunked dimension sizes */ int buf[50][100]; /* Buffer for data to write */ @@ -164,13 +164,13 @@ error: static int gen_enhance_files(hbool_t user) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim[1]; /* Dimension sizes */ int data[NUM_ELMTS]; /* Buffer for data */ - int fd = -1; /* The file descriptor ID */ + int fd = H5I_INVALID_HID; /* The file descriptor ID */ int64_t eoa; /* The EOA value */ uint32_t chksum; /* The chksum value */ int i = 0 , j = 0, u = 0; /* Local index variable */ @@ -361,13 +361,13 @@ error: int main(void) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ - hid_t fapl = -1, new_fapl = -1; /* File access property lists */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ + hid_t fapl = -1, new_fapl = H5I_INVALID_HID; /* File access property lists */ char fname[512]; /* File name */ unsigned new_format; /* To use latest library format or not */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim[1]; /* Dimension sizes */ int data[NUM_ELMTS]; /* Buffer for data */ int i; /* Local index variables */ diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index d6774dc..c69d1f7 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -32,9 +32,9 @@ const char *setname = "align"; int main(void) { - hid_t fil=-1, spc=-1, set=H5I_INVALID_HID; - hid_t cs6=-1, cmp=-1, fix=H5I_INVALID_HID; - hid_t cmp1=-1, cmp2=-1, cmp3=H5I_INVALID_HID; + hid_t fil=H5I_INVALID_HID, spc=H5I_INVALID_HID, set=H5I_INVALID_HID; + hid_t cs6=H5I_INVALID_HID, cmp=H5I_INVALID_HID, fix=H5I_INVALID_HID; + hid_t cmp1=H5I_INVALID_HID, cmp2=H5I_INVALID_HID, cmp3=H5I_INVALID_HID; hid_t plist=H5I_INVALID_HID; hid_t array_dt=H5I_INVALID_HID; diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 804f88e..3603c9b 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -72,7 +72,7 @@ /* #define DIAG_NRDCC 521 */ static size_t nio_g; -static hid_t fapl_g = -1; +static hid_t fapl_g = H5I_INVALID_HID; /* Local function prototypes */ static size_t |