diff options
Diffstat (limited to 'test')
127 files changed, 2641 insertions, 2013 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 949a228..29857e5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- @@ -30,10 +30,10 @@ add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS} TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -endif (MSVC) +endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -endif (MINGW) +endif () target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES @@ -46,10 +46,10 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") - endif (MSVC) + endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") - endif (MINGW) + endif () target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES @@ -63,8 +63,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -95,10 +95,7 @@ endif (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - SHARED ${HDF5_PACKAGE_SOVERSION} - ) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- @@ -112,7 +109,7 @@ endif (BUILD_SHARED_LIBS) "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) - endforeach (test_lib ${TEST_PLUGIN_LIBS}) + endforeach () foreach (test_lib ${TEST2_PLUGIN_LIBS}) set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") @@ -124,10 +121,7 @@ endif (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - SHARED ${HDF5_PACKAGE_SOVERSION} - ) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- @@ -141,7 +135,7 @@ endif (BUILD_SHARED_LIBS) "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) - endforeach (test_lib ${TEST2_PLUGIN_LIBS}) + endforeach () set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/testhdf5.c @@ -183,7 +177,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) @@ -197,8 +191,8 @@ MACRO (ADD_H5_EXE file) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) - endif (BUILD_SHARED_LIBS) -ENDMACRO (ADD_H5_EXE file) + endif () +ENDMACRO () set (H5_TESTS accum @@ -255,7 +249,7 @@ set (H5_TESTS foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -endforeach (test ${H5_TESTS}) +endforeach () ############################################################################## ############################################################################## @@ -275,7 +269,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache-shared SHARED " " " ") target_link_libraries (cache-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for cache_api add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) @@ -289,7 +283,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache_api-shared SHARED " " " ") target_link_libraries (cache_api-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache_api-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for hyperslab add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) @@ -308,8 +302,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #-- Adding test for ttsafe add_executable (ttsafe @@ -340,8 +334,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -356,8 +350,8 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) TARGET_C_PROPERTIES (err_compat-shared SHARED " " " ") target_link_libraries (err_compat-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (err_compat-shared PROPERTIES FOLDER test) - endif (BUILD_SHARED_LIBS) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) + endif () +endif () #-- Adding test for error_test add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) @@ -371,7 +365,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (error_test-shared SHARED " " " ") target_link_libraries (error_test-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (error_test-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for links_env add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) @@ -385,7 +379,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (links_env-shared SHARED " " " ") target_link_libraries (links_env-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (links_env-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) @@ -393,9 +387,9 @@ file (WRITE ${GREP_RUNNER} "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -else (\${TEST_RESULT} STREQUAL \"0\") +else () message (STATUS \"COMMAND Result: \${TEST_RESULT}\") -endif (\${TEST_RESULT} STREQUAL \"0\") +endif () " ) @@ -408,12 +402,12 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (plugin SHARED " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -else (BUILD_SHARED_LIBS) +else () add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin STATIC) TARGET_C_PROPERTIES (plugin STATIC " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1336349..154fed9 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. + ############################################################################## ############################################################################## @@ -9,11 +20,11 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files") -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") -endif (BUILD_SHARED_LIBS) +endif () if (HDF5_TEST_VFD) set (VFD_LIST @@ -26,14 +37,14 @@ if (HDF5_TEST_VFD) ) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") - #if (BUILD_SHARED_LIBS) - # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - #endif (BUILD_SHARED_LIBS) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") + endif () + endforeach () +endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -44,20 +55,20 @@ set (HDF5_TEST_FILES foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (h5_tfile ${HDF5_TEST_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (h5_tfile ${HDF5_TEST_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -72,20 +83,20 @@ set (HDF5_REFERENCE_FILES foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (ref_file ${HDF5_REFERENCE_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (ref_file ${HDF5_REFERENCE_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory @@ -128,24 +139,24 @@ set (HDF5_REFERENCE_TEST_FILES foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) -endif() +endif () # Remove any output file left over from previous test run add_test (NAME H5TEST-clear-testhdf5-objects @@ -197,14 +208,23 @@ if (HDF5_ENABLE_USING_MEMCHECKER) ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -else (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-testhdf5 COMMAND $<TARGET_FILE:testhdf5>) +else () + add_test (NAME H5TEST-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-testhdf5 PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME H5TEST-shared-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -228,14 +248,23 @@ else (HDF5_ENABLE_USING_MEMCHECKER) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-testhdf5 COMMAND $<TARGET_FILE:testhdf5-shared>) + add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES DEPENDS H5TEST-shared-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif (BUILD_SHARED_LIBS) -endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () +endif () ############################################################################## ############################################################################## @@ -243,69 +272,73 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## +set (test_CLEANFILES + dt_arith1.h5 + dt_arith2.h5 + dtransform.h5 + dtypes3.h5 + dtypes4.h5 + dtypes5.h5 + efc0.h5 + efc1.h5 + efc2.h5 + efc3.h5 + efc4.h5 + efc5.h5 + extlinks16A00000.h5 + extlinks16A00001.h5 + extlinks16A00002.h5 + extlinks16B-b.h5 + extlinks16B-g.h5 + extlinks16B-l.h5 + extlinks16B-r.h5 + extlinks16B-s.h5 + extlinks19B00000.h5 + extlinks19B00001.h5 + extlinks19B00002.h5 + extlinks19B00003.h5 + extlinks19B00004.h5 + extlinks19B00005.h5 + extlinks19B00006.h5 + extlinks19B00007.h5 + extlinks19B00008.h5 + extlinks19B00009.h5 + extlinks19B00010.h5 + extlinks19B00011.h5 + extlinks19B00012.h5 + extlinks19B00013.h5 + extlinks19B00014.h5 + extlinks19B00015.h5 + extlinks19B00016.h5 + extlinks19B00017.h5 + extlinks19B00018.h5 + extlinks19B00019.h5 + extlinks19B00020.h5 + extlinks19B00021.h5 + extlinks19B00022.h5 + extlinks19B00023.h5 + extlinks19B00024.h5 + extlinks19B00025.h5 + extlinks19B00026.h5 + extlinks19B00027.h5 + extlinks19B00028.h5 + fheap.h5 + log_vfd_out.log + new_multi_file_v16-r.h5 + new_multi_file_v16-s.h5 + objcopy_ext.dat + testmeta.h5 + tstint1.h5 + tstint2.h5 + unregister_filter_1.h5 + unregister_filter_2.h5 +) + # Remove any output file left over from previous test run add_test (NAME H5TEST-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - dt_arith1.h5 - dt_arith2.h5 - dtransform.h5 - dtypes3.h5 - dtypes4.h5 - dtypes5.h5 - efc0.h5 - efc1.h5 - efc2.h5 - efc3.h5 - efc4.h5 - efc5.h5 - extlinks16A00000.h5 - extlinks16A00001.h5 - extlinks16A00002.h5 - extlinks16B-b.h5 - extlinks16B-g.h5 - extlinks16B-l.h5 - extlinks16B-r.h5 - extlinks16B-s.h5 - extlinks19B00000.h5 - extlinks19B00001.h5 - extlinks19B00002.h5 - extlinks19B00003.h5 - extlinks19B00004.h5 - extlinks19B00005.h5 - extlinks19B00006.h5 - extlinks19B00007.h5 - extlinks19B00008.h5 - extlinks19B00009.h5 - extlinks19B00010.h5 - extlinks19B00011.h5 - extlinks19B00012.h5 - extlinks19B00013.h5 - extlinks19B00014.h5 - extlinks19B00015.h5 - extlinks19B00016.h5 - extlinks19B00017.h5 - extlinks19B00018.h5 - extlinks19B00019.h5 - extlinks19B00020.h5 - extlinks19B00021.h5 - extlinks19B00022.h5 - extlinks19B00023.h5 - extlinks19B00024.h5 - extlinks19B00025.h5 - extlinks19B00026.h5 - extlinks19B00027.h5 - extlinks19B00028.h5 - fheap.h5 - log_vfd_out.log - new_multi_file_v16-r.h5 - new_multi_file_v16-s.h5 - objcopy_ext.dat - testmeta.h5 - tstint1.h5 - tstint2.h5 - unregister_filter_1.h5 - unregister_filter_2.h5 + ${test_CLEANFILES} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -315,15 +348,15 @@ foreach (test ${H5_TESTS}) add_test (NAME H5TEST-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" ) - else (${test} STREQUAL "big" AND CYGWIN) + else () add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>) - endif (${test} STREQUAL "big" AND CYGWIN) + endif () set_tests_properties (H5TEST-${test} PROPERTIES DEPENDS H5TEST-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -endforeach (test ${H5_TESTS}) +endforeach () set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) @@ -331,70 +364,12 @@ set_tests_properties (H5TEST-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT 2400) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) # Remove any output file left over from previous test run add_test (NAME H5TEST-shared-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - dt_arith1.h5 - dt_arith2.h5 - dtransform.h5 - dtypes3.h5 - dtypes4.h5 - dtypes5.h5 - efc0.h5 - efc1.h5 - efc2.h5 - efc3.h5 - efc4.h5 - efc5.h5 - extlinks16A00000.h5 - extlinks16A00001.h5 - extlinks16A00002.h5 - extlinks16B-b.h5 - extlinks16B-g.h5 - extlinks16B-l.h5 - extlinks16B-r.h5 - extlinks16B-s.h5 - extlinks19B00000.h5 - extlinks19B00001.h5 - extlinks19B00002.h5 - extlinks19B00003.h5 - extlinks19B00004.h5 - extlinks19B00005.h5 - extlinks19B00006.h5 - extlinks19B00007.h5 - extlinks19B00008.h5 - extlinks19B00009.h5 - extlinks19B00010.h5 - extlinks19B00011.h5 - extlinks19B00012.h5 - extlinks19B00013.h5 - extlinks19B00014.h5 - extlinks19B00015.h5 - extlinks19B00016.h5 - extlinks19B00017.h5 - extlinks19B00018.h5 - extlinks19B00019.h5 - extlinks19B00020.h5 - extlinks19B00021.h5 - extlinks19B00022.h5 - extlinks19B00023.h5 - extlinks19B00024.h5 - extlinks19B00025.h5 - extlinks19B00026.h5 - extlinks19B00027.h5 - extlinks19B00028.h5 - fheap.h5 - log_vfd_out.log - new_multi_file_v16-r.h5 - new_multi_file_v16-s.h5 - objcopy_ext.dat - testmeta.h5 - tstint1.h5 - tstint2.h5 - unregister_filter_1.h5 - unregister_filter_2.h5 + ${test_CLEANFILES} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) @@ -404,22 +379,31 @@ if (BUILD_SHARED_LIBS) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) - else (${test} STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-shared-${test} COMMAND $<TARGET_FILE:${test}-shared>) - endif (${test} STREQUAL "big" AND CYGWIN) + else () + add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-${test} PROPERTIES DEPENDS H5TEST-shared-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endforeach (test ${H5_TESTS}) + endforeach () set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 2400) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ############################################################################## @@ -504,7 +488,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif () #-- Adding test for error_test add_test (NAME H5TEST-clear-error_test-objects @@ -567,7 +551,7 @@ add_test (NAME H5TEST-testlibinfo ${HDF5_TEST_BINARY_DIR}/H5TEST ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) #-- Adding test for cache if (NOT CYGWIN) add_test (NAME H5TEST-shared-clear-cache-objects @@ -577,14 +561,27 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>) + else () + add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:cache-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache-shared.txt" + #-D "TEST_REFERENCE=cache-shared.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 2400) - endif (NOT CYGWIN) + endif () #-- Adding test for cache_api add_test ( @@ -646,7 +643,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) + endif () #-- Adding test for error_test add_test (NAME H5TEST-shared-clear-error_test-objects @@ -708,16 +705,16 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ### P L U G I N T E S T S ############################################################################## if (WIN32) set (CMAKE_SEP "\;") -else (WIN32) +else () set (CMAKE_SEP ":") -endif (WIN32) +endif () add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) set_tests_properties (H5PLUGIN-plugin PROPERTIES @@ -735,14 +732,16 @@ if (HDF5_TEST_VFD) set (H5_VFD_TESTS testhdf5 - accum +# cache + cache_api lheap ohdr stab gheap - cache - cache_api pool + accum + btree2 +# fheap hyperslab istore bittests @@ -768,7 +767,7 @@ if (HDF5_TEST_VFD) set_extent ttsafe getname - vfd +# vfd ntypes dangle dtransform @@ -776,20 +775,19 @@ if (HDF5_TEST_VFD) cross_read freespace mf - btree2 - #fheap - error_test - err_compat - tcheck_version - testmeta - links_env +# error_test +# err_compat + #tcheck_version +# testmeta +# links_env unregister ) if (NOT CYGWIN) - set (H5_VFD_TESTS ${H5_VFD_TESTS} big) - endif (NOT CYGWIN) + set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache) + endif () - MACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) + # Windows only macro + macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) @@ -807,7 +805,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>" @@ -822,18 +820,18 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - else (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" ) - endif (BUILD_SHARED_LIBS) - endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) - else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") + endif () + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>" @@ -848,7 +846,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>" @@ -863,9 +861,9 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") - else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") + endif () + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>" @@ -880,7 +878,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS AND NOT ${vfdtest} STREQUAL "cache") add_test (NAME VFD-${vfdname}-${vfdtest}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>" @@ -895,15 +893,15 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") - ENDMACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) + endif () + endif () + endmacro () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_VFD_TESTS}) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) - else (WIN32) + else () add_test (NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${test}>" @@ -918,7 +916,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>" @@ -933,9 +931,9 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (WIN32) - endforeach (test ${H5_VFD_TESTS}) + endif () + endif () + endforeach () set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) @@ -943,7 +941,10 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-testhdf5 PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-gheap PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1200) - if (BUILD_SHARED_LIBS) + if (NOT CYGWIN) + set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) @@ -951,7 +952,10 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) - endif (BUILD_SHARED_LIBS) + if (NOT CYGWIN AND NOT WIN32) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + endif () + endif () if (HDF5_TEST_FHEAP_VFD) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -968,7 +972,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME VFD-${vfdname}-fheap-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:fheap-shared>" @@ -984,16 +988,16 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (HDF5_TEST_FHEAP_VFD) - ENDMACRO (ADD_VFD_TEST) + endif () + endif () + endmacro () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () ############################################################################## ############################################################################## @@ -1002,13 +1006,13 @@ endif (HDF5_TEST_VFD) ############################################################################## if (HDF5_BUILD_GENERATORS) - MACRO (ADD_H5_GENERATOR genfile) + macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) - ENDMACRO (ADD_H5_GENERATOR genfile) + endmacro () # generator executables set (H5_GENERATORS @@ -1032,6 +1036,6 @@ if (HDF5_BUILD_GENERATORS) foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - endforeach (gen ${H5_GENERATORS}) + endforeach () -endif (HDF5_BUILD_GENERATORS) +endif () diff --git a/test/COPYING b/test/COPYING index 6903daf..6497ace 100644 --- a/test/COPYING +++ b/test/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 81624d8..1c02f46 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/H5srcdir_str.h.in b/test/H5srcdir_str.h.in index d472124..bab1df3 100644 --- a/test/H5srcdir_str.h.in +++ b/test/H5srcdir_str.h.in @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* If you are reading this file and it has a '.h' suffix, it was automatically diff --git a/test/Makefile.am b/test/Makefile.am index f3c2ca5..7fbccdd 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. @@ -75,25 +73,36 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif +if NOT_UNAME_CYGWIN if HAVE_SHARED_CONDITIONAL - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la - # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + noinst_LTLIBRARIES=libh5test.la libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c + libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* +libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) +libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) + +libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) + +libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la endif +endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c diff --git a/test/Makefile.in b/test/Makefile.in index c5f95cd..473622e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -21,12 +21,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF5 Library Test Makefile(.in) # @@ -127,68 +125,48 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) libdynlib1_la_LIBADD = am__libdynlib1_la_SOURCES_DIST = dynlib1.c -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo libdynlib1_la_OBJECTS = $(am_libdynlib1_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib1_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib1_la_rpath = libdynlib2_la_LIBADD = am__libdynlib2_la_SOURCES_DIST = dynlib2.c -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo libdynlib2_la_OBJECTS = $(am_libdynlib2_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib2_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib2_la_rpath = libdynlib3_la_LIBADD = am__libdynlib3_la_SOURCES_DIST = dynlib3.c -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo libdynlib3_la_OBJECTS = $(am_libdynlib3_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib3_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib3_la_rpath = libdynlib4_la_LIBADD = am__libdynlib4_la_SOURCES_DIST = dynlib4.c -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_OBJECTS = dynlib4.lo +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib4_la_OBJECTS = dynlib4.lo libdynlib4_la_OBJECTS = $(am_libdynlib4_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib4_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib4_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libdynlib4_la_rpath = libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_FALSE@am_libh5test_la_rpath = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libh5test_la_rpath = +@HAVE_SHARED_CONDITIONAL_FALSE@@NOT_UNAME_CYGWIN_TRUE@am_libh5test_la_rpath = +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@am_libh5test_la_rpath = am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ stab$(EXEEXT) gheap$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \ pool$(EXEEXT) accum$(EXEEXT) hyperslab$(EXEEXT) \ @@ -614,6 +592,33 @@ am__tty_colors = { \ std='[m'; \ fi; \ } +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -925,6 +930,7 @@ THREADSAFE = @THREADSAFE@ TIME = @TIME@ TR = @TR@ TRACE_API = @TRACE_API@ +UNAME_CYGWIN = @UNAME_CYGWIN@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ @@ -1111,13 +1117,16 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_i gen_noencoder gen_nullspace gen_udlinks space_overflow gen_sizes_lheap \ gen_file_image -@HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la -@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c -@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c -@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_SOURCES = dynlib3.c -@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib4_la_SOURCES = dynlib4.c +@HAVE_SHARED_CONDITIONAL_FALSE@@NOT_UNAME_CYGWIN_TRUE@noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@noinst_LTLIBRARIES = libh5test.la libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib1_la_SOURCES = dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib2_la_SOURCES = dynlib2.c +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib3_la_SOURCES = dynlib3.c +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib4_la_SOURCES = dynlib4.c +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -1140,7 +1149,7 @@ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Temporary files. DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -1206,41 +1215,6 @@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ @@ -1252,17 +1226,29 @@ clean-noinstLTLIBRARIES: rm -f $${locs}; \ } -libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) + +@NOT_UNAME_CYGWIN_FALSE@libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) +@NOT_UNAME_CYGWIN_FALSE@ $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) + +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) + +@NOT_UNAME_CYGWIN_FALSE@libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) +@NOT_UNAME_CYGWIN_FALSE@ $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) -libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) -libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) +@NOT_UNAME_CYGWIN_FALSE@libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) +@NOT_UNAME_CYGWIN_FALSE@ $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) -libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) + +@NOT_UNAME_CYGWIN_FALSE@libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) +@NOT_UNAME_CYGWIN_FALSE@ $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) @@ -2254,9 +2240,6 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -2291,12 +2274,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -2322,9 +2303,8 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: + install-html: install-html-am install-html-am: @@ -2363,26 +2343,24 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES +uninstall-am: -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ - clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-libLTLIBRARIES + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile @@ -2398,15 +2376,21 @@ uninstall-am: uninstall-libLTLIBRARIES help: @$(top_srcdir)/bin/makehelp -@HAVE_SHARED_CONDITIONAL_TRUE@ # The libh5test library provides common support code for the tests. +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@ # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@ # Build it as shared library if configure is enabled for shared library. + +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@ $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) -@HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. -@HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@ $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@ $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) -@HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@ $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) +@HAVE_SHARED_CONDITIONAL_FALSE@@NOT_UNAME_CYGWIN_TRUE@ # The libh5test library provides common support code for the tests. # Additional target for running timing test timings _timings: testmeta diff --git a/test/accum.c b/test/accum.c index 651ba56..d298aec 100644 --- a/test/accum.c +++ b/test/accum.c @@ -1,15 +1,14 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Mike McGreevy diff --git a/test/app_ref.c b/test/app_ref.c index 3052df7..3ef3fef 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -185,6 +183,10 @@ main (void) PASSED(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + /* Clean up any file(s) created */ h5_reset(); fapl = H5Pcreate (H5P_FILE_ACCESS); h5_cleanup (FILENAME, fapl); @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -120,7 +118,7 @@ static hsize_t values_used[WRT_N]; static hsize_t randll(hsize_t limit, int current_index) { - hsize_t acc; + hsize_t acc = 0; int overlap = 1; int i; int tries = 0; @@ -508,7 +506,7 @@ reader(char *filename, hid_t fapl) if('#' != ln[0]) break; i = (int)HDstrtol(ln + 1, &s, 10); - hs_offset[0] = HDstrtoll(s, NULL, 0); + hs_offset[0] = HDstrtoull(s, NULL, 0); HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], ""); HDfflush(stdout); @@ -618,8 +616,8 @@ test_sec2(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); return 0; error: @@ -655,8 +653,8 @@ test_stdio(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); HDfflush(stdout); return 0; @@ -716,8 +714,8 @@ test_family(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); return 0; error: diff --git a/test/bittests.c b/test/bittests.c index c527bb8..21ced0f 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/btree2.c b/test/btree2.c index 43d3d13..fa56f24 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> diff --git a/test/cache.c b/test/cache.c index df6d805..adc9909 100644 --- a/test/cache.c +++ b/test/cache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer @@ -19,10 +17,6 @@ * This file contains tests for the cache implemented in * H5C.c */ -#include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "cache_common.h" diff --git a/test/cache_api.c b/test/cache_api.c index 8f556be..9b791cf 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer @@ -20,11 +18,9 @@ * with the cache implemented in H5C.c */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "cache_common.h" +/* extern declarations */ /* global variable declarations: */ @@ -50,19 +46,19 @@ static void check_file_mdc_api_errs(void); /**************************************************************************/ /*------------------------------------------------------------------------- - * Function: check_fapl_mdc_api_calls() + * Function: check_fapl_mdc_api_calls() * - * Purpose: Verify that the file access property list related - * metadata cache related API calls are functioning - * correctly. + * Purpose: Verify that the file access property list related + * metadata cache related API calls are functioning + * correctly. * - * Since we have tested the H5C code elsewhere, it should - * be sufficient to verify that the desired configuration - * data is getting to the cache. + * Since we have tested the H5C code elsewhere, it should + * be sufficient to verify that the desired configuration + * data is getting to the cache. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/12/04 * *------------------------------------------------------------------------- @@ -131,13 +127,13 @@ check_fapl_mdc_api_calls(void) if ( pass ) { - fapl_id = H5Pcreate(H5P_FILE_ACCESS); + fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if ( fapl_id < 0 ) { + if ( fapl_id < 0 ) { - pass = FALSE; + pass = FALSE; failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; - } + } } if ( pass ) { @@ -149,7 +145,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if (!CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE)) { @@ -170,7 +166,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pset_mdc_config() failed.\n"; + failure_mssg = "H5Pset_mdc_config() failed.\n"; } } @@ -183,7 +179,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if ( ! CACHE_CONFIGS_EQUAL(mod_config, scratch, TRUE, TRUE) ) { @@ -197,7 +193,7 @@ check_fapl_mdc_api_calls(void) if ( H5Pclose(fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } @@ -239,11 +235,11 @@ check_fapl_mdc_api_calls(void) if ( file_ptr == NULL ) { pass = FALSE; - failure_mssg = "Can't get file_ptr.\n"; + failure_mssg = "Can't get file_ptr.\n"; - } else { + } else { - cache_ptr = file_ptr->shared->cache; + cache_ptr = file_ptr->shared->cache; } } @@ -262,10 +258,9 @@ check_fapl_mdc_api_calls(void) /* conpare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! resize_configs_are_equal(&default_auto_size_ctl, \ + if ( ! resize_configs_are_equal(&default_auto_size_ctl, \ &cache_ptr->resize_ctl, TRUE) ) { - pass = FALSE; failure_mssg = "Unexpected value(s) in cache resize_ctl 1.\n"; } @@ -295,7 +290,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if (!CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE)) { @@ -305,22 +300,22 @@ check_fapl_mdc_api_calls(void) } else if ( H5Pclose(fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -335,13 +330,13 @@ check_fapl_mdc_api_calls(void) /* Create a FAPL */ if ( pass ) { - fapl_id = H5Pcreate(H5P_FILE_ACCESS); + fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if ( fapl_id < 0 ) { + if ( fapl_id < 0 ) { - pass = FALSE; + pass = FALSE; failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; - } + } } /* Modify the initial mdc configuration in the FAPL. */ @@ -353,7 +348,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pset_mdc_config() failed.\n"; + failure_mssg = "H5Pset_mdc_config() failed.\n"; } } @@ -388,7 +383,7 @@ check_fapl_mdc_api_calls(void) if ( file_ptr == NULL ) { pass = FALSE; - failure_mssg = "Can't get file_ptr.\n"; + failure_mssg = "Can't get file_ptr.\n"; } else { @@ -411,10 +406,9 @@ check_fapl_mdc_api_calls(void) /* conpare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! resize_configs_are_equal(&mod_auto_size_ctl, \ + if ( ! resize_configs_are_equal(&mod_auto_size_ctl, \ &cache_ptr->resize_ctl, TRUE) ) { - pass = FALSE; failure_mssg = "Unexpected value(s) in cache resize_ctl 2.\n"; } @@ -444,7 +438,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if ( ! CACHE_CONFIGS_EQUAL(mod_config, scratch, TRUE, TRUE) ) { @@ -454,7 +448,7 @@ check_fapl_mdc_api_calls(void) } else if ( H5Pclose(test_fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } @@ -464,22 +458,22 @@ check_fapl_mdc_api_calls(void) if ( H5Pclose(fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -493,26 +487,24 @@ check_fapl_mdc_api_calls(void) /*------------------------------------------------------------------------- - * Function: check_file_mdc_api_calls() + * Function: check_file_mdc_api_calls() * - * Purpose: Verify that the file related metadata cache API calls are - * functioning correctly. + * Purpose: Verify that the file related metadata cache API calls are + * functioning correctly. * - * Since we have tested the H5C code elsewhere, it should - * be sufficient to verify that the desired configuration - * data is getting in and out of the cache. Similarly, - * we need only verify that the cache monitoring calls - * return the data that the cache thinks they should return. - * We shouldn't need to verify data correctness beyond that - * point. + * Since we have tested the H5C code elsewhere, it should + * be sufficient to verify that the desired configuration + * data is getting in and out of the cache. Similarly, + * we need only verify that the cache monitoring calls + * return the data that the cache thinks they should return. + * We shouldn't need to verify data correctness beyond that + * point. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/14/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -821,15 +813,15 @@ check_file_mdc_api_calls(void) /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -845,17 +837,16 @@ check_file_mdc_api_calls(void) /*------------------------------------------------------------------------- * Function: mdc_api_call_smoke_check() * - * Purpose: - * - * Return: void + * Purpose: Initial basic functional test to see if there are problems + * with the cache API calls. * - * Programmer: John Mainzer - * 4/14/04 + * NOTE: This test takes some time to run and checks the + * HDF5TestExpress environment variable. * - * Modifications: + * Return: void * - * JRM -- 7/12/06 - * Added progress reporting code. + * Programmer: John Mainzer + * 4/14/04 * *------------------------------------------------------------------------- */ @@ -880,7 +871,7 @@ mdc_api_call_smoke_check(int express_test) hid_t filespace_ids[NUM_DSETS]; hid_t memspace_id = -1; hid_t dataset_ids[NUM_DSETS]; - hid_t properties; + hid_t properties = -1; char dset_name[64]; int i, j, k, l, m, n; herr_t status; @@ -1105,7 +1096,7 @@ mdc_api_call_smoke_check(int express_test) sprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); + dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { @@ -1329,9 +1320,9 @@ mdc_api_call_smoke_check(int express_test) } n++; - } + /* close the file spaces we are done with */ i = 1; while ( ( pass ) && ( i < NUM_DSETS ) ) @@ -1450,7 +1441,6 @@ mdc_api_call_smoke_check(int express_test) } n++; - } /* close file space 0 */ @@ -1496,16 +1486,16 @@ mdc_api_call_smoke_check(int express_test) /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -3000,18 +2990,16 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /*------------------------------------------------------------------------- - * Function: check_fapl_mdc_api_errs() + * Function: check_fapl_mdc_api_errs() * - * Purpose: Verify that the FAPL related MDC API calls reject input - * errors gracefully. + * Purpose: Verify that the FAPL related MDC API calls reject input + * errors gracefully. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/19/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3030,7 +3018,6 @@ check_fapl_mdc_api_errs(void) pass = TRUE; - /* first test H5Pget_mdc_config(). */ @@ -3038,8 +3025,8 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pget_mdc_config((hid_t)-1, &scratch); - } H5E_END_TRY; + result = H5Pget_mdc_config((hid_t)-1, &scratch); + } H5E_END_TRY; if ( result >= 0 ) { @@ -3065,7 +3052,7 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( ( pass ) && - ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) || + ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0) || ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) { pass = FALSE; @@ -3171,18 +3158,16 @@ check_fapl_mdc_api_errs(void) /*------------------------------------------------------------------------- - * Function: check_file_mdc_api_errs() + * Function: check_file_mdc_api_errs() * - * Purpose: Verify that the file related MDC API calls reject input - * errors gracefully. + * Purpose: Verify that the file related MDC API calls reject input + * errors gracefully. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/19/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3215,7 +3200,7 @@ check_file_mdc_api_errs(void) /* setup the file name */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name); } @@ -3230,7 +3215,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: calling H5Fcreate().\n", fcn_name); } @@ -3252,7 +3237,7 @@ check_file_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", fcn_name); } @@ -3270,7 +3255,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", fcn_name); } @@ -3289,7 +3274,7 @@ check_file_mdc_api_errs(void) scratch.version = -1; /* a convenient, invalid value */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", fcn_name); } @@ -3311,7 +3296,7 @@ check_file_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", fcn_name); } @@ -3329,7 +3314,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", fcn_name); } @@ -3348,7 +3333,7 @@ check_file_mdc_api_errs(void) i = 0; while ( ( pass ) && ( i < NUM_INVALID_CONFIGS ) ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", @@ -3378,7 +3363,7 @@ check_file_mdc_api_errs(void) /* test H5Fget_mdc_hit_rate() */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", fcn_name); @@ -3397,7 +3382,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", fcn_name); @@ -3418,7 +3403,7 @@ check_file_mdc_api_errs(void) /* test H5Freset_mdc_hit_rate_stats() */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", fcn_name); @@ -3440,7 +3425,7 @@ check_file_mdc_api_errs(void) /* test H5Fget_mdc_size() */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", fcn_name); } @@ -3459,7 +3444,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", fcn_name); } @@ -3481,7 +3466,7 @@ check_file_mdc_api_errs(void) /* close the file and delete it */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: cleaning up from tests.\n", fcn_name); } @@ -3508,22 +3493,17 @@ check_file_mdc_api_errs(void) /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Run tests on the cache code contained in H5C.c + * Purpose: Run tests on the cache code contained in H5C.c * * Return: Success: * - * Failure: - * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * *------------------------------------------------------------------------- */ - int main(void) { @@ -3552,3 +3532,4 @@ main(void) return(0); } /* main() */ + diff --git a/test/cache_common.c b/test/cache_common.c index 5fe68db..a5dd485 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer @@ -20,9 +18,6 @@ * implemented in H5C.c */ #include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */ -#include "h5test.h" -#include "H5Cprivate.h" -#include "H5Iprivate.h" #include "H5MFprivate.h" #include "cache_common.h" @@ -338,8 +333,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, - -/* address translation funtions: */ +/* address translation functions: */ /*------------------------------------------------------------------------- @@ -357,8 +351,8 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, */ void addr_to_type_and_index(haddr_t addr, - int32_t * type_ptr, - int32_t * index_ptr) + int32_t *type_ptr, + int32_t *index_ptr) { int i; int32_t type; @@ -1577,7 +1571,7 @@ entry_in_cache(H5C_t * cache_ptr, /*------------------------------------------------------------------------- * Function: reset_entries * - * Purpose: reset the contents of the entries arrays to know values. + * Purpose: reset the contents of the entries arrays to known values. * * Return: void * diff --git a/test/cache_common.h b/test/cache_common.h index a638ad7..7cd415f 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index a782fb0..4087f28 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/cross_read.c b/test/cross_read.c index 35dd2ce..503cd28 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dangle.c b/test/dangle.c index 2f8a67e..ed5e3b8 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dsets.c b/test/dsets.c index e523680..c936e3c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -9083,6 +9081,109 @@ error: return -1; } /* end test_gather_error() */ +/*------------------------------------------------------------------------- + * Function: test_compact_dirty + * + * Purpose: Verify that issue #2 reported in HDFFV-10051 is fixed: + * --the layout "dirty" flag for a compact dataset is not reset + * properly after flushing the data at dataset close. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Vailin Choi; April 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_compact_dirty(hid_t fapl) +{ + hid_t fid = -1; /* File ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + hsize_t dims[1] = {10}; /* Dimension */ + int wbuf[10]; /* Data buffer */ + char filename[FILENAME_BUF_SIZE]; /* Filename */ + int i; /* Local index variable */ + hbool_t dirty; /* The dirty flag */ + + TESTING("compact dataset repeated open/close and dirty flag"); + + /* Create a file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Initialize data */ + for(i = 0; i < 10; i++) + wbuf[i] = i; + + /* Create dataspace */ + if((sid = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Set compact layout */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) + TEST_ERROR + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + TEST_ERROR + + /* Create a compact dataset */ + if((did = H5Dcreate2(fid, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Write to the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Open the dataset */ + if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Retrieve the "dirty" flag from the compact dataset layout */ + if(H5D__layout_compact_dirty_test(did, &dirty) < 0) + TEST_ERROR + + /* Verify that the "dirty" flag is false */ + if(dirty) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + TEST_ERROR + + /* Close the dataset creation property list */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(fid) < 0) + TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + H5Pclose(dcpl); + H5Dclose(did); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* test_compact_dirty() */ + /*------------------------------------------------------------------------- * Function: main @@ -9168,6 +9269,7 @@ main(void) nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_dirty(my_fapl) < 0 ? 1 : 0); nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); nerrors += (test_tconv(file) < 0 ? 1 : 0); nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); diff --git a/test/dt_arith.c b/test/dt_arith.c index 4337690..41fb49d 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -20,8 +18,6 @@ * Purpose: Tests the data type interface (H5T) */ -#include <math.h> -#include <time.h> #include "h5test.h" /* Number of elements in each random test */ @@ -645,11 +641,18 @@ test_hard_query(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 1; } /* end test_hard_query() */ @@ -871,7 +874,11 @@ error: if(saved_buf2) HDfree(saved_buf2); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -1290,6 +1297,10 @@ test_derived_flt(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ return 0; @@ -1305,7 +1316,12 @@ test_derived_flt(void) H5Pclose (dxpl_id); H5Fclose (file); } H5E_END_TRY; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -1592,6 +1608,10 @@ test_derived_integer(void) HDfree(saved_buf); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ return 0; @@ -1606,7 +1626,12 @@ test_derived_integer(void) H5Pclose (dxpl_id); H5Fclose (file); } H5E_END_TRY; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -2601,7 +2626,12 @@ done: if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return (int)fails_all_tests; error: @@ -2609,7 +2639,12 @@ error: if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_all_tests, 1); } @@ -3307,6 +3342,9 @@ done: HDassert(0 && "Should not reach this point!"); return 1; #else + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /* If the source is normalized values, treat the failures as error; @@ -3330,7 +3368,11 @@ error: HDassert(0 && "Should not reach this point!"); return 1; #else + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + if(run_test==TEST_NOOP || run_test==TEST_NORMAL) return MAX((int)fails_all_tests, 1); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) @@ -4506,6 +4548,9 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ /* If the source is normalized floating values, treat the failures as error; @@ -4520,6 +4565,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ if(run_test==TEST_NORMAL) @@ -5168,6 +5217,10 @@ main(void) *---------------------------------------------------------------------- */ without_hardware_g = TRUE; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /* Test software floating-point conversion functions */ @@ -5183,8 +5236,14 @@ main(void) /* Test software integer-float conversion functions */ nerrors += run_int_fp_conv("soft"); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + if (nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); diff --git a/test/dtransform.c b/test/dtransform.c index 4adbaf5..b2dcd6f 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/dtypes.c b/test/dtypes.c index 7c2ad7b..3514de4 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -20,8 +18,6 @@ * Purpose: Tests the datatype interface (H5T) */ -#include <math.h> -#include <time.h> #include "h5test.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ @@ -769,11 +765,20 @@ test_compound_2(void) CHECK_NMEMBS(nmembs , st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -888,11 +893,19 @@ test_compound_3(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1015,11 +1028,19 @@ test_compound_4(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1226,11 +1247,19 @@ test_compound_6(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1365,11 +1394,19 @@ test_compound_7(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4229,6 +4266,10 @@ test_conv_str_1(void) HDfree(buf); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; @@ -4241,7 +4282,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4304,7 +4349,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; } @@ -4418,7 +4467,11 @@ error: if(tag) H5free_memory(tag); /* Technically allocated by API call */ + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; /* Number of errors */ } @@ -4490,7 +4543,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; } @@ -4657,13 +4714,22 @@ test_conv_bitfield(void) H5Tclose(st); H5Tclose(dt); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: H5Tclose(st); H5Tclose(dt); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4781,14 +4847,18 @@ test_bitfield_funcs(void) retval = 0; - error: - +error: if (retval == -1) retval = 1; H5free_memory(tag); H5Tclose(ntype); H5Tclose(type); if (retval == 0) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return retval; } @@ -7423,8 +7493,10 @@ main(void) #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += test_deprec(fapl); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + h5_cleanup(FILENAME, fapl); /*must happen before first reset*/ reset_hdf5(); + nerrors += test_conv_str_1(); nerrors += test_conv_str_2(); nerrors += test_conv_str_3(); @@ -7452,6 +7524,7 @@ main(void) nerrors += test_opaque(); nerrors += test_set_order(); nerrors += test_utf_ascii_conv(); + if(nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); diff --git a/test/dynlib1.c b/test/dynlib1.c index 1ccc33a..e9137fb 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/dynlib2.c b/test/dynlib2.c index 0d8be2b..2574d4d 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/dynlib3.c b/test/dynlib3.c index b3a02ed..a1d88c7 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/dynlib4.c b/test/dynlib4.c index 8da0270..06d90ff 100644 --- a/test/dynlib4.c +++ b/test/dynlib4.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: Tests the plugin module (H5PL) @@ -1,15 +1,13 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by the Board of Trustees of the University of Illinois. * + * Copyright by The HDF Group. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Neil Fortner @@ -3200,7 +3198,7 @@ main(void) puts("All external file cache tests passed."); - h5_cleanup(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); return 0; diff --git a/test/enum.c b/test/enum.c index 29b702d..4e20713 100644 --- a/test/enum.c +++ b/test/enum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/err_compat.c b/test/err_compat.c index 576433e..eee150b 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -500,7 +498,7 @@ main(void) } if(H5Fclose(file) < 0) TEST_ERROR ; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); printf("All error API tests passed.\n"); return 0; @@ -510,3 +508,4 @@ main(void) return 1; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ + diff --git a/test/error_test.c b/test/error_test.c index 64f301d..a952449 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -756,7 +754,7 @@ main(void) if(test_filter_error(filename) < 0) TEST_ERROR; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfprintf(stderr, "\nAll error API tests passed.\n"); return 0; diff --git a/test/extend.c b/test/extend.c index 5951e69..a52e598 100644 --- a/test/extend.c +++ b/test/extend.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/external.c b/test/external.c index 8b71437..ad8e7b6 100644 --- a/test/external.c +++ b/test/external.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/fheap.c b/test/fheap.c index 4365324..fa0b0d7 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> diff --git a/test/file_image.c b/test/file_image.c index b1b9d47..a6ec984 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** @@ -643,7 +641,7 @@ test_core(void) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfree(udata); HDfree(file_image); HDremove(copied_filename); @@ -890,8 +888,7 @@ test_get_file_image(const char * test_banner, VERIFY(err == SUCCEED, "H5Pclose(core_fapl_id) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl); - VERIFY(result != 0, "h5_cleanup() failed."); + h5_clean_files(FILENAME2, fapl); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1039,8 +1036,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(file_id) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(1) failed."); + h5_clean_files(FILENAME2, fapl_id); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1145,8 +1141,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + h5_clean_files(FILENAME2, fapl_id); /************************** Test #3 **********************************/ /* set up a split file driver test file, and try to get its image @@ -1208,8 +1203,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + h5_clean_files(FILENAME2, fapl_id); /************************** Test #4 **********************************/ /* set up a family file driver test file, and try to get its image @@ -1269,8 +1263,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + h5_clean_files(FILENAME2, fapl_id); PASSED(); @@ -1340,6 +1333,8 @@ main(void) errors += test_get_file_image_error_rejection(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); if(errors) { printf("***** %d File Image TEST%s FAILED! *****\n", diff --git a/test/fillval.c b/test/fillval.c index 1c90963..525dc0e 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/filter_fail.c b/test/filter_fail.c index 0b92abb..ef8ba1c 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/flush1.c b/test/flush1.c index f15a05a..f31384e 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/flush2.c b/test/flush2.c index c6e4c3a..2f07120 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/freespace.c b/test/freespace.c index 1338ae7..3d33669 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Tests for free-space manager @@ -2841,6 +2839,8 @@ main(void) if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + h5_reset(); + fapl = h5_fileaccess(); /* make sure alignment is not set for tests to succeed */ diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index b864195..c52eb95 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index 6d50230..36ba64a 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_bogus.c b/test/gen_bogus.c index df1e81f..9d6b518 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -36,18 +34,21 @@ #define FALSE 0 #endif /* FALSE */ -int main(void) -{ #ifdef H5O_ENABLE_BOGUS - hid_t fid = -1; /* File ID */ + +/* + * Create datasets in the location (in "/" or "/group") with + * message id: (a) H5O_BOGUS_VALID_ID or (b)H5O_BOGUS_INVALID_ID + * and various unknown message flags + */ +static int +generate_datasets(hid_t loc_id, unsigned bogus_id) +{ hid_t sid = -1; /* Dataspace ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t did = -1; /* Dataset ID */ uint8_t bogus_flags = 0; /* Flags for bogus message */ - /* Create file for test datasets */ - if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - /* Create dataspace for datasets */ if((sid = H5Screate(H5S_SCALAR)) < 0) goto error; @@ -57,24 +58,30 @@ int main(void) /* Add property for bogus message flags */ if(H5Pinsert2(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, H5O_BOGUS_MSG_FLAGS_SIZE, &bogus_flags, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error; + /* Add property for bogus message ID */ + if(H5Pinsert2(dcpl, H5O_BOGUS_MSG_ID_NAME, H5O_BOGUS_MSG_ID_SIZE, &bogus_id, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error; + /* Create dataset with "bogus" message, but no message flags */ - if((did = H5Dcreate2(fid, "/Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + if((did = H5Dcreate2(loc_id, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; - /* Set "fail if unknown" message flag for bogus message */ + /* Set "fail if unknown and open for write" message flag for bogus message */ bogus_flags = H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE; if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; /* Create second dataset, with "fail if unknown" message flag */ - if((did = H5Dcreate2(fid, "/Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + if((did = H5Dcreate2(loc_id, "Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; + /* Set "fail if unknown always" message flag for bogus message */ + /* There is no H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS, skip creating "Dataset3" */ + /* Set "mark if unknown" message flag for bogus message */ bogus_flags = H5O_MSG_FLAG_MARK_IF_UNKNOWN; if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; - /* Create second dataset, with "mark if unknown" message flag */ - if((did = H5Dcreate2(fid, "/Dataset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + /* Create fourth dataset, with "mark if unknown" message flag */ + if((did = H5Dcreate2(loc_id, "Dataset4", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; /* Close dataset creation property list */ @@ -83,9 +90,6 @@ int main(void) /* Close dataspace */ if(H5Sclose(sid) < 0) goto error; - /* Close file */ - if(H5Fclose(fid) < 0) goto error; - return 0; error: @@ -93,6 +97,43 @@ error: H5Dclose(did); H5Sclose(sid); H5Pclose(dcpl); + } H5E_END_TRY; + + return -1; +} /* generate_datasets() */ +#endif + +int main(void) +{ +#ifdef H5O_ENABLE_BOGUS + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + + /* Create file for test datasets */ + if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + + /* Create datasets in "/" group with bogus message H5O_BOGUS_VALID_ID */ + if(generate_datasets(fid, H5O_BOGUS_VALID_ID) < 0) + goto error; + + if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create datasets in "/group" with bogus message H5O_BOGUS_INVALID_ID */ + if(generate_datasets(gid, H5O_BOGUS_INVALID_ID) < 0) + goto error; + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + /* Close file */ + if(H5Fclose(fid) < 0) goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; #else /* H5O_ENABLE_BOGUS */ @@ -100,4 +141,3 @@ error: #endif /* H5O_ENABLE_BOGUS */ return 1; } - diff --git a/test/gen_cross.c b/test/gen_cross.c index 2d4b788..35f5ef2 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_deflate.c b/test/gen_deflate.c index 2d0b746..5a81b9f 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_file_image.c b/test/gen_file_image.c index bc9de29..97342a4 100644 --- a/test/gen_file_image.c +++ b/test/gen_file_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_filters.c b/test/gen_filters.c index f506602..fa66078 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/gen_idx.c b/test/gen_idx.c index 0513e1b..73e2639 100644 --- a/test/gen_idx.c +++ b/test/gen_idx.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index 5df5674..f158d57 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_array.c b/test/gen_new_array.c index c78644d..27f162c 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 4ba85ad..5bdbf73 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_group.c b/test/gen_new_group.c index b998913..6924291 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index d7a0f32..b44d567 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_super.c b/test/gen_new_super.c index f6d15f4..f6ce589 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_noencoder.c b/test/gen_noencoder.c index 46a2036..e6ac9cf 100644 --- a/test/gen_noencoder.c +++ b/test/gen_noencoder.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 8349a5c..9d76deb 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_array.c b/test/gen_old_array.c index a4162f2..3fab657 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_group.c b/test/gen_old_group.c index 1b33cea..d109329 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 312ee58..56c3e4e 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index ca6012a..cbe3bdc 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c index de7e261..81742df 100644 --- a/test/gen_sizes_lheap.c +++ b/test/gen_sizes_lheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index 6e4fa17..c020e2b 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/getname.c b/test/getname.c index c151bda..18a8c4d 100644 --- a/test/getname.c +++ b/test/getname.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gheap.c b/test/gheap.c index f30935a..c120b87 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/h5test.c b/test/h5test.c index 4d841f1..faeca34 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -22,8 +20,7 @@ */ #undef NDEBUG /*override -DNDEBUG */ -#include <sys/types.h> -#include <sys/stat.h> + #include "h5test.h" #include "H5srcdir.h" @@ -75,7 +72,7 @@ char *paraprefix = NULL; /* for command line option para-prefix */ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ #endif -#define READ_BUF_SIZE 4096 +#define READ_BUF_SIZE 65536 /* * These are the letters that are appended to the file name when generating @@ -91,6 +88,12 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ */ static const char *multi_letters = "msbrglo"; +/* Length of multi-file VFD filename buffers */ +#define H5TEST_MULTI_FILENAME_LEN 1024 + +/* Previous error reporting function */ +static H5E_auto2_t err_func = NULL; + static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size); @@ -120,77 +123,228 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) return 0; } - + /*------------------------------------------------------------------------- - * Function: h5_cleanup + * Function: h5_clean_files * - * Purpose: Cleanup temporary test files. + * Purpose: Cleanup temporary test files (always). * base_name contains the list of test file names. - * The file access property list is also closed. * - * Return: Non-zero if cleanup actions were performed; zero otherwise. + * Return: void * - * Programmer: Albert Cheng - * May 28, 1998 + * Programmer: Neil Fortner + * June 1, 2015 * *------------------------------------------------------------------------- */ -int -h5_cleanup(const char *base_name[], hid_t fapl) +void +h5_clean_files(const char *base_name[], hid_t fapl) { - int retval = 0; + int i; - if(GetTestCleanup()) { - int i; + for(i = 0; base_name[i]; i++) { + char filename[1024]; + char temp[2048]; + hid_t driver; + + if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) + continue; - for(i = 0; base_name[i]; i++) { - char filename[1024]; - char temp[2048]; - hid_t driver; + driver = H5Pget_driver(fapl); - if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) - continue; + if(driver == H5FD_FAMILY) { + int j; - driver = H5Pget_driver(fapl); + for(j = 0; /*void*/; j++) { + HDsnprintf(temp, sizeof temp, filename, j); - if(driver == H5FD_FAMILY) { - int j; + if(HDaccess(temp, F_OK) < 0) + break; - for(j = 0; /*void*/; j++) { - HDsnprintf(temp, sizeof temp, filename, j); + HDremove(temp); + } /* end for */ + } else if(driver == H5FD_CORE) { + hbool_t backing; /* Whether the core file has backing store */ - if(HDaccess(temp, F_OK) < 0) - break; + H5Pget_fapl_core(fapl, NULL, &backing); - HDremove(temp); - } /* end for */ - } else if(driver == H5FD_CORE) { - hbool_t backing; /* Whether the core file has backing store */ + /* If the file was stored to disk with bacing store, remove it */ + if(backing) + HDremove(filename); + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; - H5Pget_fapl_core(fapl, NULL, &backing); + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - /* If the file was stored to disk with bacing store, remove it */ - if(backing) - HDremove(filename); - } else if (driver == H5FD_MULTI) { - H5FD_mem_t mt; + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); + HDremove(temp); /*don't care if it fails*/ + } /* end for */ + } else { + HDremove(filename); + } + } /* end for */ - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + /* Close the FAPL used to access the file */ + H5Pclose(fapl); - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { - HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); - HDremove(temp); /*don't care if it fails*/ - } /* end for */ - } else { - HDremove(filename); - } + return; +} /* end h5_clean_files() */ + + +/*------------------------------------------------------------------------- + * Function: h5_delete_test_file + * + * Purpose Clean up temporary test files. + * + * When a test calls h5_fixname() to get a VFD-dependent + * test file name, this function can be used to clean it up. + * + * Return: void + * + * Since this is a cleanup file, we don't care if it fails. + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +void +h5_delete_test_file(const char *base_name, hid_t fapl) +{ + char filename[1024]; /* VFD-dependent filename to delete */ + char sub_filename[2048]; /* sub-files in multi & family VFDs */ + hid_t driver = -1; /* VFD ID */ + + /* Get the VFD-dependent filename */ + if(NULL == h5_fixname(base_name, fapl, filename, sizeof(filename))) + return; + + driver = H5Pget_driver(fapl); + + if(driver == H5FD_FAMILY) { + int j; + for(j = 0; /*void*/; j++) { + HDsnprintf(sub_filename, sizeof(sub_filename), filename, j); + + /* If we can't access the file, it probably doesn't exist + * and we are done deleting the sub-files. + */ + if(HDaccess(sub_filename, F_OK) < 0) + break; + + HDremove(sub_filename); + } /* end for */ + } else if(driver == H5FD_CORE) { + hbool_t backing; /* Whether the core file has backing store */ + + H5Pget_fapl_core(fapl, NULL, &backing); + + /* If the file was stored to disk with bacing store, remove it */ + if(backing) + HDremove(filename); + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; + + HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]); + HDremove(sub_filename); } /* end for */ + } else { + HDremove(filename); + } /* end if */ + + return; +} /* end h5_delete_test_file() */ + + +/*------------------------------------------------------------------------- + * Function: h5_delete_all_test_files + * + * Purpose Clean up temporary test files. + * + * When a test calls h5_fixname() get a VFD-dependent + * test file name, this function can be used to clean it up. + * + * This function takes an array of filenames that ends with + * a NULL string and cleans them all. + * + * Return: void + * + * Since this is a cleanup file, we don't care if it fails. + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +void +h5_delete_all_test_files(const char *base_name[], hid_t fapl) +{ + int i; /* iterator */ + + for(i = 0; base_name[i]; i++) { + h5_delete_test_file(base_name[i], fapl); + } /* end for */ + + return; +} /* end h5_delete_all_test_files() */ + + +/*------------------------------------------------------------------------- + * Function: h5_cleanup + * + * Purpose: Cleanup temporary test files. + * base_name contains the list of test file names. + * The file access property list is also closed. + * + * Return: Non-zero if cleanup actions were performed; zero otherwise. + * + * Programmer: Albert Cheng + * May 28, 1998 + * + *------------------------------------------------------------------------- + */ +int +h5_cleanup(const char *base_name[], hid_t fapl) +{ + int retval = 0; + + if(GetTestCleanup()) { + /* Clean up files in base_name, and the FAPL */ + h5_clean_files(base_name, fapl); retval = 1; } /* end if */ - H5Pclose(fapl); + /* Restore the original error reporting routine */ + h5_restore_err(); + return retval; +} /* end h5_cleanup() */ + + +/*------------------------------------------------------------------------- + * Function: h5_restore_err + * + * Purpose: Restore the default error handler. + * + * Return: N/A + * + * Programmer: Quincey Koziol + * Sept 10, 2015 + * + *------------------------------------------------------------------------- + */ +void +h5_restore_err(void) +{ + /* Restore the original error reporting routine */ + HDassert(err_func != NULL); + H5Eset_auto2(H5E_DEFAULT, err_func, NULL); + err_func = NULL; } @@ -212,6 +366,10 @@ h5_reset(void) HDfflush(stdout); HDfflush(stderr); H5close(); + + /* Save current error stack reporting routine and redirect to our local one */ + HDassert(err_func == NULL); + H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); /* @@ -233,12 +391,12 @@ h5_reset(void) */ sprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid()); H5E_BEGIN_TRY { - hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); - hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(grp); - H5Fclose(file); - HDunlink(filename); + hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, + H5P_DEFAULT); + hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(grp); + H5Fclose(file); + HDunlink(filename); } H5E_END_TRY; } #endif /* OLD_WAY */ @@ -528,30 +686,27 @@ h5_rmprefix(const char *filename) const char *ret_ptr; if ((ret_ptr = HDstrstr(filename, ":")) == NULL) - ret_ptr = filename; + ret_ptr = filename; else - ret_ptr++; + ret_ptr++; return(ret_ptr); } /*------------------------------------------------------------------------- - * Function: h5_fileaccess - * - * Purpose: Returns a file access template which is the default template - * but with a file driver set according to the constant or - * environment variable HDF5_DRIVER + * Function: h5_fileaccess * - * Return: Success: A file access property list + * Purpose: Returns a file access template which is the default template + * but with a file driver set according to the constant or + * environment variable HDF5_DRIVER * - * Failure: -1 + * Return: Success: A file access property list + * Failure: -1 * * Programmer: Robb Matzke * Thursday, November 19, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -559,50 +714,61 @@ h5_fileaccess(void) { const char *val = NULL; const char *name; - char s[1024]; - hid_t fapl = -1; + char s[1024]; + hid_t fapl = -1; /* First use the environment variable, then the constant */ val = HDgetenv("HDF5_DRIVER"); #ifdef HDF5_DRIVER - if (!val) + if(!val) val = HDF5_DRIVER; #endif - if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) return -1; - if (!val || !*val) - return fapl; /*use default*/ + if(!val || !*val) + return fapl; /* use default */ HDstrncpy(s, val, sizeof s); s[sizeof(s)-1] = '\0'; - if (NULL==(name=HDstrtok(s, " \t\n\r"))) return fapl; + if(NULL == (name = HDstrtok(s, " \t\n\r"))) + return fapl; - if (!HDstrcmp(name, "sec2")) { + if(!HDstrcmp(name, "sec2")) { /* Unix read() and write() system calls */ - if (H5Pset_fapl_sec2(fapl)<0) return -1; - } else if (!HDstrcmp(name, "stdio")) { + if (H5Pset_fapl_sec2(fapl) < 0) + return -1; + } + else if(!HDstrcmp(name, "stdio")) { /* Standard C fread() and fwrite() system calls */ - if (H5Pset_fapl_stdio(fapl)<0) return -1; - } else if (!HDstrcmp(name, "core")) { + if (H5Pset_fapl_stdio(fapl) < 0) + return -1; + } + else if(!HDstrcmp(name, "core")) { /* In-memory driver settings (backing store on, 1 MB increment) */ - if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; - } else if (!HDstrcmp(name, "core_paged")) { + if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0) + return -1; + } + else if(!HDstrcmp(name, "core_paged")) { /* In-memory driver with write tracking and paging on */ - if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; - if (H5Pset_core_write_tracking(fapl, TRUE, (size_t)524288)<0) return -1; - } else if (!HDstrcmp(name, "split")) { + if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0) + return -1; + if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0) + return -1; + } + else if(!HDstrcmp(name, "split")) { /* Split meta data and raw data each using default driver */ - if (H5Pset_fapl_split(fapl, + if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, - "-r.h5", H5P_DEFAULT)<0) + "-r.h5", H5P_DEFAULT) < 0) return -1; - } else if (!HDstrcmp(name, "multi")) { + } + else if(!HDstrcmp(name, "multi")) { /* Multi-file driver, general case of the split driver */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; const char *memb_name[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][1024]; + char *sv[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; H5FD_mem_t mt; @@ -613,45 +779,52 @@ h5_fileaccess(void) HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { - memb_fapl[mt] = H5P_DEFAULT; - sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); + memb_fapl[mt] = H5P_DEFAULT; + if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN))) + return -1; + HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } /* end for */ - if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, - memb_addr, FALSE)<0) { + if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) return -1; - } - } else if (!HDstrcmp(name, "family")) { + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) + HDfree(sv[mt]); + } + else if(!HDstrcmp(name, "family")) { hsize_t fam_size = 100*1024*1024; /*100 MB*/ /* Family of files, each 1MB and using the default driver */ - if ((val=HDstrtok(NULL, " \t\n\r"))) + if((val = HDstrtok(NULL, " \t\n\r"))) fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); - if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) + if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1; - } else if (!HDstrcmp(name, "log")) { + } + else if(!HDstrcmp(name, "log")) { unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; /* Log file access */ - if ((val = HDstrtok(NULL, " \t\n\r"))) + if((val = HDstrtok(NULL, " \t\n\r"))) log_flags = (unsigned)HDstrtol(val, NULL, 0); - - if (H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) + if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) return -1; - } else if (!HDstrcmp(name, "direct")) { + } + else if(!HDstrcmp(name, "direct")) { #ifdef H5_HAVE_DIRECT /* Linux direct read() and write() system calls. Set memory boundary, file block size, * and copy buffer size to the default values. */ - if (H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0) + if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0) return -1; #endif - } else if(!HDstrcmp(name, "latest")) { + } + else if(!HDstrcmp(name, "latest")) { /* use the latest format */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; - } else { + } + else { /* Unknown driver */ return -1; } @@ -1180,8 +1353,6 @@ getenv_all(MPI_Comm comm, int root, const char* name) * Programmer: Larry Knox * Monday, October 13, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1189,24 +1360,44 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - char buf[READ_BUF_SIZE]; /* Buffer for copying data */ - const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ + void *buf = NULL; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename); /* Get the test file name to copy */ + + /* Allocate copy buffer */ + if(NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE))) + goto error; /* Copy old file into temporary file */ - if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1; - if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) - < 0) return -1; + if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) + goto error; + if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) + goto error; /* Copy data */ while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0) - HDwrite(fd_new, buf, (size_t)nread); - + if(HDwrite(fd_new, buf, (size_t)nread) < 0) + goto error; + /* Close files */ - if(HDclose(fd_old) < 0) return -1; - if(HDclose(fd_new) < 0) return -1; + if(HDclose(fd_old) < 0) + goto error; + if(HDclose(fd_new) < 0) + goto error; + + /* Release memory */ + HDfree(buf); return 0; -} + +error: + /* ignore return values since we're already noted the problem */ + if(fd_old > 0) + HDclose(fd_old); + if(fd_new > 0) + HDclose(fd_new); + HDfree(buf); + return -1; +} /* end h5_make_local_copy() */ /*------------------------------------------------------------------------- diff --git a/test/h5test.h b/test/h5test.h index 19524a9..69e6f31 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -61,18 +59,18 @@ /* Should be used internally by the libtest.a only. */ #define HDGetTestVerbosity() (TestVerbosity) -#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE) -#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF) -#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO) -#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED) -#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI) +#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE) +#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF) +#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO) +#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED) +#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI) /* * Test controls definitions. */ -#define SKIPTEST 1 /* Skip this test */ -#define ONLYTEST 2 /* Do only this test */ -#define BEGINTEST 3 /* Skip all tests before this test */ +#define SKIPTEST 1 /* Skip this test */ +#define ONLYTEST 2 /* Do only this test */ +#define BEGINTEST 3 /* Skip all tests before this test */ /* * This contains the filename prefix specificied as command line option for @@ -86,8 +84,8 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Print the current location on the standard output stream. */ -#define AT() printf (" at %s:%d in %s()...\n", \ - __FILE__, __LINE__, FUNC); +#define AT() printf (" at %s:%d in %s()...\n", \ + __FILE__, __LINE__, FUNC); /* * The name of the test is printed by saying TESTING("something") which will @@ -98,12 +96,13 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * spaces. If the h5_errors() is used for automatic error handling then * the H5_FAILED() macro is invoked automatically when an API function fails. */ -#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} -#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} -#define PASSED() {puts(" PASSED");fflush(stdout);} -#define H5_FAILED() {puts("*FAILED*");fflush(stdout);} -#define H5_WARNING() {puts("*WARNING*");fflush(stdout);} -#define SKIPPED() {puts(" -SKIP-");fflush(stdout);} +#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} +#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} +#define PASSED() {puts(" PASSED");fflush(stdout);} +#define H5_FAILED() {puts("*FAILED*");fflush(stdout);} +#define H5_WARNING() {puts("*WARNING*");fflush(stdout);} +#define SKIPPED() {puts(" -SKIP-");fflush(stdout);} +#define PUTS_ERROR(s) {puts(s); AT(); goto error;} #define TEST_ERROR {H5_FAILED(); AT(); goto error;} #define STACK_ERROR {H5Eprint2(H5E_DEFAULT, stdout); goto error;} #define FAIL_STACK_ERROR {H5_FAILED(); AT(); H5Eprint2(H5E_DEFAULT, stdout); \ @@ -113,9 +112,9 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Alarm definitions to wait up (terminate) a test that runs too long. */ -#define H5_ALARM_SEC 1200 /* default is 20 minutes */ -#define ALARM_ON TestAlarmOn() -#define ALARM_OFF HDalarm(0) +#define H5_ALARM_SEC 1200 /* default is 20 minutes */ +#define ALARM_ON TestAlarmOn() +#define ALARM_OFF HDalarm(0) /* * The methods to compare the equality of floating-point values: @@ -140,29 +139,42 @@ extern "C" { #endif /* Generally useful testing routines */ +H5TEST_DLL void h5_clean_files(const char *base_name[], hid_t fapl); H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl); H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); +H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL hid_t h5_fileaccess(void); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); H5TEST_DLL void h5_reset(void); +H5TEST_DLL void h5_restore_err(void); H5TEST_DLL void h5_show_hostname(void); H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl); H5TEST_DLL int print_func(const char *format, ...); H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name); H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); +/* Functions that will replace VFD-dependent functions that violate + * the single responsibility principle. Unlike their predecessors, + * these new functions do not have hidden side effects. + */ +/* h5_fileaccess() replacement */ +/* h5_clean_files() replacements */ +H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl); +H5TEST_DLL void h5_delete_all_test_files(const char *base_name[], hid_t fapl); + /* Routines for operating on the list of tests (for the "all in one" tests) */ H5TEST_DLL void TestUsage(void); H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void), - void (*Cleanup) (void), const char *TheDescr, - const void *Parameters); + void (*Cleanup) (void), const char *TheDescr, + const void *Parameters); H5TEST_DLL void TestInfo(const char *ProgName); H5TEST_DLL void TestParseCmdLine(int argc, char *argv[]); H5TEST_DLL void PerformTests(void); H5TEST_DLL void TestSummary(void); H5TEST_DLL void TestCleanup(void); +H5TEST_DLL void TestShutdown(void); H5TEST_DLL void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[])); H5TEST_DLL int GetTestVerbosity(void); H5TEST_DLL int SetTestVerbosity(int newval); diff --git a/test/hyperslab.c b/test/hyperslab.c index 9bc085c..9d2cb2d 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke <matzke@llnl.gov> diff --git a/test/istore.c b/test/istore.c index d088fe8..f488a41 100644 --- a/test/istore.c +++ b/test/istore.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke <matzke@llnl.gov> diff --git a/test/lheap.c b/test/lheap.c index 81ccc77..a0c1f89 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/links.c b/test/links.c index 7ef9af5..f56bee9 100644 --- a/test/links.c +++ b/test/links.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/links_env.c b/test/links_env.c index 6e47667..ef6c5e5 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -6246,6 +6244,8 @@ main(void) if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + h5_reset(); + fapl = h5_fileaccess(); /* Make a copy of the FAPL before adjusting the alignment */ diff --git a/test/mount.c b/test/mount.c index 2502bbe..d2c0d21 100644 --- a/test/mount.c +++ b/test/mount.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/mtime.c b/test/mtime.c index f6296fc..4cf1be3 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ntypes.c b/test/ntypes.c index a4ae4cf..05729d7 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/objcopy.c b/test/objcopy.c index 3095d32..33f43d3 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ohdr.c b/test/ohdr.c index 1b324a9..5b000f2 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke <matzke@llnl.gov> @@ -288,6 +286,280 @@ error: return -1; } /* test_ohdr_cache() */ +/* + * To test objects with unknown messages in a file with: + * a) H5O_BOGUS_VALID_ID: + * --the bogus_id is within the range of H5O_msg_class_g[] + * b) H5O_BOGUS_INVALID_ID: + * --the bogus_id is outside the range of H5O_msg_class_g[] + * + * The test file is FILE_BOGUS: "tbogus.h5" generated with gen_bogus.c + * --objects that have unknown header messages with H5O_BOGUS_VALID_ID in "/" + * --objects that have unknown header messages with H5O_BOGUS_INVALID_ID in "/group" + * + * The test also uses the test file FILENAME[0] (ohdr.h5): the parameter "filename" + */ +static herr_t +test_unknown(unsigned bogus_id, char *filename, hid_t fapl) +{ + hid_t fid = -1; /* file ID */ + hid_t gid = -1; /* group ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t loc = -1; /* location: file or group ID */ + hid_t fid_bogus = -1; /* bogus file ID */ + hid_t gid_bogus = -1; /* bogus group ID */ + hid_t loc_bogus = -1; /* location: bogus file or group ID */ + char testfile[256]; + + /* create a different name for a local copy of the data file to be + opened with rd/wr file permissions in case build and test are + done in the source directory. */ + HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS)); + testfile[strlen(FILE_BOGUS)]='\0'; + HDstrncat(testfile, ".copy", 5); + + /* Make a copy of the data file from svn. */ + if(h5_make_local_copy(FILE_BOGUS, testfile) < 0) + FAIL_STACK_ERROR + + TESTING("object with unknown header message and no flags set"); + + /* Open filename */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + + /* Open FILE_BOGUS */ + if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in FILE_BOGUS */ + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc_bogus = gid_bogus; + + /* Create "group" in filename */ + if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + + } else { /* H5O_BOGUS_VALID_ID */ + loc_bogus = fid_bogus; + loc = fid; + } /* end else */ + + /* Open the dataset with the unknown header message, but no extra flags */ + if((did = H5Dopen2(loc_bogus, "Dataset1", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + + TESTING("object in r/o file with unknown header message & 'fail if unknown and open for write' flag set"); + + /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ + if((did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + + /* TESTING("object in r/o file with unknown header message & 'fail if unknown always' flag set"); */ + /* There is no H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS */ + + TESTING("object with unknown header message & 'mark if unknown' flag set"); + + /* Copy object with "mark if unknown" flag on message into file (FILENAME[0]) that can be modified */ + if(H5Ocopy(loc_bogus, "Dataset4", loc, "Dataset4", H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR + + /* Closing: filename */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + /* Re-open filename, with read-only permissions */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in filename */ + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + } else + loc = fid; + + /* Open the dataset with the "mark if unknown" message */ + if((did = H5Dopen2(loc, "Dataset4", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Check that the "unknown" message was _NOT_ marked */ + if(H5O_check_msg_marked_test(did, FALSE) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Close "group" in filename depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + + /* Close filename (to flush change to object header) */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + /* Re-open filename */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in filename */ + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + } else + loc = fid; + + /* Open the dataset with the "mark if unknown" message */ + if((did = H5Dopen2(loc, "Dataset4", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Create data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + + /* Create an attribute, to get the object header into write access */ + if((aid = H5Acreate2(did, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close attribute */ + if(H5Aclose(aid) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Close "group" in filename depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + + /* Close filename (to flush change to object header) */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + /* Re-open filename */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in filename */ + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + } else + loc = fid; + + /* Re-open the dataset with the "mark if unknown" message */ + if((did = H5Dopen2(loc, "Dataset4", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Check that the "unknown" message was marked */ + if(H5O_check_msg_marked_test(did, TRUE) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Closing: filename */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + PASSED(); + + /* Closing: FILE_BOGUS */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid_bogus) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid_bogus) < 0) + FAIL_STACK_ERROR + + TESTING("object in r/w file with unknown header message & 'fail if unknown and open for write' flag set"); + + /* Open FILE_BOGUS with RW intent this time */ + if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in FILE_BOGUS */ + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc_bogus = gid_bogus; + } else + loc_bogus = fid_bogus; + + /* Attempt to open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ + H5E_BEGIN_TRY { + did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT); + } H5E_END_TRY; + if(did >= 0) { + H5Dclose(did); + TEST_ERROR + } /* end if */ + + PASSED(); + + /* TESTING("object in r/w file with unknown header message & 'fail if unknown always' flag set"); */ + /* There is no H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS */ + + /* Closing: FILE_BOGUS */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid_bogus) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid_bogus) < 0) + FAIL_STACK_ERROR + + PASSED(); + + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid); + H5Gclose(gid); + H5Fclose(fid_bogus); + H5Gclose(gid_bogus); + H5Dclose(did); + H5Sclose(sid); + H5Aclose(aid); + } H5E_END_TRY; + + return FAIL; +} /* test_unknown() */ + /*------------------------------------------------------------------------- * Function: main @@ -334,8 +606,8 @@ main(void) if(H5Pset_libver_bounds(fapl, (b ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST) < 0) FAIL_STACK_ERROR - /* test on object continuation block */ - if(test_cont(filename, fapl) < 0) + /* test on object continuation block */ + if(test_cont(filename, fapl) < 0) FAIL_STACK_ERROR /* Create the file to operate on */ @@ -650,164 +922,22 @@ main(void) PASSED(); - - /* Test reading datasets with undefined object header messages */ - HDputs("Accessing objects with unknown header messages:"); - { - hid_t file2; /* File ID for 'bogus' object file */ - hid_t sid; /* Dataspace ID */ - hid_t aid; /* Attribute ID */ - char testpath[512] = ""; - char testfile[512] = ""; - char *srcdir = HDgetenv("srcdir"); - - /* Build path to all test files */ - if(srcdir && ((HDstrlen(srcdir) + 2) < sizeof(testpath))) { - HDstrcpy(testpath, srcdir); - HDstrcat(testpath, "/"); - } /* end if */ - - /* Build path to test file */ - if(srcdir && ((HDstrlen(testpath) + HDstrlen(FILE_BOGUS) + 1) < sizeof(testfile))) - HDstrcpy(testfile, testpath); - HDstrcat(testfile, FILE_BOGUS); - - TESTING("object with unknown header message and no flags set"); - - /* Open the file with objects that have unknown header messages (generated with gen_bogus.c) */ - if((file2 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Open the dataset with the unknown header message, but no extra flags */ - if((dset = H5Dopen2(file2, "/Dataset1", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Dclose(dset) < 0) - TEST_ERROR - - PASSED(); - - TESTING("object with unknown header message & 'fail if unknown and open for write' flag set"); - - /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ - if((dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Dclose(dset) < 0) - TEST_ERROR - - PASSED(); - - TESTING("object with unknown header message & 'mark if unknown' flag set"); - - /* Copy object with "mark if unknown" flag on message into file that can be modified */ - if(H5Ocopy(file2, "/Dataset3", file, "/Dataset3", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - - /* Close the file we created (to flush changes to file) */ - if(H5Fclose(file) < 0) - TEST_ERROR - - /* Re-open the file created, with read-only permissions */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - - /* Open the dataset with the "mark if unknown" message */ - if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Check that the "unknown" message was _NOT_ marked */ - if(H5O_check_msg_marked_test(dset, FALSE) < 0) - FAIL_STACK_ERROR - - /* Close the dataset */ - if(H5Dclose(dset) < 0) - TEST_ERROR - - /* Close the file we created (to flush change to object header) */ - if(H5Fclose(file) < 0) - TEST_ERROR - - /* Re-open the file created */ - if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR - - /* Open the dataset with the "mark if unknown" message */ - if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Create data space */ - if((sid = H5Screate(H5S_SCALAR)) < 0) - FAIL_STACK_ERROR - - /* Create an attribute, to get the object header into write access */ - if((aid = H5Acreate2(dset, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - - /* Close dataspace */ - if(H5Sclose(sid) < 0) - FAIL_STACK_ERROR - - /* Close attribute */ - if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR - - /* Close the dataset */ - if(H5Dclose(dset) < 0) - TEST_ERROR - - /* Close the file we created (to flush change to object header) */ - if(H5Fclose(file) < 0) - TEST_ERROR - - /* Re-open the file created */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - - /* Re-open the dataset with the "mark if unknown" message */ - if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Check that the "unknown" message was marked */ - if(H5O_check_msg_marked_test(dset, TRUE) < 0) - FAIL_STACK_ERROR - - /* Close the dataset */ - if(H5Dclose(dset) < 0) - TEST_ERROR - - /* Close the file with the bogus objects */ - if(H5Fclose(file2) < 0) - TEST_ERROR - - PASSED(); - - /* Open the file with objects that have unknown header messages (generated with gen_bogus.c) with RW intent this time */ - if((file2 = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - TEST_ERROR - - TESTING("object with unknown header message & 'fail if unknown and open for write' flag set"); - - /* Attempt to open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ - H5E_BEGIN_TRY { - dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT); - } H5E_END_TRY; - if(dset >= 0) { - H5Dclose(dset); - TEST_ERROR - } /* end if */ - - /* Close the file with the bogus objects */ - if(H5Fclose(file2) < 0) - TEST_ERROR - - PASSED(); - } - - /* Close the file we created */ + /* Close the file we created */ if(H5Fclose(file) < 0) TEST_ERROR - /* Test object header creation metadata cache issues */ - if(test_ohdr_cache(filename, fapl) < 0) + /* Test reading datasets with undefined object header messages + * and the various "fail/mark if unknown" object header message flags + */ + HDputs("Accessing objects with unknown header messages: H5O_BOGUS_VALID_ID"); + if(test_unknown(H5O_BOGUS_VALID_ID, filename, fapl) < 0) + TEST_ERROR + HDputs("Accessing objects with unknown header messages: H5O_BOGUS_INVALID_ID"); + if(test_unknown(H5O_BOGUS_INVALID_ID, filename, fapl) < 0) + TEST_ERROR + + /* Test object header creation metadata cache issues */ + if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR } /* end for */ diff --git a/test/plugin.c b/test/plugin.c index 28c7c30..b662476 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -4,34 +4,32 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 + * Programmer: Raymond Lu + * 13 February 2013 * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) */ -#include <stdlib.h> -#include <time.h> #include "h5test.h" #include "H5srcdir.h" /* - * This file needs to access private datatypes from the H5Z package. + * This file needs to access private datatypes from the H5Z and H5PL package. */ +#define H5PL_PACKAGE +#include "H5PLpkg.h" #define H5Z_PACKAGE #include "H5Zpkg.h" /* Filters for HDF5 internal test */ #define H5Z_FILTER_DYNLIB1 257 -#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIB2 258 #define H5Z_FILTER_DYNLIB3 259 #define H5Z_FILTER_DYNLIB4 260 @@ -42,10 +40,10 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 /* Dataset names for testing filters */ -#define DSET_DEFLATE_NAME "deflate" -#define DSET_DYNLIB1_NAME "dynlib1" -#define DSET_DYNLIB2_NAME "dynlib2" -#define DSET_DYNLIB4_NAME "dynlib4" +#define DSET_DEFLATE_NAME "deflate" +#define DSET_DYNLIB1_NAME "dynlib1" +#define DSET_DYNLIB2_NAME "dynlib2" +#define DSET_DYNLIB4_NAME "dynlib4" /* Parameters for internal filter test */ #define FILTER_CHUNK_DIM1 2 @@ -64,65 +62,61 @@ const char *FILENAME[] = { #define GROUP_ITERATION 1000 -int points_deflate[DSET_DIM1][DSET_DIM2], - points_dynlib1[DSET_DIM1][DSET_DIM2], - points_dynlib2[DSET_DIM1][DSET_DIM2], - points_dynlib4[DSET_DIM1][DSET_DIM2], - points_bzip2[DSET_DIM1][DSET_DIM2]; +int points_deflate[DSET_DIM1][DSET_DIM2], + points_dynlib1[DSET_DIM1][DSET_DIM2], + points_dynlib2[DSET_DIM1][DSET_DIM2], + points_dynlib4[DSET_DIM1][DSET_DIM2], + points_bzip2[DSET_DIM1][DSET_DIM2]; /*------------------------------------------------------------------------- - * Function: test_filter_internal + * Function: test_filter_internal * - * Purpose: Tests writing entire data and partial data with filters - * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Raymond Lu - * 27 February 2013 + * Purpose: Tests writing entire data and partial data with filters * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl) { - hid_t dataset; /* Dataset ID */ - hid_t dxpl; /* Dataset xfer property list ID */ - hid_t write_dxpl; /* Dataset xfer property list ID for writing */ - hid_t sid; /* Dataspace ID */ - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ - const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ - const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ - void *tconv_buf = NULL; /* Temporary conversion buffer */ - int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; - size_t i, j; /* Local index variables */ - int n = 0; + herr_t ret_value = -1; + hid_t dataset = -1; /* Dataset ID */ + hid_t dxpl = -1; /* Dataset xfer property list ID */ + hid_t write_dxpl = -1; /* Dataset xfer property list ID for writing */ + hid_t sid = -1; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; + size_t i, j; /* Local index variables */ + int n = 0; /* Create the data space */ - if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR /* * Create a small conversion buffer to test strip mining. We * might as well test all we can! */ - if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR tconv_buf = HDmalloc((size_t)1000); - if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; + if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) TEST_ERROR if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; TESTING(" filters (setup)"); /* Check if all the filters are available */ - if(H5Pall_filters_avail(dcpl)!=TRUE) { + if(H5Pall_filters_avail(dcpl) != TRUE) { H5_FAILED(); - printf(" Line %d: Incorrect filter availability\n",__LINE__); - goto error; + printf(" Line %d: Incorrect filter availability\n", __LINE__); + TEST_ERROR } /* end if */ /* Create the dataset */ - if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, - dcpl, H5P_DEFAULT)) < 0) goto error; + if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR PASSED(); @@ -132,20 +126,16 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) */ TESTING(" filters (uninitialized read)"); - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; - - for(i=0; i<(size_t)size[0]; i++) { - for(j=0; j<(size_t)size[1]; j++) { - if(0!=check[i][j]) { - H5_FAILED(); - printf(" Read a non-zero value.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - goto error; - } - } - } + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; + + for(i=0; i<(size_t)size[0]; i++) + for(j=0; j<(size_t)size[1]; j++) + if(0 != check[i][j]) { + H5_FAILED(); + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + TEST_ERROR + } /* end if */ PASSED(); /*---------------------------------------------------------------------- @@ -156,14 +146,11 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (write)"); n = 0; - for(i=0; i<size[0]; i++) { - for(j=0; j<size[1]; j++) { - points[i][j] = (int)(n++); - } - } + for(i=0; i<size[0]; i++) + for(j=0; j<size[1]; j++) + points[i][j] = (int)(n++); - if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) - TEST_ERROR; + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR; PASSED(); @@ -174,22 +161,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (read)"); /* Read the dataset back */ - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; - - /* Check that the values read are the same as the values written */ - for(i=0; i<size[0]; i++) { - for(j=0; j<size[1]; j++) { - if(points[i][j] != check[i][j]) { - H5_FAILED(); - fprintf(stderr," Read different values than written.\n"); - fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); - fprintf(stderr," At original: %d\n", (int)points[i][j]); - fprintf(stderr," At returned: %d\n", (int)check[i][j]); - goto error; - } - } - } + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<size[0]; i++) + for(j=0; j<size[1]; j++) + if(points[i][j] != check[i][j]) { + H5_FAILED(); + HDfprintf(stderr," Read different values than written.\n"); + HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDfprintf(stderr," At original: %d\n", (int)points[i][j]); + HDfprintf(stderr," At returned: %d\n", (int)check[i][j]); + TEST_ERROR + } /* end if */ PASSED(); @@ -202,30 +186,24 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) */ TESTING(" filters (modify)"); - for(i=0; i<size[0]; i++) { - for(j=0; j<size[1]/2; j++) { - points[i][j] = (int)HDrandom () % RANDOM_LIMIT; - } - } - if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) - TEST_ERROR; - - /* Read the dataset back and check it */ - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; - - /* Check that the values read are the same as the values written */ - for(i=0; i<size[0]; i++) { - for(j=0; j<size[1]; j++) { - if(points[i][j] != check[i][j]) { - H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - goto error; - } - } - } + for(i=0; i<size[0]; i++) + for(j=0; j<size[1]/2; j++) + points[i][j] = (int)HDrandom () % RANDOM_LIMIT; + + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR; + + /* Read the dataset back and check it */ + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<size[0]; i++) + for(j=0; j<size[1]; j++) + if(points[i][j] != check[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + TEST_ERROR + } /* end if */ PASSED(); @@ -240,19 +218,17 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) if(H5Dclose(dataset) < 0) TEST_ERROR; if((dataset = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; - /* Check that the values read are the same as the values written */ - for(i = 0; i < size[0]; i++) - for(j = 0; j < size[1]; j++) - if(points[i][j] != check[i][j]) { - H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - goto error; - } /* end if */ + /* Check that the values read are the same as the values written */ + for(i = 0; i < size[0]; i++) + for(j = 0; j < size[1]; j++) + if(points[i][j] != check[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + TEST_ERROR + } /* end if */ PASSED(); @@ -264,249 +240,228 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) */ TESTING(" filters (partial I/O)"); - for(i=0; i<(size_t)hs_size[0]; i++) { - for(j=0; j<(size_t)hs_size[1]; j++) { - points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom() % RANDOM_LIMIT; - } - } - if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size, - NULL) < 0) TEST_ERROR; + for(i=0; i<(size_t)hs_size[0]; i++) + for(j=0; j<(size_t)hs_size[1]; j++) + points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom() % RANDOM_LIMIT; + + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) TEST_ERROR; /* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */ - if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0) - TEST_ERROR; - - if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) - TEST_ERROR; - - /* Check that the values read are the same as the values written */ - for(i=0; i<(size_t)hs_size[0]; i++) { - for(j=0; j<(size_t)hs_size[1]; j++) { - if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != - check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) { - H5_FAILED(); - fprintf(stderr," Read different values than written.\n"); - fprintf(stderr," At index %lu,%lu\n", - (unsigned long)((size_t)hs_offset[0]+i), - (unsigned long)((size_t)hs_offset[1]+j)); - fprintf(stderr," At original: %d\n", - (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); - fprintf(stderr," At returned: %d\n", - (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); - goto error; - } - } - } + if(H5Dwrite(dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0) TEST_ERROR; + + if(H5Dread(dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i=0; i<(size_t)hs_size[0]; i++) + for(j=0; j<(size_t)hs_size[1]; j++) + if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) { + H5_FAILED(); + HDfprintf(stderr," Read different values than written.\n"); + HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)((size_t)hs_offset[0]+i), (unsigned long)((size_t)hs_offset[1]+j)); + HDfprintf(stderr," At original: %d\n", (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); + HDfprintf(stderr," At returned: %d\n", (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); + TEST_ERROR + } /* end if */ PASSED(); - /* Save the data written to the file for later comparison when the file + /* Save the data written to the file for later comparison when the file * is reopened for read test */ - for(i=0; i<size[0]; i++) { - for(j=0; j<size[1]; j++) { - if(!HDstrcmp(name, DSET_DEFLATE_NAME)) { - points_deflate[i][j] = points[i][j]; - } else if(!HDstrcmp(name, DSET_DYNLIB1_NAME)) { - points_dynlib1[i][j] = points[i][j]; - } else if(!HDstrcmp(name, DSET_DYNLIB2_NAME)) { - points_dynlib2[i][j] = points[i][j]; - } else if(!HDstrcmp(name, DSET_DYNLIB4_NAME)) { - points_dynlib4[i][j] = points[i][j]; - } - } - } + for(i=0; i<size[0]; i++) + for(j=0; j<size[1]; j++) + if(!HDstrcmp(name, DSET_DEFLATE_NAME)) + points_deflate[i][j] = points[i][j]; + else if(!HDstrcmp(name, DSET_DYNLIB1_NAME)) + points_dynlib1[i][j] = points[i][j]; + else if(!HDstrcmp(name, DSET_DYNLIB2_NAME)) + points_dynlib2[i][j] = points[i][j]; + else if(!HDstrcmp(name, DSET_DYNLIB4_NAME)) + points_dynlib4[i][j] = points[i][j]; + + ret_value = 0; +error: /* Clean up objects used for this test */ - if(H5Dclose (dataset) < 0) goto error; - if(H5Sclose (sid) < 0) goto error; - if(H5Pclose (dxpl) < 0) goto error; - free (tconv_buf); - - return(0); + H5E_BEGIN_TRY { + H5Dclose(dataset); + H5Sclose(sid); + H5Pclose(dxpl); + } H5E_END_TRY -error: if(tconv_buf) - free (tconv_buf); - return -1; + HDfree(tconv_buf); + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_filters_for_datasets - * - * Purpose: Tests creating datasets and writing data with dynamically - * loaded filters + * Function: test_filters_for_datasets * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Raymond Lu - * 14 March 2013 + * Purpose: Tests creating datasets and writing data with dynamically loaded filters * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_filters_for_datasets(hid_t file) { - hid_t dc; /* Dataset creation property list ID */ - const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ - unsigned int compress_level = 9; - unsigned int dynlib4_values[4]; + herr_t ret_value = -1; + hid_t dc = -1; /* Dataset creation property list ID */ + const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ + unsigned int compress_level = 9; + unsigned int dynlib4_values[4]; /*---------------------------------------------------------- * STEP 1: Test deflation by itself. *---------------------------------------------------------- */ + HDputs("Testing deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - puts("Testing deflate filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if(H5Pset_deflate (dc, 6) < 0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR + if(H5Pset_deflate(dc, 6) < 0) TEST_ERROR - if(test_filter_internal(file,DSET_DEFLATE_NAME,dc) < 0) goto error; + if(test_filter_internal(file, DSET_DEFLATE_NAME, dc) < 0) TEST_ERROR /* Clean up objects used for this test */ - if(H5Pclose (dc) < 0) goto error; + if(H5Pclose(dc) < 0) TEST_ERROR #else /* H5_HAVE_FILTER_DEFLATE */ - TESTING("deflate filter"); SKIPPED(); - puts(" Deflate filter not enabled"); + HDputs(" Deflate filter not enabled"); #endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- * STEP 2: Test DYNLIB1 by itself. *---------------------------------------------------------- */ - puts("Testing DYNLIB1 filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) goto error; + HDputs(" DYNLIB1 filter"); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR + if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) TEST_ERROR - if(test_filter_internal(file,DSET_DYNLIB1_NAME,dc) < 0) goto error; + if(test_filter_internal(file, DSET_DYNLIB1_NAME, dc) < 0) TEST_ERROR /* Clean up objects used for this test */ - if(H5Pclose (dc) < 0) goto error; + if(H5Pclose(dc) < 0) TEST_ERROR - /* Unregister the dynamic filter DYNLIB1 for testing purpose. The next time when this test is run for + /* Unregister the dynamic filter DYNLIB1 for testing purpose. The next time when this test is run for * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries * for this filter. */ - if(H5Zunregister(H5Z_FILTER_DYNLIB1) < 0) goto error; + if(H5Zunregister(H5Z_FILTER_DYNLIB1) < 0) TEST_ERROR /*---------------------------------------------------------- * STEP 3: Test DYNLIB2 by itself. *---------------------------------------------------------- */ - puts("Testing DYNLIB2 filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL) < 0) goto error; + HDputs(" DYNLIB2 filter"); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR + if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL) < 0) TEST_ERROR - if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) goto error; + if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) TEST_ERROR /* Clean up objects used for this test */ - if(H5Pclose (dc) < 0) goto error; + if(H5Pclose(dc) < 0) TEST_ERROR - /* Unregister the dynamic filter DYNLIB2 for testing purpose. The next time when this test is run for + /* Unregister the dynamic filter DYNLIB2 for testing purpose. The next time when this test is run for * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries * for this filter. */ - if(H5Zunregister(H5Z_FILTER_DYNLIB2) < 0) goto error; + if(H5Zunregister(H5Z_FILTER_DYNLIB2) < 0) TEST_ERROR /*---------------------------------------------------------- * STEP 4: Test DYNLIB4 by itself. *---------------------------------------------------------- */ - puts("Testing DYNLIB4 filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + HDputs(" DYNLIB4 filter"); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR dynlib4_values[0] = 9; - if(H5get_libversion(&dynlib4_values[1], &dynlib4_values[2], &dynlib4_values[3]) < 0) goto error; - if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB4, H5Z_FLAG_MANDATORY, (size_t)4, dynlib4_values) < 0) goto error; + if(H5get_libversion(&dynlib4_values[1], &dynlib4_values[2], &dynlib4_values[3]) < 0) TEST_ERROR + if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB4, H5Z_FLAG_MANDATORY, (size_t)4, dynlib4_values) < 0) TEST_ERROR - if(test_filter_internal(file,DSET_DYNLIB4_NAME,dc) < 0) goto error; + if(test_filter_internal(file, DSET_DYNLIB4_NAME, dc) < 0) TEST_ERROR /* Clean up objects used for this test */ - if(H5Pclose (dc) < 0) goto error; + if(H5Pclose(dc) < 0) TEST_ERROR /* Unregister the dynamic filter DYNLIB4 for testing purpose. The next time when this test is run for * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries * for this filter. */ - if(H5Zunregister(H5Z_FILTER_DYNLIB4) < 0) goto error; + if(H5Zunregister(H5Z_FILTER_DYNLIB4) < 0) TEST_ERROR - return 0; + ret_value = 0; error: - return -1; + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Pclose(dc); + } H5E_END_TRY + + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_read_data - * - * Purpose: Tests reading data and compares values - * - * Return: Success: 0 - * Failure: -1 + * Function: test_read_data * - * Programmer: Raymond Lu - * 14 March 2013 + * Purpose: Tests reading data and compares values * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_read_data(hid_t dataset, int *origin_data) { - int check[DSET_DIM1][DSET_DIM2]; - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ - int *data_p = origin_data; - size_t i, j; /* Local index variables */ + herr_t ret_value = -1; + int check[DSET_DIM1][DSET_DIM2]; + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + int *data_p = origin_data; + size_t i, j; /* Local index variables */ /* Read the dataset back */ - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) - TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ - for(i=0; i<size[0]; i++) { + for(i=0; i<size[0]; i++) for(j=0; j<size[1]; j++) { - if(*data_p != check[i][j]) { - H5_FAILED(); - fprintf(stderr," Read different values than written.\n"); - fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); - fprintf(stderr," At original: %d\n", *data_p); - fprintf(stderr," At returned: %d\n", (int)check[i][j]); - goto error; - } + if(*data_p != check[i][j]) { + H5_FAILED(); + HDfprintf(stderr," Read different values than written.\n"); + HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDfprintf(stderr," At original: %d\n", *data_p); + HDfprintf(stderr," At returned: %d\n", (int)check[i][j]); + TEST_ERROR + } /* end if */ data_p++; - } - } + } PASSED(); - return 0; + ret_value = 0; error: - return -1; + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_read_with_filters + * Function: test_read_with_filters * - * Purpose: Tests reading dataset created with dynamically loaded filters - * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Raymond Lu - * 14 March 2013 + * Purpose: Tests reading dataset created with dynamically loaded filters * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_read_with_filters(hid_t file) { - hid_t dset; /* Dataset ID */ + herr_t ret_value = -1; + hid_t dset = -1; /* Dataset ID */ /*---------------------------------------------------------- * STEP 1: Test deflation by itself. *---------------------------------------------------------- */ -#ifdef H5_HAVE_FILTER_DEFLATE - TESTING("Testing deflate filter"); + TESTING("deflate filter"); +#ifdef H5_HAVE_FILTER_DEFLATE if(H5Zfilter_avail(H5Z_FILTER_DEFLATE) != TRUE) TEST_ERROR if((dset = H5Dopen2(file,DSET_DEFLATE_NAME,H5P_DEFAULT)) < 0) TEST_ERROR @@ -517,18 +472,17 @@ test_read_with_filters(hid_t file) /* Clean up objects used for this test */ #else /* H5_HAVE_FILTER_DEFLATE */ - TESTING("deflate filter"); SKIPPED(); - puts(" Deflate filter not enabled"); + HDputs(" Deflate filter not enabled"); #endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- * STEP 2: Test DYNLIB1 by itself. *---------------------------------------------------------- */ - TESTING("Testing DYNLIB1 filter"); + TESTING(" DYNLIB1 filter"); - if((dset = H5Dopen2(file,DSET_DYNLIB1_NAME,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR if(test_read_data(dset, (int *)points_dynlib1) < 0) TEST_ERROR @@ -538,9 +492,9 @@ test_read_with_filters(hid_t file) * STEP 3: Test Bogus2 by itself. *---------------------------------------------------------- */ - TESTING("Testing DYNLIB2 filter"); + TESTING(" DYNLIB2 filter"); - if((dset = H5Dopen2(file,DSET_DYNLIB2_NAME,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset = H5Dopen2(file, DSET_DYNLIB2_NAME, H5P_DEFAULT)) < 0) TEST_ERROR if(test_read_data(dset, (int *)points_dynlib2) < 0) TEST_ERROR @@ -550,7 +504,7 @@ test_read_with_filters(hid_t file) * STEP 4: Test DYNLIB4 by itself. *---------------------------------------------------------- */ - TESTING("Testing DYNLIB4 filter"); + TESTING(" DYNLIB4 filter"); if((dset = H5Dopen2(file,DSET_DYNLIB4_NAME,H5P_DEFAULT)) < 0) TEST_ERROR @@ -558,27 +512,33 @@ test_read_with_filters(hid_t file) if(H5Dclose(dset) < 0) TEST_ERROR - return 0; + ret_value = 0; error: - return -1; + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Dclose(dset); + } H5E_END_TRY + + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_noread_data + * Function: test_noread_data * - * Purpose: Tests not reading data + * Purpose: Tests not reading data * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_noread_data(hid_t dataset) { + herr_t ret_value = -1; int check[DSET_DIM1][DSET_DIM2]; - herr_t ret; + herr_t ret = -1; /* Read the dataset back */ H5E_BEGIN_TRY { @@ -588,113 +548,122 @@ test_noread_data(hid_t dataset) TEST_ERROR PASSED(); - return 0; + ret_value = 0; error: - return -1; + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_noread_with_filters - * - * Purpose: Tests reading dataset created with dynamically loaded filters disabled + * Function: test_noread_with_filters * - * Return: Success: 0 - * Failure: -1 + * Purpose: Tests reading dataset created with dynamically loaded filters disabled * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_noread_with_filters(hid_t file) { - hid_t dset; /* Dataset ID */ - unsigned plugin_state; /* status of plugins */ - TESTING("Testing DYNLIB1 filter with plugins disabled"); + herr_t ret_value = -1; + hid_t dset = -1; /* Dataset ID */ + unsigned plugin_state; /* status of plugins */ + + TESTING("DYNLIB1 filter with plugins disabled"); /* disable filter plugin */ if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR plugin_state = plugin_state & ~H5PL_FILTER_PLUGIN; if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR - if((dset = H5Dopen2(file,DSET_DYNLIB1_NAME,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR if(test_noread_data(dset) < 0) TEST_ERROR if(H5Dclose(dset) < 0) TEST_ERROR - /* re-enable filter plugin */ - plugin_state = plugin_state | H5PL_FILTER_PLUGIN; - if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR - - return 0; + ret_value = 0; error: /* re-enable filter plugin */ plugin_state = plugin_state | H5PL_FILTER_PLUGIN; - if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR - return -1; + H5PLset_loading_state(plugin_state); + + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Dclose(dset); + } H5E_END_TRY + + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_filters_for_groups - * - * Purpose: Tests creating group with dynamically loaded filters + * Function: test_filters_for_groups * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Raymond Lu - * 1 April 2013 + * Purpose: Tests creating group with dynamically loaded filters * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_filters_for_groups(hid_t file) { - hid_t gcpl, gid, group; - int i; - char gname[256]; + herr_t ret_value = -1; + hid_t gcpl = -1; + hid_t gid = -1; + hid_t group = -1; + int i; + char gname[256]; + + TESTING("DYNLIB3 filter for group"); - TESTING("Testing DYNLIB3 filter for group"); + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR - if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; - - /* Use DYNLIB3 for creating groups */ - if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error; + /* Use DYNLIB3 for creating groups */ + if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) TEST_ERROR /* Create a group using this filter */ - if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error; + if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR /* Create multiple groups under "group1" */ - for (i=0; i < GROUP_ITERATION; i++) { - sprintf(gname, "group_%d", i); - if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if(H5Gclose(group) < 0) goto error; + for(i=0; i < GROUP_ITERATION; i++) { + HDsprintf(gname, "group_%d", i); + if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Gclose(group) < 0) TEST_ERROR } /* Close the group */ - if(H5Gclose(gid) < 0) goto error; + if(H5Gclose(gid) < 0) TEST_ERROR /* Clean up objects used for this test */ - if(H5Pclose (gcpl) < 0) goto error; + if(H5Pclose(gcpl) < 0) TEST_ERROR PASSED(); - return 0; + ret_value = 0; error: - return -1; + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Gclose(group); + H5Gclose(gid); + H5Pclose(gcpl); + } H5E_END_TRY + + return ret_value; } /*------------------------------------------------------------------------- - * Function: test_groups_with_filters + * Function: test_groups_with_filters * - * Purpose: Tests opening group with dynamically loaded filters + * Purpose: Tests opening group with dynamically loaded filters * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 1 April 2013 * *------------------------------------------------------------------------- @@ -702,70 +671,323 @@ error: static herr_t test_groups_with_filters(hid_t file) { - hid_t gid, group; + herr_t ret_value = -1; + hid_t gid; + hid_t group; int i; char gname[256]; - TESTING("Testing opening groups with DYNLIB3 filter"); + TESTING("opening groups with DYNLIB3 filter"); /* Open the top group */ - if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) goto error; + if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) TEST_ERROR /* Create multiple groups under "group1" */ - for (i=0; i < GROUP_ITERATION; i++) { - sprintf(gname, "group_%d", i); - if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) goto error; - if(H5Gclose(group) < 0) goto error; + for(i=0; i < GROUP_ITERATION; i++) { + HDsprintf(gname, "group_%d", i); + if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Gclose(group) < 0) TEST_ERROR } /* Close the group */ - if(H5Gclose(gid) < 0) goto error; + if(H5Gclose(gid) < 0) TEST_ERROR PASSED(); - return 0; + ret_value = 0; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Gclose(group); + H5Gclose(gid); + } H5E_END_TRY + + return ret_value; +} + + +/*------------------------------------------------------------------------- + * Function: test_filter_path_apis + * + * Purpose: Tests accessing the path table for dynamically loaded filters + * + * Return: Success: 0 + * Failure: -1 + *------------------------------------------------------------------------- + */ +static herr_t +test_filter_path_apis(void) +{ + herr_t ret_value = -1; + unsigned int i; + unsigned int ndx; + herr_t ret; + ssize_t pathlen = -1; + char pathname[256]; + char tempname[256]; + + HDputs("Testing access to the filter path table"); + + if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + + H5PLsize(&ndx); + + TESTING(" remove"); + /* Remove all existing paths*/ + for(i=ndx; i > 0; i--) + if(H5PLremove(i-1) < 0) { + HDfprintf(stderr," at %d: %s\n", i, pathname); + TEST_ERROR + } /* end if */ + /* Verify the table is empty */ + H5PLsize(&ndx); + if(ndx > 0) TEST_ERROR + PASSED(); + + TESTING(" remove (exceed min)"); + /* Exceed the min path removal */ + H5E_BEGIN_TRY { + ret = H5PLremove(0); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + PASSED(); + + TESTING(" append"); + /* Create multiple paths to fill table */ + for(i=0; i < H5PL_MAX_PATH_NUM; i++) { + HDsprintf(pathname, "a_path_%d", i); + if(H5PLappend(pathname) < 0) { + HDfprintf(stderr," at %d: %s\n", i, pathname); + TEST_ERROR + } + } + /* Verify the table is full */ + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR + PASSED(); + + TESTING(" append (exceed)"); + /* Exceed the max path append */ + H5E_BEGIN_TRY { + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM); + ret = H5PLappend(pathname); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + PASSED(); + + TESTING(" remove (exceed max)"); + /* Exceed the max path removal */ + H5E_BEGIN_TRY { + ret = H5PLremove(H5PL_MAX_PATH_NUM); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + PASSED(); + + TESTING(" get (path name)"); + if((pathlen = H5PLget(0, NULL, 0)) <= 0) { + HDfprintf(stderr," get path 0 length failed\n"); + TEST_ERROR + } + if(pathlen != 8) TEST_ERROR + + if((pathlen = H5PLget(0, pathname, 256)) <= 0) { + HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); + TEST_ERROR + } + if(HDstrcmp(pathname, "a_path_0") != 0) { + HDfprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" get (bounds)"); + if((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_1") != 0) { + HDfprintf(stderr," get 1: %s\n", pathname); + TEST_ERROR + } + if((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); + if(HDstrcmp(pathname, tempname) != 0) { + HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" get (bounds exceed)"); + H5E_BEGIN_TRY { + pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0); + } H5E_END_TRY + if(pathlen > 0) TEST_ERROR + PASSED(); + + TESTING(" remove (verify for prepend)"); + /* Remove one path*/ + if(H5PLremove(8) < 0) TEST_ERROR + + /* Verify that the entries were moved */ + if((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_9") != 0) { + HDfprintf(stderr," get 8: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + /* Verify the table is not full */ + H5PLsize(&ndx); + if (ndx != H5PL_MAX_PATH_NUM - 1) TEST_ERROR + + TESTING(" prepend"); + /* Prepend one path*/ + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if(H5PLprepend(pathname) < 0) { + HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname); + TEST_ERROR + } + + /* Verify the table is full */ + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR + + /* Verify that the entries were moved */ + if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_7") != 0) { + HDfprintf(stderr," get 8: %s\n", pathname); + TEST_ERROR + } + if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if(HDstrcmp(pathname, tempname) != 0) { + HDfprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" prepend (exceed)"); + /* Exceed the max path prepend */ + H5E_BEGIN_TRY { + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2); + ret = H5PLprepend(pathname); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + PASSED(); + + TESTING(" replace"); + /* Replace one path*/ + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4); + if(H5PLreplace(pathname, 1) < 0) { + HDfprintf(stderr," replace 1: %s\n", pathname); + TEST_ERROR + } + + /* Verify the table is full */ + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR + + /* Verify that the entries were not moved */ + if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if(HDstrcmp(pathname, tempname) != 0) { + HDfprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + if(H5PLget(2, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_1") != 0) { + HDfprintf(stderr," get 2: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" remove (verify for insert)"); + /* Remove one path*/ + if(H5PLremove(4) < 0) TEST_ERROR + + /* Verify that the entries were moved */ + if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_4") != 0) { + HDfprintf(stderr," get 4: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + /* Verify the table is not full */ + H5PLsize(&ndx); + if(ndx != 15) TEST_ERROR + + TESTING(" insert"); + /* Insert one path*/ + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5); + if(H5PLinsert(pathname, 3) < 0) { + HDfprintf(stderr," insert 3: %s\n", pathname); + TEST_ERROR + } + + /* Verify that the entries were moved */ + if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_2") != 0) { + HDfprintf(stderr," get 4: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + /* Verify the table is full */ + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR + + TESTING(" insert (exceed)"); + /* Exceed the max path insert */ + H5E_BEGIN_TRY { + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6); + ret = H5PLinsert(pathname, 12); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + PASSED(); + + ret_value = 0; error: - return -1; + return ret_value; } /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(1) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Raymond Lu - * 14 March 2013 + * Programmer: Raymond Lu + * 14 March 2013 * *------------------------------------------------------------------------- */ int main(void) { - char filename[FILENAME_BUF_SIZE]; - hid_t file, fapl, fapl2; - hbool_t new_format; - int mdc_nelmts; - size_t rdcc_nelmts; - size_t rdcc_nbytes; - double rdcc_w0; - int nerrors = 0; + char filename[FILENAME_BUF_SIZE]; + hid_t file = -1; + hid_t fapl = -1; + hid_t fapl2 = -1; + unsigned new_format; + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + int nerrors = 0; /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); /* Turn off the chunk cache, so all the chunks are immediately written to disk */ - if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) - TEST_ERROR + if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) TEST_ERROR rdcc_nbytes = 0; - if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) - TEST_ERROR + if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -781,64 +1003,68 @@ main(void) /* Set the FAPL for the type of format */ if(new_format) { - puts("\nTesting with new file format:"); + HDputs("\nTesting with new file format:"); my_fapl = fapl2; } /* end if */ else { - puts("Testing with old file format:"); + HDputs("Testing with old file format:"); my_fapl = fapl; } /* end else */ /* Create the file for this test */ - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Test dynamically loaded filters for chunked dataset */ - nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); + nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); /* Test dynamically loaded filters for groups */ nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) - TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR } /* end for */ /* Close FAPL */ if(H5Pclose(fapl2) < 0) TEST_ERROR if(H5Pclose(fapl) < 0) TEST_ERROR - - puts("\nTesting reading data with with dynamic plugin filters:"); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + HDputs("\nTesting reading data with with dynamic plugin filters:"); /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); fapl = h5_fileaccess(); /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Read the data with filters */ - nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); /* Open the groups with filters */ - nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); fapl = h5_fileaccess(); /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Read the data with disabled filters */ nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) - TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR + + /* Test the APIs for access to the filter plugin path table */ + nerrors += (test_filter_path_apis() < 0 ? 1 : 0); + + if(nerrors) TEST_ERROR - if(nerrors) - TEST_ERROR printf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); @@ -846,8 +1072,7 @@ main(void) error: nerrors = MAX(1, nerrors); - printf("***** %d PLUGIN TEST%s FAILED! *****\n", - nerrors, 1 == nerrors ? "" : "S"); + printf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } diff --git a/test/pool.c b/test/pool.c index 916d45e..6baf0be 100644 --- a/test/pool.c +++ b/test/pool.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> diff --git a/test/reserved.c b/test/reserved.c index bb6d328..d8d0c59 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/set_extent.c b/test/set_extent.c index f6c3766..16a283d 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -20,9 +18,6 @@ * Purpose: Tests the H5Dset_extent call */ -#include <time.h> -#include <stdlib.h> -#include "hdf5.h" #include "h5test.h" /*------------------------------------------------------------------------- diff --git a/test/space_overflow.c b/test/space_overflow.c index f0e5e1d..15be9ba 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/stab.c b/test/stab.c index 95e9722..4296f1c 100644 --- a/test/stab.c +++ b/test/stab.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tarray.c b/test/tarray.c index c86d3bd..a32b5b8 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tattr.c b/test/tattr.c index f29551a..283874a 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tbogus.h5 b/test/tbogus.h5 Binary files differindex 5b1d85e..87b183b 100644 --- a/test/tbogus.h5 +++ b/test/tbogus.h5 diff --git a/test/tcheck_version.c b/test/tcheck_version.c index a75d642..02f6eb6 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tchecksum.c b/test/tchecksum.c index 350a218..68a6e52 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/tconfig.c b/test/tconfig.c index 14c863e..fe4f400 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tcoords.c b/test/tcoords.c index 306c6b2..d729d4b 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 8a1d95f..19e8c2e 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index ed9845e..a5641f5 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the H5check_version function. diff --git a/test/testerror.sh.in b/test/testerror.sh.in index 7c03414..734b051 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for test_error and err_compat diff --git a/test/testframe.c b/test/testframe.c index 6a878da..80a3e01 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testhdf5.c b/test/testhdf5.c index eade815..e52d1e8 100644 --- a/test/testhdf5.c +++ b/test/testhdf5.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testhdf5.h b/test/testhdf5.h index 62dadde..2cbe6c6 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index b7aa6c4..1dd744b 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in index 04dfa62..d8d122a 100644 --- a/test/testlinks_env.sh.in +++ b/test/testlinks_env.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Test for external link with environment variable: HDF5_EXT_PREFIX diff --git a/test/testmeta.c b/test/testmeta.c index e1d12e6..b97eb68 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tfile.c b/test/tfile.c index aa20481..db6b787 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tgenprop.c b/test/tgenprop.c index 9e97bec..d6f4ac7 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/th5o.c b/test/th5o.c index 40844fa..2c150c8 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/th5s.c b/test/th5s.c index dcee25f..98be156 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/theap.c b/test/theap.c index 230ec4d..df69d9c 100644 --- a/test/theap.c +++ b/test/theap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Test user-created identifiers (hid_t's) and identifier types. */ diff --git a/test/titerate.c b/test/titerate.c index fff13f1..5c8960c 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tmeta.c b/test/tmeta.c index a7fd688..ceb7d2b 100644 --- a/test/tmeta.c +++ b/test/tmeta.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tmisc.c b/test/tmisc.c index 5b4bdb3..9766816 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/trefer.c b/test/trefer.c index 93c7dd4..d5a1bb8 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/trefstr.c b/test/trefstr.c index dd76cc1..40ce344 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tselect.c b/test/tselect.c index 704a2d3..7826bde 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tskiplist.c b/test/tskiplist.c index 62c5f8e..1adcd4b 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tsohm.c b/test/tsohm.c index d51a166..df464ffd 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/ttime.c b/test/ttime.c index 16acd3e..2eb2117 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/ttsafe.c b/test/ttsafe.c index d3c5cfb..d348667 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ttsafe.h b/test/ttsafe.h index f2e9e86..6cf449f 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index dec2eee..754c72a 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 9bbec34..623ef98 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index df51f72..65051c7 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index a2f25db..889d64b 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttst.c b/test/ttst.c index 4ffe4cd..c424d76 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tunicode.c b/test/tunicode.c index 6781fe8..566c21c 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Unicode test */ diff --git a/test/tvlstr.c b/test/tvlstr.c index 02bd59d..e5b2a60 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tvltypes.c b/test/tvltypes.c index 2928e57..2147ac7 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/unlink.c b/test/unlink.c index 993a7ec..1275c3e 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/unregister.c b/test/unregister.c index be40383..f241a61 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* @@ -80,9 +78,9 @@ const char *FILENAME[] = { static herr_t test_sec2(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; + hid_t file = -1; /* file ID */ + hid_t fapl = -1; /* file access property list ID */ + hid_t access_fapl = -1; char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -90,7 +88,8 @@ test_sec2(void) TESTING("SEC2 file driver"); /* Set property list and file name for SEC2 driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_sec2(fapl) < 0) TEST_ERROR; h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -125,11 +124,12 @@ test_sec2(void) */ if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + h5_delete_test_file(FILENAME[0], fapl); - if(H5Fclose(file) < 0) + /* Close the fapl */ + if(H5Pclose(fapl) < 0) TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -184,7 +184,8 @@ test_direct(void) /* Set property list and file name for Direct driver. Set memory alignment boundary * and file block size to 512 which is the minimum for Linux 2.6. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0) TEST_ERROR; h5_fixname(FILENAME[5], fapl, filename, sizeof filename); @@ -333,7 +334,12 @@ test_direct(void) HDassert(check); HDfree(check); - h5_cleanup(FILENAME, fapl); + h5_delete_test_file(FILENAME[1], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; + PASSED(); return 0; @@ -387,7 +393,8 @@ test_core(void) TESTING("CORE file driver"); /* Set property list and file name for CORE driver */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR; if(H5Pset_core_write_tracking(fapl, TRUE, CORE_PAGE_SIZE) < 0) @@ -558,14 +565,19 @@ test_core(void) TEST_ERROR; if(H5Dclose(dset1) < 0) TEST_ERROR; - if(H5Fclose(file) < 0) - TEST_ERROR; HDassert(points); HDfree(points); HDassert(check); HDfree(check); - h5_cleanup(FILENAME, fapl); + /* Close and delete the file */ + if(H5Fclose(file) < 0) + TEST_ERROR; + h5_delete_test_file(FILENAME[5], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; PASSED(); return 0; @@ -602,7 +614,7 @@ error: static herr_t test_family_opens(char *fname, hid_t fa_pl) { - hid_t file; + hid_t file=-1; char first_name[1024]; char wrong_name[1024]; int i; @@ -673,7 +685,7 @@ error: static herr_t test_family(void) { - hid_t file=(-1), fapl, fapl2=(-1), space=(-1), dset=(-1); + hid_t file=-1, fapl=-1, fapl2=-1, space=-1, dset=-1; hid_t access_fapl = -1; char filename[1024]; char dname[]="dataset"; @@ -686,11 +698,11 @@ test_family(void) TESTING("FAMILY file driver"); /* Set property list and file name for FAMILY driver */ - fapl = h5_fileaccess(); - + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; - h5_fixname(FILENAME[2], fapl, filename, sizeof filename); + h5_fixname(FILENAME[2], fapl, filename, sizeof(filename)); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -797,10 +809,15 @@ test_family(void) if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[2], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -808,7 +825,8 @@ error: H5E_BEGIN_TRY { H5Sclose(space); H5Dclose(dset); - H5Pclose (fapl2); + H5Pclose(fapl); + H5Pclose(fapl2); H5Fclose(file); } H5E_END_TRY; return -1; @@ -836,8 +854,8 @@ error: static herr_t test_family_compat(void) { - hid_t file = (-1), fapl; - hid_t dset; + hid_t file = -1, fapl = -1; + hid_t dset = -1; char dname[]="dataset"; char filename[1024]; char pathname[1024], pathname_individual[1024]; @@ -847,13 +865,13 @@ test_family_compat(void) TESTING("FAMILY file driver backward compatibility"); /* Set property list and file name for FAMILY driver */ - fapl = h5_fileaccess(); - + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT) < 0) TEST_ERROR; - h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof filename); - h5_fixname(FILENAME[3], fapl, newname, sizeof newname); + h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof(filename)); + h5_fixname(FILENAME[3], fapl, newname, sizeof(newname)); pathname[0] = '\0'; HDstrcat(pathname, filename); @@ -869,7 +887,7 @@ test_family_compat(void) counter++; HDsnprintf(newname_individual, sizeof(newname_individual), newname, counter); HDsnprintf(pathname_individual, sizeof(pathname_individual), pathname, counter); - } + } /* end while */ /* Make sure we can open the file. Use the read and write mode to flush the * superblock. */ @@ -895,10 +913,14 @@ test_family_compat(void) if(H5Dclose(dset) < 0) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[3], fapl); - h5_cleanup(FILENAME, fapl); + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; PASSED(); @@ -931,7 +953,7 @@ error: static herr_t test_multi_opens(char *fname) { - hid_t file; + hid_t file=-1; char super_name[1024]; /*name string "%%s-s.h5"*/ char sf_name[1024]; /*name string "multi_file-s.h5"*/ @@ -963,8 +985,8 @@ test_multi_opens(char *fname) static herr_t test_multi(void) { - hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); - hid_t root, attr, aspace, atype; + hid_t file=-1, fapl=-1, fapl2=-1, dset=-1, space=-1; + hid_t root=-1, attr=-1, aspace=-1, atype=-1; hid_t access_fapl = -1; char filename[1024]; int *fhandle2=NULL, *fhandle=NULL; @@ -982,14 +1004,16 @@ test_multi(void) int buf[MULTI_SIZE][MULTI_SIZE]; TESTING("MULTI file driver"); + /* Set file access property list for MULTI driver */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; - HDmemset(memb_map, 0, sizeof memb_map); - HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset(memb_name, 0, sizeof memb_name); - HDmemset(memb_addr, 0, sizeof memb_addr); - HDmemset(sv, 0, sizeof sv); + HDmemset(memb_map, 0, sizeof(memb_map)); + HDmemset(memb_fapl, 0, sizeof(memb_fapl)); + HDmemset(memb_name, 0, sizeof(memb_name)); + HDmemset(memb_addr, 0, sizeof(memb_addr)); + HDmemset(sv, 0, sizeof(sv)); for(mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; @@ -1106,7 +1130,7 @@ test_multi(void) /* Create and write attribute for the root group. */ if((root = H5Gopen2(file, "/", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + TEST_ERROR /* Attribute string. */ if((atype = H5Tcopy(H5T_C_S1)) < 0) @@ -1136,10 +1160,15 @@ test_multi(void) if(H5Aclose(attr) < 0) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[4], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -1179,7 +1208,7 @@ error: static herr_t test_multi_compat(void) { - hid_t file=(-1), fapl, dset=(-1), space=(-1); + hid_t file=-1, fapl=-1, dset=-1, space=-1; char newname[1024]; char filename_s[1024], newname_s[1024]; char filename_r[1024], newname_r[1024]; @@ -1195,7 +1224,8 @@ test_multi_compat(void) TESTING("MULTI file driver backward compatibility"); /* Set file access property list for MULTI driver */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; HDmemset(memb_map, 0, sizeof memb_map); HDmemset(memb_fapl, 0, sizeof memb_fapl); @@ -1303,10 +1333,15 @@ test_multi_compat(void) if(H5Dclose(dset) < 0) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[9], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -1350,7 +1385,8 @@ test_log(void) TESTING("LOG file driver"); /* Set property list and file name for log driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_log(fapl, LOG_FILENAME, flags, buf_size) < 0) TEST_ERROR; h5_fixname(FILENAME[6], fapl, filename, sizeof filename); @@ -1387,10 +1423,15 @@ test_log(void) if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[6], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -1429,7 +1470,8 @@ test_stdio(void) TESTING("STDIO file driver"); /* Set property list and file name for STDIO driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_stdio(fapl) < 0) TEST_ERROR; h5_fixname(FILENAME[7], fapl, filename, sizeof filename); @@ -1465,10 +1507,15 @@ test_stdio(void) if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[7], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -1519,7 +1566,8 @@ test_windows(void) #else /* H5_HAVE_WINDOWS */ /* Set property list and file name for WINDOWS driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_windows(fapl) < 0) TEST_ERROR; h5_fixname(FILENAME[8], fapl, filename, sizeof filename); @@ -1555,10 +1603,15 @@ test_windows(void) if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[8], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; |