diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2019-09-23 22:23:02 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2019-09-23 22:23:02 (GMT) |
commit | 35a9e9c50fbbab20ed920daa3daf903d82cd79d7 (patch) | |
tree | 90299be3be2ffe9eb0e53b530eca309d789ac6c0 /test | |
parent | 1070468dac5d0fd5e02b69514d7a0dfacfd28606 (diff) | |
parent | 7997eb8c84dd07dacbcc427049f838d883e263b8 (diff) | |
download | hdf5-35a9e9c50fbbab20ed920daa3daf903d82cd79d7.zip hdf5-35a9e9c50fbbab20ed920daa3daf903d82cd79d7.tar.gz hdf5-35a9e9c50fbbab20ed920daa3daf903d82cd79d7.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~jake.smith/hdf5 into bugfix/repack_external_storage
Diffstat (limited to 'test')
103 files changed, 30790 insertions, 23597 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9173531..8184d7f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -35,7 +35,7 @@ if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} - PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib> + PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib> ) if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") @@ -56,7 +56,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET} - PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib> + PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib> ) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib") @@ -242,6 +242,7 @@ set (H5_TESTS page_buffer dtypes dsets + chunk_info # compression lib link cmpd_dset filter_fail extend @@ -267,6 +268,9 @@ set (H5_TESTS enc_dec_plist_cross_platform getname vfd + ros3 + s3comms + hdfs ntypes dangle dtransform @@ -298,6 +302,7 @@ macro (ADD_H5_EXE file) endmacro () set (H5_TESTS_MULTIPLE + chunk_info direct_chunk testhdf5 cache_image @@ -314,6 +319,18 @@ endforeach () ### M U L T I P L E S O U R C E T E S T S ### ############################################################################## ######### Also special handling of link libs ############# +#-- Adding test for chunk_info +add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c) +target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (chunk_info STATIC) + target_link_libraries (chunk_info PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS}) +else () + TARGET_C_PROPERTIES (chunk_info SHARED) + target_link_libraries (chunk_info PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS}) +endif () +set_target_properties (chunk_info PROPERTIES FOLDER test) + #-- Adding test for direct_chunk add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") diff --git a/test/CMakePassthroughVOLTests.cmake b/test/CMakePassthroughVOLTests.cmake index 24a0201..e1b1f92 100644 --- a/test/CMakePassthroughVOLTests.cmake +++ b/test/CMakePassthroughVOLTests.cmake @@ -90,15 +90,9 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD if ("${voltest}" STREQUAL "flush1" OR "${voltest}" STREQUAL "flush2") if ("${volname}" STREQUAL "multi" OR "${volname}" STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug") - add_test ( - NAME VOL-${volname}-${voltest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${volname}/${volname}-${voltest}.out - ${volname}/${volname}-${voltest}.out.err - ) add_test (NAME VOL-${volname}-${voltest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${voltest}>" -D "TEST_ARGS:STRING=" -D "TEST_VOL:STRING=${volinfo}" @@ -108,7 +102,6 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/volTest.cmake" ) set_tests_properties (VOL-${volname}-${voltest} PROPERTIES - DEPENDS VOL-${volname}-${voltest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} ) @@ -118,15 +111,9 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD ) endif () else () - add_test ( - NAME VOL-${volname}-${voltest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${volname}/${volname}-${voltest}.out - ${volname}/${volname}-${voltest}.out.err - ) add_test (NAME VOL-${volname}-${voltest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${voltest}>" -D "TEST_ARGS:STRING=" -D "TEST_VOL:STRING=${volinfo}" @@ -136,21 +123,14 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/volTest.cmake" ) set_tests_properties (VOL-${volname}-${voltest} PROPERTIES - DEPENDS VOL-${volname}-${voltest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} ) endif () else () - add_test ( - NAME VOL-${volname}-${voltest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${volname}/${volname}-${voltest}.out - ${volname}/${volname}-${voltest}.out.err - ) add_test (NAME VOL-${volname}-${voltest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${voltest}>" -D "TEST_ARGS:STRING=" -D "TEST_VOL:STRING=${volinfo}" @@ -160,7 +140,6 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/volTest.cmake" ) set_tests_properties (VOL-${volname}-${voltest} PROPERTIES - DEPENDS VOL-${volname}-${voltest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} ) @@ -169,15 +148,9 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD macro (DO_VOL_TEST voltest volname volinfo resultcode) #message(STATUS "${voltest}-${volname} with ${volinfo}") - add_test ( - NAME VOL-${volname}-${voltest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${volname}/${volname}-${voltest}.out - ${volname}/${volname}-${voltest}.out.err - ) add_test (NAME VOL-${volname}-${voltest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${voltest}>" -D "TEST_ARGS:STRING=" -D "TEST_VOL:STRING=${volinfo}" @@ -187,7 +160,6 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/volTest.cmake" ) set_tests_properties (VOL-${volname}-${voltest} PROPERTIES - DEPENDS VOL-${volname}-${voltest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} ) @@ -212,15 +184,9 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD set_tests_properties (VOL-${volname}-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) endif () if (HDF5_TEST_FHEAP_PASSTHROUGH_VOL) - add_test ( - NAME VOL-${volname}-fheap-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${volname}/${volname}-fheap.out - ${volname}/${volname}-fheap.out.err - ) add_test (NAME VOL-${volname}-fheap COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:fheap>" -D "TEST_ARGS:STRING=" -D "TEST_VOL:STRING=${volinfo}" @@ -230,7 +196,6 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/volTest.cmake" ) set_tests_properties (VOL-${volname}-fheap PROPERTIES - DEPENDS VOL-${volname}-fheap-clear-objects TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 3d986d2..b7eaa56 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -198,33 +198,32 @@ set (testhdf5_CLEANFILES ) # Remove any output file left over from previous test run -add_test (NAME H5TEST-clear-testhdf5-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${testhdf5_CLEANFILES} - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST +add_test ( + NAME H5TEST-testhdf5-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-testhdf5-objects PROPERTIES FIXTURES_SETUP clear_testhdf5) +set_tests_properties (H5TEST-testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5) -add_test (NAME H5TEST-testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select) +add_test (NAME H5TEST-testhdf5-base COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -x heap -x file -x select) set_tests_properties (H5TEST-testhdf5-base PROPERTIES FIXTURES_REQUIRED clear_testhdf5 ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap) +add_test (NAME H5TEST-testhdf5-heap COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -o heap) set_tests_properties (H5TEST-testhdf5-heap PROPERTIES FIXTURES_REQUIRED clear_testhdf5 ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file) +add_test (NAME H5TEST-testhdf5-file COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -o file) set_tests_properties (H5TEST-testhdf5-file PROPERTIES FIXTURES_REQUIRED clear_testhdf5 ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select) +add_test (NAME H5TEST-testhdf5-select COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -o select) set_tests_properties (H5TEST-testhdf5-select PROPERTIES FIXTURES_REQUIRED clear_testhdf5 ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -445,20 +444,18 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 - tmp/vds_src_2.h5 + tmp_vds_env/vds_src_2.h5 direct_chunk.h5 native_vol_test.h5 ) # Remove any output file left over from previous test run -add_test (NAME H5TEST-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${test_CLEANFILES} - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST +add_test ( + NAME H5TEST-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP clear_objects) +set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP clear_H5TEST) set (H5TEST_SEPARATE_TESTS testhdf5 @@ -472,7 +469,7 @@ set (H5TEST_SEPARATE_TESTS foreach (h5_test ${H5_TESTS}) if (NOT h5_test IN_LIST H5TEST_SEPARATE_TESTS) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-${h5_test} COMMAND $<TARGET_FILE:${h5_test}>) + add_test (NAME H5TEST-${h5_test} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${h5_test}>) set_tests_properties (H5TEST-${h5_test} PROPERTIES FIXTURES_REQUIRED clear_objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -485,6 +482,7 @@ foreach (h5_test ${H5_TESTS}) ) else () add_test (NAME H5TEST-${h5_test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${h5_test}>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -497,7 +495,7 @@ foreach (h5_test ${H5_TESTS}) ) endif () set_tests_properties (H5TEST-${h5_test} PROPERTIES - FIXTURES_REQUIRED clear_objects + FIXTURES_REQUIRED clear_H5TEST ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -512,18 +510,17 @@ set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOU #-- Adding test for cache if (NOT CYGWIN) - add_test (NAME H5TEST-clear-cache-objects - COMMAND ${CMAKE_COMMAND} - -E remove - cache_test.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST + add_test ( + NAME H5TEST-cache-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove cache_test.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - set_tests_properties (H5TEST-clear-cache-objects PROPERTIES FIXTURES_SETUP cache_clear_objects) + set_tests_properties (H5TEST-cache-clear-objects PROPERTIES FIXTURES_SETUP clear_cache) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-cache COMMAND $<TARGET_FILE:cache>) + add_test (NAME H5TEST-cache COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache>) else () add_test (NAME H5TEST-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:cache>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -535,7 +532,7 @@ if (NOT CYGWIN) ) endif () set_tests_properties (H5TEST-cache PROPERTIES - FIXTURES_REQUIRED cache_clear_objects + FIXTURES_REQUIRED clear_cache ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -545,17 +542,14 @@ endif () if (TEST_CACHE_IMAGE) #-- Adding test for cache_image add_test ( - NAME H5TEST-clear-cache_image-objects - COMMAND ${CMAKE_COMMAND} - -E remove - cache_image_test.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST + NAME H5TEST-cache_image-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove cache_image_test.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - set_tests_properties (H5TEST-clear-cache_image-objects PROPERTIES FIXTURES_SETUP cache_image_clear_objects) - add_test (NAME H5TEST-cache_image COMMAND $<TARGET_FILE:cache_image>) + set_tests_properties (H5TEST-cache_image-clear-objects PROPERTIES FIXTURES_SETUP clear_cache_image) + add_test (NAME H5TEST_cache_image COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache_image>) set_tests_properties (H5TEST-cache_image PROPERTIES - FIXTURES_REQUIRED cache_image_clear_objects + FIXTURES_REQUIRED clear_cache_image ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -563,9 +557,8 @@ endif () #-- Adding test for external_env add_test ( - NAME H5TEST-clear-external_env-objects - COMMAND ${CMAKE_COMMAND} - -E remove + NAME H5TEST-external_env-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove extern_1r.raw extern_2r.raw extern_3r.raw @@ -574,16 +567,15 @@ add_test ( extern_2w.raw extern_3w.raw extern_4w.raw - external_env.txt - external_env.out WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-external_env-objects PROPERTIES FIXTURES_SETUP external_env_clear_objects) +set_tests_properties (H5TEST-external_env-clear-objects PROPERTIES FIXTURES_SETUP clear_external_env) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-external_env COMMAND $<TARGET_FILE:external_env>) + add_test (NAME H5TEST-external_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:external_env>) else () add_test (NAME H5TEST-external_env COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:external_env>" -D "TEST_ARGS:STRING=" -D "TEST_ENV_VAR:STRING=HDF5_EXTFILE_PREFIX" @@ -597,33 +589,31 @@ else () ) endif () set_tests_properties (H5TEST-external_env PROPERTIES - FIXTURES_REQUIRED external_env_clear_objects + FIXTURES_REQUIRED clear_external_env ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) #-- Adding test for vds_env add_test ( - NAME H5TEST-clear-vds_env-objects - COMMAND ${CMAKE_COMMAND} - -E remove + NAME H5TEST-vds_env-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove vds_virt_0.h5 vds_virt_3.h5 vds_src_2.h5 - vds_env.txt - vds_env.out WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-vds_env-objects PROPERTIES FIXTURES_SETUP vds_env_clear_objects) +set_tests_properties (H5TEST-vds_env-clear-objects PROPERTIES FIXTURES_SETUP clear_vds_env) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-vds_env COMMAND $<TARGET_FILE:vds_env>) + add_test (NAME H5TEST-vds_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:vds_env>) else () add_test (NAME H5TEST-vds_env COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:vds_env>" -D "TEST_ARGS:STRING=" -D "TEST_ENV_VAR:STRING=HDF5_VDS_PREFIX" - -D "TEST_ENV_VALUE:STRING=\${ORIGIN}/tmp" + -D "TEST_ENV_VALUE:STRING=\${ORIGIN}/tmp_vds_env" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" -D "TEST_OUTPUT=vds_env.txt" @@ -633,15 +623,14 @@ else () ) endif () set_tests_properties (H5TEST-vds_env PROPERTIES - FIXTURES_REQUIRED vds_env_clear_objects + FIXTURES_REQUIRED clear_vds_env ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) #-- Adding test for flush1/2 -add_test (NAME H5TEST-clear-flush-objects - COMMAND ${CMAKE_COMMAND} - -E remove +add_test (NAME H5TEST-flush-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove flush.h5 flush-swmr.h5 noflush.h5 @@ -653,10 +642,12 @@ add_test (NAME H5TEST-clear-flush-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) +set_tests_properties (H5TEST-flush-clear-objects PROPERTIES FIXTURES_SETUP clear_flush) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-flush1 COMMAND $<TARGET_FILE:flush1>) + add_test (NAME H5TEST-flush1 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:flush1>) else () add_test (NAME H5TEST-flush1 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:flush1>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -667,14 +658,15 @@ else () ) endif () set_tests_properties (H5TEST-flush1 PROPERTIES - DEPENDS H5TEST-clear-flush-objects + FIXTURES_REQUIRED clear_flush ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-flush2 COMMAND $<TARGET_FILE:flush2>) + add_test (NAME H5TEST-flush2 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:flush2>) else () add_test (NAME H5TEST-flush2 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:flush2>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -684,20 +676,23 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) +set_tests_properties (H5TEST-flush2 PROPERTIES + FIXTURES_REQUIRED clear_flush + DEPENDS H5TEST-flush1 +) #-- Adding test for tcheck_version -add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM") +add_test (NAME H5TEST-tcheck_version-major COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tM") set_tests_properties (H5TEST-tcheck_version-major PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST WILL_FAIL "true" ) -add_test (NAME H5TEST-tcheck_version-minor COMMAND $<TARGET_FILE:tcheck_version> "-tm") +add_test (NAME H5TEST-tcheck_version-minor COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tm") set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST WILL_FAIL "true" ) -add_test (NAME H5TEST-tcheck_version-release COMMAND $<TARGET_FILE:tcheck_version> "-tr") +add_test (NAME H5TEST-tcheck_version-release COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tr") set_tests_properties (H5TEST-tcheck_version-release PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST WILL_FAIL "true" @@ -737,50 +732,36 @@ set_tests_properties (H5TEST-tcheck_version-release PROPERTIES #-- Adding test for filenotclosed add_test ( - NAME H5TEST-clear-filenotclosed-objects - COMMAND ${CMAKE_COMMAND} - -E remove - filenotclosed.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST + NAME H5TEST-filenotclosed-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove filenotclosed.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-filenotclosed-objects PROPERTIES FIXTURES_SETUP filenotclosed_clear_objects) -add_test (NAME H5TEST-filenotclosed COMMAND $<TARGET_FILE:filenotclosed>) +set_tests_properties (H5TEST-filenotclosed-clear-objects PROPERTIES FIXTURES_SETUP clear_filenotclosed) +add_test (NAME H5TEST-filenotclosed COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:filenotclosed>) set_tests_properties (H5TEST-filenotclosed PROPERTIES - FIXTURES_REQUIRED filenotclosed_clear_objects + FIXTURES_REQUIRED clear_filenotclosed ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) #-- Adding test for del_many_dense_attrs add_test ( - NAME H5TEST-clear-del_many_dense_attrs-objects - COMMAND ${CMAKE_COMMAND} - -E remove - del_many_dense_attrs.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST + NAME H5TEST-del_many_dense_attrs-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove del_many_dense_attrs.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-del_many_dense_attrs-objects PROPERTIES FIXTURES_SETUP del_many_dense_attrs_clear_objects) -add_test (NAME H5TEST-del_many_dense_attrs COMMAND $<TARGET_FILE:del_many_dense_attrs>) +set_tests_properties (H5TEST-del_many_dense_attrs-clear-objects PROPERTIES FIXTURES_SETUP clear_del_many_dense_attrs) +add_test (NAME H5TEST-del_many_dense_attrs COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:del_many_dense_attrs>) set_tests_properties (H5TEST-del_many_dense_attrs PROPERTIES - FIXTURES_REQUIRED del_many_dense_attrs_clear_objects + FIXTURES_REQUIRED clear_del_many_dense_attrs ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) #-- Adding test for err_compat -if (HDF5_ENABLE_DEPRECATED_SYMBOLS) - add_test (NAME H5TEST-clear-err_compat-objects - COMMAND ${CMAKE_COMMAND} - -E remove - err_compat.txt - err_compat.txt.err - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST - ) - set_tests_properties (H5TEST-clear-err_compat-objects PROPERTIES FIXTURES_SETUP err_compat_clear_objects) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS AND NOT MINGW) add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -792,30 +773,49 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5TEST-err_compat PROPERTIES - FIXTURES_REQUIRED err_compat_clear_objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) +else () + add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "ERROR_APPEND=1" + -D "TEST_OUTPUT=err_compat.txt" + -D "TEST_REFERENCE=err_compat_2" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-err_compat PROPERTIES ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) endif () #-- Adding test for error_test -add_test (NAME H5TEST-clear-error_test-objects - COMMAND ${CMAKE_COMMAND} - -E remove - error_test.txt - error_test.txt.err - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST -) -set_tests_properties (H5TEST-clear-error_test-objects PROPERTIES FIXTURES_SETUP error_test_clear_objects) -if (HDF5_USE_16_API_DEFAULT) - add_test ( - NAME H5TEST-error_test - COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>" +if (DEFAULT_API_VERSION MATCHES "v16" OR MINGW) + add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:error_test>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "ERROR_APPEND=1" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_2" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-error_test PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - set_property(TEST H5TEST-error_test PROPERTY DISABLED) else () add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:error_test>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -827,33 +827,30 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5TEST-error_test PROPERTIES - FIXTURES_REQUIRED error_test_clear_objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) endif () #-- Adding test for links_env -add_test (NAME H5TEST-clear-links_env-objects - COMMAND ${CMAKE_COMMAND} - -E remove - links_env.txt - links_env.txt.err +add_test (NAME H5TEST-links_env-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove extlinks_env0.h5 extlinks_env1.h5 - tmp/extlinks_env1.h5 + tmp_links_env/extlinks_env1.h5 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set_tests_properties (H5TEST-clear-links_env-objects PROPERTIES FIXTURES_SETUP links_env_clear_objects) +set_tests_properties (H5TEST-links_env-clear-objects PROPERTIES FIXTURES_SETUP clear_links_env) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-links_env COMMAND $<TARGET_FILE:links_env>) + add_test (NAME H5TEST-links_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:links_env>) else () add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:links_env>" -D "TEST_ARGS:STRING=" #-D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX" - #-D "TEST_ENV_VALUE:STRING=.:tmp" + #-D "TEST_ENV_VALUE:STRING=.:tmp_links_env" -D "TEST_EXPECT=0" -D "TEST_OUTPUT=links_env.txt" -D "TEST_REFERENCE=links_env.out" @@ -862,8 +859,8 @@ else () ) endif () set_tests_properties (H5TEST-links_env PROPERTIES - FIXTURES_REQUIRED links_env_clear_objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_EXT_PREFIX=.:tmp" + FIXTURES_REQUIRED clear_links_env + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_EXT_PREFIX=.:tmp_links_env" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -885,7 +882,7 @@ endif () ### F I L T E R P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32) + if (WIN32 OR MINGW) set (CMAKE_SEP "\;") set (BIN_REL_PATH "../../") else () @@ -893,7 +890,7 @@ if (BUILD_SHARED_LIBS) set (BIN_REL_PATH "../") endif () - add_test (NAME H5PLUGIN-filter_plugin COMMAND $<TARGET_FILE:filter_plugin>) + add_test (NAME H5PLUGIN-filter_plugin COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:filter_plugin>) set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/filter_plugin_dir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/filter_plugin_dir2;srcdir=${HDF5_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} @@ -902,7 +899,7 @@ if (BUILD_SHARED_LIBS) ############################################################################## # HDFFV-9655 relative plugin test disabled # -# add_test (NAME H5PLUGIN-pluginRelative COMMAND $<TARGET_FILE:plugin>) +# add_test (NAME H5PLUGIN-pluginRelative COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:plugin>) # set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES # ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} @@ -910,10 +907,12 @@ if (BUILD_SHARED_LIBS) ############################################################################## endif () +option (TEST_SHELL_SCRIPTS "Enable shell script tests" OFF) if (TEST_SHELL_SCRIPTS) include (ShellTests.cmake) endif() +option (ENABLE_EXTENDED_TESTS "Enable extended tests" OFF) if (ENABLE_EXTENDED_TESTS) ############################################################################## ### S W M R T E S T S @@ -923,23 +922,20 @@ if (ENABLE_EXTENDED_TESTS) # testswmr.sh: swmr* # testvdsswmr.sh: vds_swmr* -# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND $<TARGET_FILE:swmr_check_compat_vfd>) +# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:swmr_check_compat_vfd>) #-- Adding test for flushrefresh file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") find_package (Perl) if (PERL_FOUND) - add_test (NAME H5TEST-clear-testflushrefresh-objects - COMMAND ${CMAKE_COMMAND} - -E remove - flushrefresh.txt - flushrefresh.txt.err - flushrefresh.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test + add_test ( + NAME H5TEST-testflushrefresh-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test ) - set_tests_properties (H5TEST-clear-testflushrefresh-objects PROPERTIES FIXTURES_SETUP testflushrefresh_clear_objects) + set_tests_properties (H5TEST-testflushrefresh-clear-objects PROPERTIES FIXTURES_SETUP clear_testflushrefresh) add_test (NAME H5TEST-testflushrefresh COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:flushrefresh>" -D "TEST_ARGS1:STRING=flushrefresh_VERIFICATION_START" -D "TEST_ARGS2:STRING=flushrefresh_VERIFICATION_DONE" @@ -953,7 +949,7 @@ if (ENABLE_EXTENDED_TESTS) -P "${HDF5_TEST_SOURCE_DIR}/flushrefreshTest.cmake" ) set_tests_properties (H5TEST-testflushrefresh PROPERTIES - FIXTURES_REQUIRED testflushrefresh_clear_objects + FIXTURES_REQUIRED clear_testflushrefresh ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test ) @@ -982,7 +978,7 @@ endif () ### V O L P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32) + if (WIN32 OR MINGW) set (CMAKE_SEP "\;") set (BIN_REL_PATH "../../") else () @@ -990,7 +986,7 @@ if (BUILD_SHARED_LIBS) set (BIN_REL_PATH "../") endif () - add_test (NAME H5PLUGIN-vol_plugin COMMAND $<TARGET_FILE:vol_plugin>) + add_test (NAME H5PLUGIN-vol_plugin COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:vol_plugin>) set_tests_properties (H5PLUGIN-vol_plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/null_vol_plugin_dir;srcdir=${HDF5_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 0ddce92..cf938f5 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -93,15 +93,9 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT HDF_CFG_NAME MATCHES "Debug") - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${vfdname}/${vfdname}-${vfdtest}.out - ${vfdname}/${vfdname}-${vfdtest}.out.err - ) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" @@ -111,7 +105,6 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) @@ -121,15 +114,9 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD ) endif () else () - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${vfdname}/${vfdname}-${vfdtest}.out - ${vfdname}/${vfdname}-${vfdtest}.out.err - ) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" @@ -139,21 +126,14 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) endif () else () - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${vfdname}/${vfdname}-${vfdtest}.out - ${vfdname}/${vfdname}-${vfdtest}.out.err - ) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" @@ -163,7 +143,6 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) @@ -171,15 +150,9 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD endmacro () macro (DO_VFD_TEST vfdtest vfdname resultcode) - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${vfdname}/${vfdname}-${vfdtest}.out - ${vfdname}/${vfdname}-${vfdtest}.out.err - ) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" @@ -189,7 +162,6 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) @@ -213,15 +185,9 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) endif () if (HDF5_TEST_FHEAP_VFD) - add_test ( - NAME VFD-${vfdname}-fheap-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${vfdname}/${vfdname}-fheap.out - ${vfdname}/${vfdname}-fheap.out.err - ) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:fheap>" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" @@ -231,7 +197,6 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-fheap PROPERTIES - DEPENDS VFD-${vfdname}-fheap-clear-objects TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} diff --git a/test/Makefile.am b/test/Makefile.am index 1b82aa4..a19079d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -58,12 +58,12 @@ TEST_PROG= testhdf5 \ cache cache_api cache_image cache_tagging lheap ohdr \ stab gheap evict_on_close farray earray btree2 fheap \ pool accum hyperslab istore bittests dt_arith page_buffer \ - dtypes dsets cmpd_dset filter_fail extend direct_chunk external efc \ - objcopy links unlink twriteorder big mtime fillval mount \ + dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \ + external efc objcopy links unlink twriteorder big mtime fillval mount \ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \ - enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \ - reserved cross_read freespace mf vds file_image unregister \ - cache_logging cork swmr vol + enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \ + dangle dtransform reserved cross_read freespace mf vds file_image \ + unregister cache_logging cork swmr vol # List programs to be built when testing here. # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. @@ -184,7 +184,8 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \ ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5\ - dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ + dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 \ + tmp tmp_links tmp2_links tmp_links_env tmp_vds_env \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ @@ -201,8 +202,8 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 farray_tmp.h5 \ - earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log \ - new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ + earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log log_ros3_out.log \ + log_s3comms_out.log new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \ vds_virt.h5 vds_dapl.h5 vds_src_[0-1].h5 \ diff --git a/test/accum.c b/test/accum.c index da90995..91acf0f 100644 --- a/test/accum.c +++ b/test/accum.c @@ -66,9 +66,9 @@ void accum_printf(const H5F_t *f); /* Private Test H5Faccum Function Wrappers */ #define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b)) #define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b)) -#define accum_free(f,a,s) H5F__accum_free(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) -#define accum_flush(f) H5F__accum_flush(f) -#define accum_reset(f) H5F__accum_reset(f, TRUE) +#define accum_free(f,a,s) H5F__accum_free(f->shared, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) +#define accum_flush(f) H5F__accum_flush(f->shared) +#define accum_reset(f) H5F__accum_reset(f->shared, TRUE) /* ================= */ /* Main Test Routine */ diff --git a/test/atomic_reader.c b/test/atomic_reader.c index 3e3a20a..5c1241f 100644 --- a/test/atomic_reader.c +++ b/test/atomic_reader.c @@ -55,7 +55,7 @@ int verify(int fd, unsigned int k); void print_info(int *info, unsigned int lastr, unsigned iteration); - + /*------------------------------------------------------------------------- * Function: usage * @@ -63,7 +63,7 @@ void print_info(int *info, unsigned int lastr, unsigned iteration); * * Parameters: None * - * Return: void + * Return: void * *------------------------------------------------------------------------- */ @@ -78,13 +78,13 @@ usage(void) printf("\n"); } /* usage() */ - + /*------------------------------------------------------------------------- * Function: verify * * Purpose: To verify that the data read is the pattern expected. * Each integer read should be the same as the index. - * When a difference is encountered, the remaining integers + * When a difference is encountered, the remaining integers * read should be the same as the previous index. * For example, the pattern expected should be either: * a) 01234567....n-1 @@ -93,11 +93,11 @@ usage(void) * the remaining integers should be all "3"s as: * 012333333333333 * - * Parameters: + * Parameters: * fd -- the file descriptor * k -- the number of integers to read * - * Return: + * Return: * positive on success * negative on failure * @@ -106,9 +106,9 @@ usage(void) int verify(int fd, unsigned int k) { - unsigned int i; /* local index variable */ - ssize_t bytes_read; /* the number of bytes read */ - unsigned int *buf = NULL; /* buffer to hold data read */ + unsigned int i; /* local index variable */ + ssize_t bytes_read; /* the number of bytes read */ + unsigned int *buf = NULL; /* buffer to hold data read */ /* Allocate buffer for data read */ if((buf = (unsigned int *)malloc(k * sizeof(unsigned int))) == NULL) { @@ -165,13 +165,13 @@ error: } /* end verify() */ - + /*------------------------------------------------------------------------- * Function: print_info * * Purpose: To print the statistics gathered for re-reads * - * Parameters: + * Parameters: * info -- the array storing the statistics for re-reads * lastr -- the last read completed * iteration -- the current iteration @@ -183,7 +183,7 @@ error: void print_info(int *info, unsigned int lastr, unsigned iteration) { - unsigned j; /* local index variable */ + unsigned j; /* local index variable */ printf("--------statistics for %u reads (iteration %u)--------\n", lastr, iteration); @@ -193,13 +193,13 @@ print_info(int *info, unsigned int lastr, unsigned iteration) printf("--------end statistics for %u reads (iteration %u)--------\n", lastr, iteration); } /* print_info() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: To verify that the data read is the pattern expected. - * (1) Make sure the file opens successfully and the # of bytes read is as expected - * (2) Iterate the reader with i iterations + * (1) Make sure the file opens successfully and the # of bytes read is as expected + * (2) Iterate the reader with i iterations * (3) Read and verify n integers for each iteration * (4) On verification error, re-read the data at most READ_TRIES * times to see if correct data can be obtained diff --git a/test/atomic_writer.c b/test/atomic_writer.c index 218d4da..b9ea03a 100644 --- a/test/atomic_writer.c +++ b/test/atomic_writer.c @@ -14,7 +14,7 @@ * * Created: atomic_writer.c * - * Purpose: This is the "writer" part of the standalone test to check + * Purpose: This is the "writer" part of the standalone test to check * atomic read-write operation on a system. * a) atomic_writer.c--the writer (this file) * b) atomic_reader.c--the reader @@ -53,7 +53,7 @@ static void usage(void); - + /*------------------------------------------------------------------------- * Function: usage * @@ -77,12 +77,12 @@ usage(void) } /* usage() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: To write a series of integers to a file for the reader to verify the data. - * A write is atomic if the whole amount written in one operation is not interleaved + * A write is atomic if the whole amount written in one operation is not interleaved * with data from any other process. * (1) Iterate with i iterations * (2) Write a series of integers (0 to n-1) to the file with this pattern: @@ -196,7 +196,7 @@ main(int argc, char *argv[]) printf("WRITER: error from lseek\n"); goto error; } /* end if */ - + /* Write the data */ if((bytes_wrote = write(fd, buf, ((num-n) * sizeof(unsigned int)))) < 0) { printf("WRITER: error from write\n"); diff --git a/test/bittests.c b/test/bittests.c index e29c188..046528a 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -895,13 +895,11 @@ test_clear (void) /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: - * - * Failure: + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Tuesday, June 16, 1998 @@ -911,7 +909,7 @@ test_clear (void) int main(void) { - int nerrors = 0; + int nerrors = 0; /* * Open the library explicitly. @@ -930,12 +928,12 @@ main(void) if(nerrors) { HDprintf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } HDprintf("All bit tests passed.\n"); H5close(); - return 0; -} + HDexit(EXIT_SUCCESS); +} /* end main() */ diff --git a/test/btree2.c b/test/btree2.c index 8d77438..c4c5530 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -20,7 +20,7 @@ * This file needs to access private datatypes from the H5B2 package. * This file also needs to access the v2 B-tree testing code. */ -#define H5B2_FRIEND /*suppress error about including H5B2pkg */ +#define H5B2_FRIEND /*suppress error about including H5B2pkg */ #define H5B2_TESTING #include "H5B2pkg.h" @@ -50,16 +50,16 @@ typedef struct bt2_test_param_t { hbool_t reopen_btree; /* Whether to re-open the B-tree during the test */ } bt2_test_param_t; - + /*------------------------------------------------------------------------- - * Function: init_cparam + * Function: init_cparam * - * Purpose: Initialize v2 B-tree creation parameter structure + * Purpose: Initialize v2 B-tree creation parameter structure * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 29, 2009 * *------------------------------------------------------------------------- @@ -90,16 +90,16 @@ init_cparam(H5B2_create_t *cparam, H5B2_create_t *cparam2) return(0); } /* init_cparam() */ - + /*------------------------------------------------------------------------- - * Function: create_file + * Function: create_file * - * Purpose: Perform common "creation" operations on file + * Purpose: Perform common "creation" operations on file * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 5, 2009 * *------------------------------------------------------------------------- @@ -107,7 +107,7 @@ init_cparam(H5B2_create_t *cparam, H5B2_create_t *cparam2) static int create_file(hid_t *file, H5F_t **f, hid_t fapl) { - char filename[1024]; /* Filename to use */ + char filename[1024]; /* Filename to use */ /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -131,16 +131,16 @@ error: return(-1); } /* end create_file() */ - + /*------------------------------------------------------------------------- - * Function: create_btree + * Function: create_btree * - * Purpose: Perform common "create" operations on B-tree for testing + * Purpose: Perform common "create" operations on B-tree for testing * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 5, 2009 * *------------------------------------------------------------------------- @@ -164,16 +164,16 @@ error: return(-1); } /* end create_btree() */ - + /*------------------------------------------------------------------------- - * Function: reopen_file + * Function: reopen_file * - * Purpose: Re-open the file + * Purpose: Re-open the file * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, December 28, 2015 * *------------------------------------------------------------------------- @@ -181,7 +181,7 @@ error: static int reopen_file(hid_t *file, H5F_t **f, hid_t fapl) { - char filename[1024]; /* Filename to use */ + char filename[1024]; /* Filename to use */ /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -205,16 +205,16 @@ error: return(-1); } /* end create_file() */ - + /*------------------------------------------------------------------------- - * Function: reopen_btree + * Function: reopen_btree * - * Purpose: Perform common "re-open" operations on B-tree for testing + * Purpose: Perform common "re-open" operations on B-tree for testing * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 5, 2009 * *------------------------------------------------------------------------- @@ -241,16 +241,16 @@ error: return(-1); } /* end reopen_btree() */ - + /*------------------------------------------------------------------------- - * Function: check_stats + * Function: check_stats * - * Purpose: Check statistics about v1 B-tree + * Purpose: Check statistics about v1 B-tree * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 5, 2009 * *------------------------------------------------------------------------- @@ -275,16 +275,16 @@ error: return(-1); } /* end check_stats() */ - + /*------------------------------------------------------------------------- - * Function: check_node_depth + * Function: check_node_depth * - * Purpose: Check the depth of the node containing a record + * Purpose: Check the depth of the node containing a record * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 5, 2009 * *------------------------------------------------------------------------- @@ -306,16 +306,16 @@ error: return(-1); } /* end check_node_depth() */ - + /*------------------------------------------------------------------------- - * Function: check_node_info + * Function: check_node_info * - * Purpose: Check the info of the node containing a record + * Purpose: Check the info of the node containing a record * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, November 6, 2009 * *------------------------------------------------------------------------- @@ -340,16 +340,16 @@ error: return(-1); } /* end check_node_info() */ - + /*------------------------------------------------------------------------- - * Function: iter_cb + * Function: iter_cb * - * Purpose: v2 B-tree iterator callback + * Purpose: v2 B-tree iterator callback * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, February 16, 2005 * *------------------------------------------------------------------------- @@ -367,16 +367,16 @@ iter_cb(const void *_record, void *_op_data) return(H5_ITER_CONT); } /* end iter_cb() */ - + /*------------------------------------------------------------------------- - * Function: iter_rec_cb + * Function: iter_rec_cb * - * Purpose: v2 B-tree iterator callback for H5B2_test_rec_t records + * Purpose: v2 B-tree iterator callback for H5B2_test_rec_t records * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 25, 2015 * *------------------------------------------------------------------------- @@ -397,16 +397,16 @@ iter_rec_cb(const void *_record, void *_op_data) return(H5_ITER_CONT); } /* end iter_rec_cb() */ - + /*------------------------------------------------------------------------- - * Function: find_cb + * Function: find_cb * - * Purpose: v2 B-tree find callback + * Purpose: v2 B-tree find callback * - * Return: Success: TRUE/FALSE - * Failure: FAIL + * Return: Success: TRUE/FALSE + * Failure: FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 24, 2005 * *------------------------------------------------------------------------- @@ -423,16 +423,16 @@ find_cb(const void *_record, void *_op_data) return(TRUE); } /* end find_cb() */ - + /*------------------------------------------------------------------------- - * Function: find_rec_cb + * Function: find_rec_cb * - * Purpose: v2 B-tree find callback for H5B2_test_rec_t records + * Purpose: v2 B-tree find callback for H5B2_test_rec_t records * - * Return: Success: TRUE/FALSE - * Failure: FAIL + * Return: Success: TRUE/FALSE + * Failure: FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 25, 2015 * *------------------------------------------------------------------------- @@ -450,18 +450,18 @@ find_rec_cb(const void *_record, void *_op_data) return(TRUE); } /* end find_rec_cb() */ - + /*------------------------------------------------------------------------- - * Function: find_dec_cb + * Function: find_dec_cb * - * Purpose: v2 B-tree find callback for indexing in decreasing order + * Purpose: v2 B-tree find callback for indexing in decreasing order * - * Note: Currently hard-wired to "insert_lots" test + * Note: Currently hard-wired to "insert_lots" test * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 7, 2006 * *------------------------------------------------------------------------- @@ -478,16 +478,16 @@ find_dec_cb(const void *_record, void *_op_data) return(0); } /* end find_dec_cb() */ - + /*------------------------------------------------------------------------- - * Function: index_rec_cb + * Function: index_rec_cb * - * Purpose: v2 B-tree index callback for H5B2_test_rec_t records + * Purpose: v2 B-tree index callback for H5B2_test_rec_t records * - * Return: Success: TRUE/FALSE - * Failure: FAIL + * Return: Success: TRUE/FALSE + * Failure: FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 25, 2015 * *------------------------------------------------------------------------- @@ -506,17 +506,17 @@ index_rec_cb(const void *_record, void *_op_data) return(TRUE); } /* end index_rec_cb() */ - + /*------------------------------------------------------------------------- - * Function: neighbor_cb + * Function: neighbor_cb * - * Purpose: v2 B-tree neighbor callback + * Purpose: v2 B-tree neighbor callback * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -532,17 +532,17 @@ neighbor_cb(const void *_record, void *_op_data) return(0); } /* end neighbor_cb() */ - + /*------------------------------------------------------------------------- - * Function: modify_cb + * Function: modify_cb * - * Purpose: v2 B-tree modify callback + * Purpose: v2 B-tree modify callback * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 10, 2005 * *------------------------------------------------------------------------- @@ -559,16 +559,16 @@ modify_cb(void *_record, void *_op_data, hbool_t *changed) return(0); } /* end modify_cb() */ - + /*------------------------------------------------------------------------- - * Function: modify_rec_cb + * Function: modify_rec_cb * - * Purpose: v2 B-tree modify callback for H5B2_test_rec_t records + * Purpose: v2 B-tree modify callback for H5B2_test_rec_t records * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 25, 2015 * *------------------------------------------------------------------------- @@ -586,17 +586,17 @@ modify_rec_cb(void *_record, void *_op_data, hbool_t *changed) return(0); } /* end modify_rec_cb() */ - + /*------------------------------------------------------------------------- - * Function: no_modify_cb + * Function: no_modify_cb * - * Purpose: v2 B-tree modify callback for updates which shouldn't change - * the record (ie. inserting not modifying) + * Purpose: v2 B-tree modify callback for updates which shouldn't change + * the record (ie. inserting not modifying) * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, December 23, 2015 * *------------------------------------------------------------------------- @@ -610,17 +610,17 @@ no_modify_cb(void H5_ATTR_UNUSED *_record, void H5_ATTR_UNUSED *_op_data, return(1); } /* end no_modify_cb() */ - + /*------------------------------------------------------------------------- - * Function: remove_cb + * Function: remove_cb * - * Purpose: v2 B-tree remove callback + * Purpose: v2 B-tree remove callback * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, August 8, 2006 * *------------------------------------------------------------------------- @@ -636,16 +636,16 @@ remove_cb(const void *_record, void *_op_data) return(0); } /* end remove_cb() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_basic + * Function: test_insert_basic * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 3, 2005 * *------------------------------------------------------------------------- @@ -654,8 +654,8 @@ static unsigned test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -702,7 +702,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index record in B-tree with no records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -746,7 +746,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in B-tree with 1 record */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -803,7 +803,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in B-tree with several records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -841,24 +841,24 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_insert_basic() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_split_root + * Function: test_insert_split_root * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It also continues to add a few more records to each of the * left and right leaf nodes after the split * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 3, 2005 * *------------------------------------------------------------------------- @@ -867,8 +867,8 @@ static unsigned test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -979,7 +979,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-1 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -1016,25 +1016,25 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_split_root() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level1_2leaf_redistrib + * Function: test_insert_level1_2leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * redistribution * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, February 8, 2005 * *------------------------------------------------------------------------- @@ -1043,8 +1043,8 @@ static unsigned test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1170,25 +1170,25 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level1_2leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level1_side_split + * Function: test_insert_level1_side_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * split, adding another node to the B-tree * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, February 9, 2005 * *------------------------------------------------------------------------- @@ -1197,8 +1197,8 @@ static unsigned test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1329,27 +1329,27 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level1_side_split() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level1_3leaf_redistrib + * Function: test_insert_level1_3leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * split, adding another node to the B-tree, then continues to * add records until a 3 node redistribution occurs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 10, 2005 * *------------------------------------------------------------------------- @@ -1358,8 +1358,8 @@ static unsigned test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1472,26 +1472,26 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level1_3leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level1_middle_split + * Function: test_insert_level1_middle_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * split, adding another node to the B-tree, then continues to * add records until a 3 node split occurs * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 10, 2005 * *------------------------------------------------------------------------- @@ -1500,8 +1500,8 @@ static unsigned test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1594,22 +1594,22 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level1_middle_split() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_make_level2 + * Function: test_insert_make_level2 * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 11, 2005 * *------------------------------------------------------------------------- @@ -1618,8 +1618,8 @@ static unsigned test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1735,7 +1735,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-2 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -1773,24 +1773,24 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_make_level2() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level2_leaf_redistrib + * Function: test_insert_level2_leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree and then adds enough more * records to force the leaves to redistribute * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 17, 2005 * *------------------------------------------------------------------------- @@ -1799,8 +1799,8 @@ static unsigned test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2001,24 +2001,24 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level2_leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level2_leaf_split + * Function: test_insert_level2_leaf_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree and then adds enough more * records to force leaves to split. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 17, 2005 * *------------------------------------------------------------------------- @@ -2027,8 +2027,8 @@ static unsigned test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2233,25 +2233,25 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level2_leaf_split() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level2_2internal_redistrib + * Function: test_insert_level2_2internal_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree and then adds enough more * records to force the left-most and right-most internal nodes to * redistribute. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 18, 2005 * *------------------------------------------------------------------------- @@ -2260,8 +2260,8 @@ static unsigned test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2404,25 +2404,25 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level2_2internal_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level2_2internal_split + * Function: test_insert_level2_2internal_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree and then adds enough more * records to force the left-most and right-most internal nodes to * split. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 18, 2005 * *------------------------------------------------------------------------- @@ -2431,8 +2431,8 @@ static unsigned test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2581,26 +2581,26 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level2_2internal_split() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level2_3internal_redistrib + * Function: test_insert_level2_3internal_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree and then adds enough more * records to force the left-most and right-most internal nodes to * split and more records to force a 3 node redistribution of the * internal nodes. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, February 19, 2005 * *------------------------------------------------------------------------- @@ -2609,8 +2609,8 @@ static unsigned test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2758,26 +2758,26 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level2_3internal_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_level2_3internal_split + * Function: test_insert_level2_3internal_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree and then adds enough more * records to force the left-most and right-most internal nodes to * split and more records to force a 3->4 node split of the * internal nodes. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, February 19, 2005 * *------------------------------------------------------------------------- @@ -2786,8 +2786,8 @@ static unsigned test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2939,23 +2939,23 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_insert_level2_3internal_split() */ - + /*------------------------------------------------------------------------- - * Function: test_insert_lots + * Function: test_insert_lots * - * Purpose: Basic tests for the B-tree v2 code. This test inserts many + * Purpose: Basic tests for the B-tree v2 code. This test inserts many * records in random order, enough to make at a level 4 B-tree. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, February 19, 2005 * *------------------------------------------------------------------------- @@ -2964,9 +2964,9 @@ static unsigned test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[1024]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -3099,13 +3099,13 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3170,22 +3170,22 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; HDfree(records); return 1; } /* test_insert_lots() */ - + /*------------------------------------------------------------------------- - * Function: test_update_basic + * Function: test_update_basic * - * Purpose: Basic tests for the v2 B-tree update operation + * Purpose: Basic tests for the v2 B-tree update operation * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, December 23, 2015 * *------------------------------------------------------------------------- @@ -3194,8 +3194,8 @@ static unsigned test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3257,7 +3257,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in B-tree with 1 record */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3321,7 +3321,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in B-tree with 1 record */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3391,7 +3391,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in B-tree with several records */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3478,7 +3478,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in B-tree with several records */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3537,24 +3537,24 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_update_basic() */ - + /*------------------------------------------------------------------------- - * Function: test_update_split_root + * Function: test_update_split_root * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It also continues to add a few more records to each of the * left and right leaf nodes after the split * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, December 23, 2015 * *------------------------------------------------------------------------- @@ -3563,8 +3563,8 @@ static unsigned test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3736,7 +3736,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-1 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3788,25 +3788,25 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_update_split_root() */ - + /*------------------------------------------------------------------------- - * Function: test_update_level1_2leaf_redistrib + * Function: test_update_level1_2leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * redistribution * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, December 26, 2015 * *------------------------------------------------------------------------- @@ -3815,8 +3815,8 @@ static unsigned test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3946,25 +3946,25 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_update_level1_2leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_update_level1_side_split + * Function: test_update_level1_side_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * split, adding another node to the B-tree * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, December 26, 2015 * *------------------------------------------------------------------------- @@ -3973,8 +3973,8 @@ static unsigned test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4109,27 +4109,27 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_update_level1_side_split() */ - + /*------------------------------------------------------------------------- - * Function: test_update_level1_3leaf_redistrib + * Function: test_update_level1_3leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * split, adding another node to the B-tree, then continues to * add records until a 3 node redistribution occurs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, December 26, 2015 * *------------------------------------------------------------------------- @@ -4138,8 +4138,8 @@ static unsigned test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4256,26 +4256,26 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_update_level1_3leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_update_level1_middle_split + * Function: test_update_level1_middle_split * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to split the root node and force the tree to depth 1. * It continues to add a more records to the each of the * left and right leaf nodes after the split to force a 2 node * split, adding another node to the B-tree, then continues to * add records until a 3 node split occurs * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, December 26, 2015 * *------------------------------------------------------------------------- @@ -4284,8 +4284,8 @@ static unsigned test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4381,22 +4381,22 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_update_level1_middle_split() */ - + /*------------------------------------------------------------------------- - * Function: test_update_make_level2 + * Function: test_update_make_level2 * - * Purpose: Basic tests for the B-tree v2 code. This test inserts enough + * Purpose: Basic tests for the B-tree v2 code. This test inserts enough * records to make a level 2 B-tree * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, December 26, 2015 * *------------------------------------------------------------------------- @@ -4405,8 +4405,8 @@ static unsigned test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4541,7 +4541,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4706,7 +4706,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4881,7 +4881,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4934,22 +4934,22 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_update_make_level2() */ - + /*------------------------------------------------------------------------- - * Function: test_update_lots + * Function: test_update_lots * - * Purpose: Basic tests for the B-tree v2 code. This test inserts many + * Purpose: Basic tests for the B-tree v2 code. This test inserts many * records in random order, enough to make at a level 4 B-tree. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 27, 2015 * *------------------------------------------------------------------------- @@ -4958,8 +4958,8 @@ static unsigned test_update_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ time_t curr_time; /* Current time, for seeding random number generator */ @@ -5086,13 +5086,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5174,23 +5174,23 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; HDfree(records); return 1; } /* test_update_lots() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_basic + * Function: test_remove_basic * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 25, 2005 * *------------------------------------------------------------------------- @@ -5199,8 +5199,8 @@ static unsigned test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5231,7 +5231,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a record from a B-tree with no records */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5351,7 +5351,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5483,21 +5483,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_basic() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_noredistrib + * Function: test_remove_level1_noredistrib * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 25, 2005 * *------------------------------------------------------------------------- @@ -5506,8 +5506,8 @@ static unsigned test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5554,7 +5554,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = (INSERT_SPLIT_ROOT_NREC * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5705,21 +5705,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_noredistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_redistrib + * Function: test_remove_level1_redistrib * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -5728,8 +5728,8 @@ static unsigned test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5901,21 +5901,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_2leaf_merge + * Function: test_remove_level1_2leaf_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -5924,8 +5924,8 @@ static unsigned test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6079,21 +6079,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_2leaf_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_3leaf_merge + * Function: test_remove_level1_3leaf_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -6102,8 +6102,8 @@ static unsigned test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6204,21 +6204,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_3leaf_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_promote + * Function: test_remove_level1_promote * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -6227,8 +6227,8 @@ static unsigned test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6430,21 +6430,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_promote() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_promote_2leaf_redistrib + * Function: test_remove_level1_promote_2leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -6453,8 +6453,8 @@ static unsigned test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6577,21 +6577,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_promote_2leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_promote_3leaf_redistrib + * Function: test_remove_level1_promote_3leaf_redistrib * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -6600,8 +6600,8 @@ static unsigned test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6724,21 +6724,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_promote_3leaf_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_promote_2leaf_merge + * Function: test_remove_level1_promote_2leaf_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -6747,8 +6747,8 @@ static unsigned test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6868,21 +6868,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_promote_2leaf_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_promote_3leaf_merge + * Function: test_remove_level1_promote_3leaf_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -6891,8 +6891,8 @@ static unsigned test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7012,21 +7012,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_promote_3leaf_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level1_collapse + * Function: test_remove_level1_collapse * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -7035,8 +7035,8 @@ static unsigned test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7150,21 +7150,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level1_collapse() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_promote + * Function: test_remove_level2_promote * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 4, 2005 * *------------------------------------------------------------------------- @@ -7173,8 +7173,8 @@ static unsigned test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7435,21 +7435,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_promote() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_promote_2internal_redistrib + * Function: test_remove_level2_promote_2internal_redistrib * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 7, 2005 * *------------------------------------------------------------------------- @@ -7458,8 +7458,8 @@ static unsigned test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7584,21 +7584,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_promote_2internal_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_3promote_internal_redistrib + * Function: test_remove_level2_3promote_internal_redistrib * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 7, 2005 * *------------------------------------------------------------------------- @@ -7607,8 +7607,8 @@ static unsigned test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7733,21 +7733,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_promote_3internal_redistrib() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_promote_2internal_merge + * Function: test_remove_level2_promote_2internal_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 7, 2005 * *------------------------------------------------------------------------- @@ -7756,8 +7756,8 @@ static unsigned test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7883,21 +7883,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_promote_2internal_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_3promote_internal_merge + * Function: test_remove_level2_3promote_internal_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 7, 2005 * *------------------------------------------------------------------------- @@ -7906,8 +7906,8 @@ static unsigned test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8033,21 +8033,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_promote_3internal_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_2internal_merge_left + * Function: test_remove_level2_2internal_merge_left * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -8056,8 +8056,8 @@ static unsigned test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8158,21 +8158,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_2internal_merge_left() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_2internal_merge_right + * Function: test_remove_level2_2internal_merge_right * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -8181,8 +8181,8 @@ static unsigned test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8283,21 +8283,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_2internal_merge_right() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_3internal_merge + * Function: test_remove_level2_3internal_merge * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -8306,8 +8306,8 @@ static unsigned test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8408,21 +8408,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_3internal_merge() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_level2_collapse_right + * Function: test_remove_level2_collapse_right * - * Purpose: Basic tests for the B-tree v2 code + * Purpose: Basic tests for the B-tree v2 code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -8431,8 +8431,8 @@ static unsigned test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8533,21 +8533,21 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_remove_level2_collapse_right() */ - + /*------------------------------------------------------------------------- - * Function: gen_l4_btree2 + * Function: gen_l4_btree2 * - * Purpose: Generate a level-4 v2 B-tree for testing. + * Purpose: Generate a level-4 v2 B-tree for testing. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 14, 2008 * *------------------------------------------------------------------------- @@ -8556,8 +8556,8 @@ static unsigned gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, haddr_t *bt2_addr, const hsize_t *records) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ hsize_t record; /* Record to insert into tree */ unsigned u; /* Local index variable */ @@ -8607,24 +8607,24 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* gen_l4_btree2() */ - + /*------------------------------------------------------------------------- - * Function: test_remove_lots + * Function: test_remove_lots * - * Purpose: Basic tests for the B-tree v2 code. This test inserts many + * Purpose: Basic tests for the B-tree v2 code. This test inserts many * records in random order, enough to make at a level 4 B-tree * and then removes them all, by record and by index. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -8632,11 +8632,11 @@ error: static unsigned test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cparam) { - hid_t file = -1; /* File ID */ - char filename[1024]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ int fd = -1; /* File descriptor */ - h5_stat_t sb; /* Stat buffer for file */ + h5_stat_t sb; /* Stat buffer for file */ void *file_data = NULL; /* Copy of file data */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ @@ -9051,7 +9051,7 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(fd > 0) @@ -9064,17 +9064,17 @@ error: return 1; } /* test_remove_lots() */ - + /*------------------------------------------------------------------------- - * Function: test_find_neighbor + * Function: test_find_neighbor * - * Purpose: Basic tests for the B-tree v2 code. This test exercises + * Purpose: Basic tests for the B-tree v2 code. This test exercises * code to find nearest neighbors to a given value in a B-tree. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * *------------------------------------------------------------------------- @@ -9083,8 +9083,8 @@ static unsigned test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9125,7 +9125,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find record B-tree less than a value */ search = 0; H5E_BEGIN_TRY { - ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9203,7 +9203,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find record B-tree less than a value */ search = (FIND_NEIGHBOR * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9279,23 +9279,23 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; HDfree(records); return 1; } /* test_find_neighbor() */ - + /*------------------------------------------------------------------------- - * Function: test_delete + * Function: test_delete * - * Purpose: Basic tests for the B-tree v2 code. This test exercises + * Purpose: Basic tests for the B-tree v2 code. This test exercises * code to delete a B-tree from a file * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, March 9, 2005 * *------------------------------------------------------------------------- @@ -9303,9 +9303,9 @@ error: static unsigned test_delete(hid_t fapl, const H5B2_create_t *cparam) { - hid_t file = -1; /* File ID */ - char filename[1024]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ @@ -9551,22 +9551,22 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_delete() */ - + /*------------------------------------------------------------------------- - * Function: test_modify + * Function: test_modify * - * Purpose: Basic tests for the B-tree v2 code. This test exercises + * Purpose: Basic tests for the B-tree v2 code. This test exercises * code to modify an existing record in the B-tree * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, March 10, 2005 * *------------------------------------------------------------------------- @@ -9575,8 +9575,8 @@ static unsigned test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9617,7 +9617,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 3; modify = 4; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9663,7 +9663,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 4330; found = HSIZET_MAX; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9709,7 +9709,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 5350; found = 5350; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9755,7 +9755,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 9445; found = 9445; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9778,23 +9778,23 @@ error: H5E_BEGIN_TRY { if(bt2) H5B2_close(bt2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_modify() */ - + /*------------------------------------------------------------------------- - * Function: test_open_twice_diff + * Function: test_open_twice_diff * - * Purpose: Open a v2 B-tree twice, through different "top" file + * Purpose: Open a v2 B-tree twice, through different "top" file * handles, with an intermediate file open that takes the "shared" * file handle from the first B-tree's file pointer. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 18, 2015 * *------------------------------------------------------------------------- @@ -9802,14 +9802,14 @@ error: static unsigned test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) { - char filename[1024]; /* Filename to use */ + char filename[1024]; /* Filename to use */ char filename_tmp[1024]; /* Temporary file name */ - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - hid_t file0 = -1; /* File ID */ - hid_t file00 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t file2 = -1; /* File ID */ + hid_t file0 = -1; /* File ID */ + hid_t file00 = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ @@ -9914,25 +9914,25 @@ error: H5B2_close(bt2); if(bt2) H5B2_close(bt2_2); - H5Fclose(file); - H5Fclose(file2); - H5Fclose(file0); - H5Fclose(file00); + H5Fclose(file); + H5Fclose(file2); + H5Fclose(file0); + H5Fclose(file00); } H5E_END_TRY; return(1); } /* test_open_twice_diff() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test the B-tree v2 code + * Purpose: Test the B-tree v2 code * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, February 1, 2005 * *------------------------------------------------------------------------- @@ -9942,10 +9942,10 @@ main(void) { H5B2_create_t cparam, cparam2; /* Creation parameters for v2 B-tree */ bt2_test_param_t tparam; /* Test parameters for v2 B-tree */ - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ + hid_t fapl = -1; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ unsigned reopen; /* Whether to reopen B-tree during tests */ - int ExpressMode; + int ExpressMode; const char *envval = NULL; hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ @@ -9958,7 +9958,7 @@ main(void) fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); /* Initialize v2 B-tree creation parameters */ init_cparam(&cparam, &cparam2); @@ -9970,11 +9970,11 @@ main(void) /* Loop over re-opening B-tree during tests */ for(reopen = FALSE; reopen <= TRUE; reopen++) { if(reopen) { - fprintf(stdout, "Testing with reopening B-tree:\n"); + HDfprintf(stdout, "Testing with reopening B-tree:\n"); tparam.reopen_btree = TRUE; } /* end if */ else { - fprintf(stdout, "Testing without reopening B-tree:\n"); + HDfprintf(stdout, "Testing without reopening B-tree:\n"); tparam.reopen_btree = FALSE; } /* end else */ @@ -9994,7 +9994,7 @@ main(void) nerrors += test_insert_level2_3internal_redistrib(fapl, &cparam, &tparam); nerrors += test_insert_level2_3internal_split(fapl, &cparam, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. test_insert_lots skipped\n"); + HDprintf("***Express test mode on. test_insert_lots skipped\n"); else nerrors += test_insert_lots(fapl, &cparam, &tparam); @@ -10008,7 +10008,7 @@ main(void) nerrors += test_update_level1_middle_split(fapl, &cparam2, &tparam); nerrors += test_update_make_level2(fapl, &cparam2, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. test_update_lots skipped\n"); + HDprintf("***Express test mode on. test_update_lots skipped\n"); else nerrors += test_update_lots(fapl, &cparam2, &tparam); @@ -10035,7 +10035,7 @@ main(void) nerrors += test_remove_level2_3internal_merge(fapl, &cparam, &tparam); nerrors += test_remove_level2_collapse_right(fapl, &cparam, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. test_remove_lots skipped\n"); + HDprintf("***Express test mode on. test_remove_lots skipped\n"); else nerrors += test_remove_lots(envval, fapl, &cparam); diff --git a/test/cache.c b/test/cache.c index d5e3c6c..1a726fa 100644 --- a/test/cache.c +++ b/test/cache.c @@ -14,85 +14,85 @@ /* Programmer: John Mainzer * 6/9/04 * - * This file contains tests for the cache implemented in - * H5C.c + * This file contains tests for the cache implemented in + * H5C.c */ #include "cache_common.h" - + /* private typedef declarations: */ struct flush_cache_test_spec { - int entry_num; - int entry_type; - int entry_index; - hbool_t insert_flag; - unsigned int flags; - hbool_t expected_deserialized; - hbool_t expected_serialized; - hbool_t expected_destroyed; + int entry_num; + int entry_type; + int entry_index; + hbool_t insert_flag; + unsigned int flags; + hbool_t expected_deserialized; + hbool_t expected_serialized; + hbool_t expected_destroyed; }; struct pe_flush_cache_test_spec { - int entry_num; - int entry_type; - int entry_index; - hbool_t insert_flag; - unsigned int flags; - int num_pins; - int pin_type[MAX_PINS]; - int pin_idx[MAX_PINS]; - hbool_t expected_deserialized; - hbool_t expected_serialized; - hbool_t expected_destroyed; + int entry_num; + int entry_type; + int entry_index; + hbool_t insert_flag; + unsigned int flags; + int num_pins; + int pin_type[MAX_PINS]; + int pin_idx[MAX_PINS]; + hbool_t expected_deserialized; + hbool_t expected_serialized; + hbool_t expected_destroyed; }; struct fo_flush_entry_check { - int entry_num; - int entry_type; - int entry_index; - size_t expected_size; - hbool_t in_cache; - hbool_t at_main_addr; - hbool_t is_dirty; - hbool_t is_protected; - hbool_t is_pinned; - hbool_t expected_deserialized; - hbool_t expected_serialized; - hbool_t expected_destroyed; + int entry_num; + int entry_type; + int entry_index; + size_t expected_size; + hbool_t in_cache; + hbool_t at_main_addr; + hbool_t is_dirty; + hbool_t is_protected; + hbool_t is_pinned; + hbool_t expected_deserialized; + hbool_t expected_serialized; + hbool_t expected_destroyed; }; struct fo_flush_cache_test_spec { - int entry_num; - int entry_type; - int entry_index; - hbool_t insert_flag; - unsigned int flags; - hbool_t resize_flag; - size_t new_size; - int num_pins; - int pin_type[MAX_PINS]; - int pin_idx[MAX_PINS]; - int num_flush_ops; - struct flush_op flush_ops[MAX_FLUSH_OPS]; - hbool_t expected_deserialized; - hbool_t expected_serialized; - hbool_t expected_destroyed; + int entry_num; + int entry_type; + int entry_index; + hbool_t insert_flag; + unsigned int flags; + hbool_t resize_flag; + size_t new_size; + int num_pins; + int pin_type[MAX_PINS]; + int pin_idx[MAX_PINS]; + int num_flush_ops; + struct flush_op flush_ops[MAX_FLUSH_OPS]; + hbool_t expected_deserialized; + hbool_t expected_serialized; + hbool_t expected_destroyed; }; struct move_entry_test_spec { - int entry_type; - int entry_index; - hbool_t is_pinned; + int entry_type; + int entry_index; + hbool_t is_pinned; hbool_t is_protected; }; - + /* private function declarations: */ static unsigned smoke_check_1(int express_test, unsigned paged); @@ -136,7 +136,7 @@ static void check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int entry_type, int entry_idx, hbool_t unprot_dirty_flag, - hbool_t mark_dirty, + hbool_t mark_dirty, hbool_t pop_mark_dirty_prot, hbool_t pop_mark_dirty_pinned, hbool_t unprotect_unpin, @@ -150,11 +150,11 @@ static void check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - unsigned init_expected_index_len, - size_t init_expected_index_size, - unsigned expected_index_len, - size_t expected_index_size, - int check_size, + unsigned init_expected_index_len, + size_t init_expected_index_size, + unsigned expected_index_len, + size_t expected_index_size, + int check_size, struct fo_flush_entry_check check[]); static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr); static unsigned check_get_entry_status(unsigned paged); @@ -204,7 +204,7 @@ static unsigned check_stats(unsigned paged); static void check_stats__smoke_check_1(H5F_t * file_ptr); #endif /* H5C_COLLECT_CACHE_STATS */ - + /**************************************************************************/ /**************************************************************************/ /********************************* tests: *********************************/ @@ -212,15 +212,15 @@ static void check_stats__smoke_check_1(H5F_t * file_ptr); /**************************************************************************/ /*------------------------------------------------------------------------- - * Function: smoke_check_1() + * Function: smoke_check_1() * - * Purpose: A basic functional test, inserts, destroys, and moves in + * Purpose: A basic functional test, inserts, destroys, and moves in * the mix, along with repeated protects and unprotects. - * All entries are marked as clean. + * All entries are marked as clean. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/16/04 * *------------------------------------------------------------------------- @@ -251,23 +251,23 @@ smoke_check_1(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -289,7 +289,7 @@ smoke_check_1(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -299,7 +299,7 @@ smoke_check_1(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -318,7 +318,7 @@ smoke_check_1(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -327,7 +327,7 @@ smoke_check_1(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -337,7 +337,7 @@ smoke_check_1(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -357,7 +357,7 @@ smoke_check_1(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -382,7 +382,7 @@ smoke_check_1(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -416,18 +416,18 @@ smoke_check_1(int express_test, unsigned paged) } /* smoke_check_1() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_2() + * Function: smoke_check_2() * - * Purpose: A basic functional test, with inserts, destroys, and - * moves in the mix, along with some repeated protects - * and unprotects. About half the entries are marked as - * dirty. + * Purpose: A basic functional test, with inserts, destroys, and + * moves in the mix, along with some repeated protects + * and unprotects. About half the entries are marked as + * dirty. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * *------------------------------------------------------------------------- @@ -458,23 +458,23 @@ smoke_check_2(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -496,7 +496,7 @@ smoke_check_2(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -506,7 +506,7 @@ smoke_check_2(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -525,7 +525,7 @@ smoke_check_2(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -534,7 +534,7 @@ smoke_check_2(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -544,7 +544,7 @@ smoke_check_2(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -564,7 +564,7 @@ smoke_check_2(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -589,7 +589,7 @@ smoke_check_2(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -623,17 +623,17 @@ smoke_check_2(int express_test, unsigned paged) } /* smoke_check_2() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_3() + * Function: smoke_check_3() * - * Purpose: A basic functional test on a tiny cache, with inserts, - * destroys, and moves in the mix, along with repeated - * protects and unprotects. All entries are marked as clean. + * Purpose: A basic functional test on a tiny cache, with inserts, + * destroys, and moves in the mix, along with repeated + * protects and unprotects. All entries are marked as clean. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/16/04 * *------------------------------------------------------------------------- @@ -664,23 +664,23 @@ smoke_check_3(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -702,7 +702,7 @@ smoke_check_3(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -712,7 +712,7 @@ smoke_check_3(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -731,7 +731,7 @@ smoke_check_3(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -740,7 +740,7 @@ smoke_check_3(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -750,7 +750,7 @@ smoke_check_3(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -770,7 +770,7 @@ smoke_check_3(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -795,7 +795,7 @@ smoke_check_3(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -829,18 +829,18 @@ smoke_check_3(int express_test, unsigned paged) } /* smoke_check_3() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_4() + * Function: smoke_check_4() * - * Purpose: A basic functional test on a tiny cache, with inserts, - * destroys, and moves in the mix, along with repeated - * protects and unprotects. About half the entries are - * marked as dirty. + * Purpose: A basic functional test on a tiny cache, with inserts, + * destroys, and moves in the mix, along with repeated + * protects and unprotects. About half the entries are + * marked as dirty. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * *------------------------------------------------------------------------- @@ -871,23 +871,23 @@ smoke_check_4(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -909,7 +909,7 @@ smoke_check_4(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -919,7 +919,7 @@ smoke_check_4(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -938,7 +938,7 @@ smoke_check_4(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -947,7 +947,7 @@ smoke_check_4(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -957,7 +957,7 @@ smoke_check_4(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -977,7 +977,7 @@ smoke_check_4(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1002,7 +1002,7 @@ smoke_check_4(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1036,18 +1036,18 @@ smoke_check_4(int express_test, unsigned paged) } /* smoke_check_4() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_5() + * Function: smoke_check_5() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with - * repeated protects and unprotects. All entries are marked - * as clean. + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with + * repeated protects and unprotects. All entries are marked + * as clean. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/14/04 * *------------------------------------------------------------------------- @@ -1093,9 +1093,9 @@ smoke_check_5(int express_test, unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, @@ -1126,23 +1126,23 @@ smoke_check_5(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1280,18 +1280,18 @@ smoke_check_5(int express_test, unsigned paged) } /* smoke_check_5() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_6() + * Function: smoke_check_6() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with * repeated protects and unprotects. About one half of all - * entries are marked as dirty. + * entries are marked as dirty. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/25/04 * *------------------------------------------------------------------------- @@ -1337,9 +1337,9 @@ smoke_check_6(int express_test, unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, @@ -1372,23 +1372,23 @@ smoke_check_6(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } if(show_progress) /* 1 */ @@ -1524,18 +1524,18 @@ smoke_check_6(int express_test, unsigned paged) } /* smoke_check_6() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_7() + * Function: smoke_check_7() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with - * repeated protects and unprotects. All entries are marked - * as clean. + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with + * repeated protects and unprotects. All entries are marked + * as clean. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 12/2/04 * *------------------------------------------------------------------------- @@ -1581,9 +1581,9 @@ smoke_check_7(int express_test, unsigned paged) /* size_t max_increment = */ (8 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ @@ -1615,23 +1615,23 @@ smoke_check_7(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1769,18 +1769,18 @@ smoke_check_7(int express_test, unsigned paged) } /* smoke_check_7() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_8() + * Function: smoke_check_8() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with * repeated protects and unprotects. About one half of all - * entries are marked as dirty. + * entries are marked as dirty. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/25/04 * *------------------------------------------------------------------------- @@ -1826,9 +1826,9 @@ smoke_check_8(int express_test, unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ @@ -1860,23 +1860,23 @@ smoke_check_8(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -2014,26 +2014,26 @@ smoke_check_8(int express_test, unsigned paged) } /* smoke_check_8() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_9() + * Function: smoke_check_9() * - * Purpose: A repeat of smoke check 1, only with the cache corked - * part of the time. + * Purpose: A repeat of smoke check 1, only with the cache corked + * part of the time. * - * Recall that smoke check 1 is a basic functional test, - * with inserts, destroys, and moves in the mix, along - * with repeated protects and unprotects. All entries are - * marked as clean. + * Recall that smoke check 1 is a basic functional test, + * with inserts, destroys, and moves in the mix, along + * with repeated protects and unprotects. All entries are + * marked as clean. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/1/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -2066,23 +2066,23 @@ smoke_check_9(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -2113,8 +2113,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 1.\n"; - } + failure_mssg = "can't disable evictions 1.\n"; + } } if(show_progress) /* 4 */ @@ -2122,7 +2122,7 @@ smoke_check_9(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2132,7 +2132,7 @@ smoke_check_9(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -2149,8 +2149,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't enable evictions 1.\n"; - } + failure_mssg = "can't enable evictions 1.\n"; + } } if(show_progress) /* 6 */ @@ -2168,7 +2168,7 @@ smoke_check_9(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -2183,8 +2183,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 2.\n"; - } + failure_mssg = "can't disable evictions 2.\n"; + } } if(show_progress) /* 8 */ @@ -2192,7 +2192,7 @@ smoke_check_9(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2202,7 +2202,7 @@ smoke_check_9(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -2217,8 +2217,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't enable evictions 2.\n"; - } + failure_mssg = "can't enable evictions 2.\n"; + } } if(show_progress) /* 10 */ @@ -2243,8 +2243,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 3.\n"; - } + failure_mssg = "can't disable evictions 3.\n"; + } } if(show_progress) /* 12 */ @@ -2252,7 +2252,7 @@ smoke_check_9(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2283,8 +2283,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't enable evictions 3.\n"; - } + failure_mssg = "can't enable evictions 3.\n"; + } } if(show_progress) /* 15 */ @@ -2292,7 +2292,7 @@ smoke_check_9(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2312,8 +2312,8 @@ smoke_check_9(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 4.\n"; - } + failure_mssg = "can't disable evictions 4.\n"; + } } @@ -2342,26 +2342,26 @@ smoke_check_9(int express_test, unsigned paged) } /* smoke_check_9() */ - + /*------------------------------------------------------------------------- - * Function: smoke_check_10() + * Function: smoke_check_10() * - * Purpose: A repeat of smoke check 2, only with the cache corked - * part of the time. + * Purpose: A repeat of smoke check 2, only with the cache corked + * part of the time. * - * Recall that smoke check 2 is a basic functional test, - * with inserts, destroys, and moves in the mix, along - * with some repeated protects and unprotects. About half - * the entries are marked as dirty. + * Recall that smoke check 2 is a basic functional test, + * with inserts, destroys, and moves in the mix, along + * with some repeated protects and unprotects. About half + * the entries are marked as dirty. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/1/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -2394,23 +2394,23 @@ smoke_check_10(int express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -2433,7 +2433,7 @@ smoke_check_10(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2443,7 +2443,7 @@ smoke_check_10(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -2458,8 +2458,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 1.\n"; - } + failure_mssg = "can't disable evictions 1.\n"; + } } if(show_progress) /* 5 */ @@ -2477,7 +2477,7 @@ smoke_check_10(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -2492,8 +2492,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't enable evictions 1.\n"; - } + failure_mssg = "can't enable evictions 1.\n"; + } } if(show_progress) /* 7 */ @@ -2501,7 +2501,7 @@ smoke_check_10(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2511,7 +2511,7 @@ smoke_check_10(int express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, /* dirty_unprotects */ dirty_unprotects); @@ -2526,8 +2526,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 2.\n"; - } + failure_mssg = "can't disable evictions 2.\n"; + } } if(show_progress) /* 9 */ @@ -2552,8 +2552,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't enable evictions 2.\n"; - } + failure_mssg = "can't enable evictions 2.\n"; + } } if(show_progress) /* 11 */ @@ -2561,7 +2561,7 @@ smoke_check_10(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2581,8 +2581,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 3.\n"; - } + failure_mssg = "can't disable evictions 3.\n"; + } } if(show_progress) /* 13 */ @@ -2607,8 +2607,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't enable evictions 3.\n"; - } + failure_mssg = "can't enable evictions 3.\n"; + } } if(show_progress) /* 15 */ @@ -2616,7 +2616,7 @@ smoke_check_10(int express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2636,8 +2636,8 @@ smoke_check_10(int express_test, unsigned paged) if(result < 0) { pass = FALSE; - failure_mssg = "can't disable evictions 4.\n"; - } + failure_mssg = "can't disable evictions 4.\n"; + } } if(show_progress) /* 17 */ @@ -2665,19 +2665,19 @@ smoke_check_10(int express_test, unsigned paged) } /* smoke_check_10() */ - + /*------------------------------------------------------------------------- - * Function: write_permitted_check() + * Function: write_permitted_check() * - * Purpose: A basic test of the write permitted function. In essence, - * we load the cache up with dirty entryies, set - * write_permitted to FALSE, and then protect a bunch of - * entries. If there are any writes while write_permitted is - * FALSE, the test will fail. + * Purpose: A basic test of the write permitted function. In essence, + * we load the cache up with dirty entryies, set + * write_permitted to FALSE, and then protect a bunch of + * entries. If there are any writes while write_permitted is + * FALSE, the test will fail. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * * Modifications: @@ -2712,23 +2712,23 @@ express_test, unsigned paged) switch (express_test) { - case 0: - max_index = (10 * 1024) - 1; - break; + case 0: + max_index = (10 * 1024) - 1; + break; - case 1: - max_index = (1 * 1024) - 1; - break; + case 1: + max_index = (1 * 1024) - 1; + break; - case 2: - max_index = (512) - 1; - break; + case 2: + max_index = (512) - 1; + break; - default: + default: SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - break; + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -2750,7 +2750,7 @@ express_test, unsigned paged) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2760,7 +2760,7 @@ express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ TRUE, /* dirty_unprotects */ TRUE); @@ -2781,7 +2781,7 @@ express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ FALSE, /* dirty_unprotects */ NO_CHANGE); @@ -2792,7 +2792,7 @@ express_test, unsigned paged) write_permitted = TRUE; row_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2802,7 +2802,7 @@ express_test, unsigned paged) /* do_moves */ TRUE, /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, - /* do_mult_ro_protects */ TRUE, + /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ TRUE, /* dirty_unprotects */ TRUE); @@ -2822,7 +2822,7 @@ express_test, unsigned paged) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2838,7 +2838,7 @@ express_test, unsigned paged) write_permitted = FALSE; col_major_scan_backward(/* file_ptr */ file_ptr, - /* max_index */ max_index, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2874,7 +2874,7 @@ express_test, unsigned paged) SKIPPED(); - HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n"); + HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n"); #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -2882,21 +2882,21 @@ express_test, unsigned paged) } /* write_permitted_check() */ - + /*------------------------------------------------------------------------- - * Function: check_insert_entry() + * Function: check_insert_entry() * - * Purpose: Verify that H5C_insert_entry behaves as expected. - * Test the behaviour with different flags. + * Purpose: Verify that H5C_insert_entry behaves as expected. + * Test the behaviour with different flags. * - * This test was added primarily to test basic insert - * pinned entry functionallity, but I through in explicit - * tests for other functionallity that is tested implicitly - * elsewhere. + * This test was added primarily to test basic insert + * pinned entry functionallity, but I through in explicit + * tests for other functionallity that is tested implicitly + * elsewhere. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/10/06 * * Modifications: @@ -2960,13 +2960,13 @@ check_insert_entry(unsigned paged) base_addr = entries[0]; while(pass && (i < 4)) { - entry_ptr = &(base_addr[i]); + entry_ptr = &(base_addr[i]); - /* Start by checking everything we can via H5C_get_entry_status() */ + /* Start by checking everything we can via H5C_get_entry_status() */ - result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, + &in_cache, &is_dirty, &is_protected, + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -2974,129 +2974,129 @@ check_insert_entry(unsigned paged) failure_mssg = "H5C_get_entry_status() reports failure."; } - if(pass) { + if(pass) { - /* check the universals */ - if((!in_cache) || (!is_dirty) || (is_protected) || + /* check the universals */ + if((!in_cache) || (!is_dirty) || (is_protected) || (entry_size != entry_sizes[entry_type])) { pass = FALSE; failure_mssg = "Unexpected insert results 1."; } - } + } - if(pass) { + if(pass) { /* verify that the pinned flag got set correctly */ - if((i == 2) || (i == 3)) { + if((i == 2) || (i == 3)) { - if(!is_pinned) { + if(!is_pinned) { pass = FALSE; failure_mssg = "Unexpected insert results 2."; - } - } else if(is_pinned) { + } + } else if(is_pinned) { pass = FALSE; failure_mssg = "Unexpected insert results 3."; - } else if(is_pinned != ((entry_ptr->header).is_pinned)) { + } else if(is_pinned != ((entry_ptr->header).is_pinned)) { pass = FALSE; failure_mssg = "Unexpected insert results 4."; } - } + } - /* Thats all we can get from H5C_get_entry_status(). - * Now start looking at the cache data structures directly. - */ + /* Thats all we can get from H5C_get_entry_status(). + * Now start looking at the cache data structures directly. + */ - if(pass) { + if(pass) { /* Verify that the flush marker got set correctly */ - if((i == 1) || (i == 3)) { + if((i == 1) || (i == 3)) { - if(!((entry_ptr->header).flush_marker)) { + if(!((entry_ptr->header).flush_marker)) { pass = FALSE; failure_mssg = "Unexpected insert results 5."; - } - } else if((entry_ptr->header).flush_marker) { + } + } else if((entry_ptr->header).flush_marker) { pass = FALSE; failure_mssg = "Unexpected insert results 6."; - } - } + } + } - if(pass) { + if(pass) { - /* Verify that pinned entries are in the pinned entry list */ - if((entry_ptr->header).is_pinned) { + /* Verify that pinned entries are in the pinned entry list */ + if((entry_ptr->header).is_pinned) { - search_ptr = cache_ptr->pel_head_ptr; + search_ptr = cache_ptr->pel_head_ptr; - while((search_ptr != NULL) && - (search_ptr != - (struct H5C_cache_entry_t *)entry_ptr)) - { - search_ptr = search_ptr->next; - } + while((search_ptr != NULL) && + (search_ptr != + (struct H5C_cache_entry_t *)entry_ptr)) + { + search_ptr = search_ptr->next; + } - if(search_ptr == NULL) { + if(search_ptr == NULL) { pass = FALSE; failure_mssg = "Unexpected insert results 7."; - } - } - } + } + } + } - if(pass) { + if(pass) { - /* Verify that unpinned entries are in the LRU list */ - if(!((entry_ptr->header).is_pinned)) { + /* Verify that unpinned entries are in the LRU list */ + if(!((entry_ptr->header).is_pinned)) { - search_ptr = cache_ptr->LRU_head_ptr; + search_ptr = cache_ptr->LRU_head_ptr; - while((search_ptr != NULL) && - (search_ptr != - (struct H5C_cache_entry_t *)entry_ptr)) - { - search_ptr = search_ptr->next; - } + while((search_ptr != NULL) && + (search_ptr != + (struct H5C_cache_entry_t *)entry_ptr)) + { + search_ptr = search_ptr->next; + } - if(search_ptr == NULL) { + if(search_ptr == NULL) { pass = FALSE; failure_mssg = "Unexpected insert results 8."; - } - } - } + } + } + } #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - if(pass) { + if(pass) { - /* Verify that unpinned entries are in the dirty LRU list */ - if(!((entry_ptr->header).is_pinned)) { + /* Verify that unpinned entries are in the dirty LRU list */ + if(!((entry_ptr->header).is_pinned)) { - search_ptr = cache_ptr->dLRU_head_ptr; + search_ptr = cache_ptr->dLRU_head_ptr; - while((search_ptr != NULL) && - (search_ptr != - (struct H5C_cache_entry_t *)entry_ptr)) - { - search_ptr = search_ptr->aux_next; - } + while((search_ptr != NULL) && + (search_ptr != + (struct H5C_cache_entry_t *)entry_ptr)) + { + search_ptr = search_ptr->aux_next; + } - if(search_ptr == NULL) { + if(search_ptr == NULL) { pass = FALSE; failure_mssg = "Unexpected insert results 9."; - } - } - } + } + } + } #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - i++; + i++; } /* while */ @@ -3107,27 +3107,27 @@ check_insert_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->slist_len != 4) || - (cache_ptr->slist_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->pl_len != 0) || - (cache_ptr->pl_size != (size_t)0) || - (cache_ptr->pel_len != 2) || - (cache_ptr->pel_size != 2 * entry_sizes[entry_type]) || - (cache_ptr->LRU_list_len != 2) || - (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type]) + if((cache_ptr->index_len != 4) || + (cache_ptr->index_size != 4 * entry_sizes[entry_type]) || + (cache_ptr->slist_len != 4) || + (cache_ptr->slist_size != 4 * entry_sizes[entry_type]) || + (cache_ptr->pl_len != 0) || + (cache_ptr->pl_size != (size_t)0) || + (cache_ptr->pel_len != 2) || + (cache_ptr->pel_size != 2 * entry_sizes[entry_type]) || + (cache_ptr->LRU_list_len != 2) || + (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type]) #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - || (cache_ptr->dLRU_list_len != 2) || - (cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) || - (cache_ptr->cLRU_list_len != 0) || - (cache_ptr->cLRU_list_size != (size_t)0) + || (cache_ptr->dLRU_list_len != 2) || + (cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) || + (cache_ptr->cLRU_list_len != 0) || + (cache_ptr->cLRU_list_size != (size_t)0) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ ) { pass = FALSE; failure_mssg = "Unexpected insert results 10."; - } + } } /* Finally, if stats collection is enabled, verify that the expected @@ -3136,23 +3136,23 @@ check_insert_entry(unsigned paged) #if H5C_COLLECT_CACHE_STATS if(pass) { - if((cache_ptr->insertions[entry_type] != 4) || - (cache_ptr->pinned_insertions[entry_type] != 2) || - (cache_ptr->pins[entry_type] != 2) || - (cache_ptr->unpins[entry_type] != 0) || + if((cache_ptr->insertions[entry_type] != 4) || + (cache_ptr->pinned_insertions[entry_type] != 2) || + (cache_ptr->pins[entry_type] != 2) || + (cache_ptr->unpins[entry_type] != 0) || (cache_ptr->dirty_pins[entry_type] != 0) || - (cache_ptr->max_index_len != 4) || - (cache_ptr->max_index_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->max_slist_len != 4) || - (cache_ptr->max_slist_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->max_pl_len != 0) || - (cache_ptr->max_pl_size != (size_t)0) || - (cache_ptr->max_pel_len != 2) || - (cache_ptr->max_pel_size != 2 * entry_sizes[entry_type])) { + (cache_ptr->max_index_len != 4) || + (cache_ptr->max_index_size != 4 * entry_sizes[entry_type]) || + (cache_ptr->max_slist_len != 4) || + (cache_ptr->max_slist_size != 4 * entry_sizes[entry_type]) || + (cache_ptr->max_pl_len != 0) || + (cache_ptr->max_pl_size != (size_t)0) || + (cache_ptr->max_pel_len != 2) || + (cache_ptr->max_pel_size != 2 * entry_sizes[entry_type])) { pass = FALSE; failure_mssg = "Unexpected insert results 11."; - } + } } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -3161,7 +3161,7 @@ check_insert_entry(unsigned paged) if(pass) { unpin_entry(entry_type, 2); - unpin_entry(entry_type, 3); + unpin_entry(entry_type, 3); } if(pass) { @@ -3181,16 +3181,16 @@ check_insert_entry(unsigned paged) } /* check_insert_entry() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache() + * Function: check_flush_cache() * - * Purpose: Verify that flush_cache behaves as expected. In particular, - * test the behaviour with different flags. + * Purpose: Verify that flush_cache behaves as expected. In particular, + * test the behaviour with different flags. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/10/05 * * Modifications: @@ -3247,7 +3247,7 @@ check_flush_cache(unsigned paged) if(pass) { - check_flush_cache__flush_ops(file_ptr); + check_flush_cache__flush_ops(file_ptr); } if(pass) { @@ -3267,16 +3267,16 @@ check_flush_cache(unsigned paged) } /* check_flush_cache() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__empty_cache() + * Function: check_flush_cache__empty_cache() * - * Purpose: Verify that flush_cache behaves as expected with an empty + * Purpose: Verify that flush_cache behaves as expected with an empty * cache. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/05 * * Modifications: @@ -3288,7 +3288,7 @@ static void check_flush_cache__empty_cache(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - herr_t result; + herr_t result; if(cache_ptr == NULL) { @@ -3354,22 +3354,22 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) } /* check_flush_cache__empty_cache() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__multi_entry() + * Function: check_flush_cache__multi_entry() * - * Purpose: Verify that flush_cache behaves as expected when the cache - * contains multiple elements. + * Purpose: Verify that flush_cache behaves as expected when the cache + * contains multiple elements. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/14/05 * * Modifications: * - * JRM -- 4/5/06 - * Added pinned entry tests. + * JRM -- 4/5/06 + * Added pinned entry tests. * *------------------------------------------------------------------------- */ @@ -4264,9 +4264,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE @@ -4277,10 +4277,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE @@ -4291,11 +4291,11 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE @@ -4306,12 +4306,12 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE @@ -4322,13 +4322,13 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE @@ -4339,14 +4339,14 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 5, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + /* num_pins = */ 5, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1}, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE @@ -4357,15 +4357,15 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 6, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + /* num_pins = */ 6, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1}, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE @@ -4376,16 +4376,16 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 40, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 7, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + /* num_pins = */ 7, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1}, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE @@ -4410,9 +4410,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4423,10 +4423,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4437,11 +4437,11 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4452,12 +4452,12 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4468,9 +4468,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4481,10 +4481,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - -1, -1, -1, -1 -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + -1, -1, -1, -1 -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4495,11 +4495,11 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4510,12 +4510,12 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 40, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1}, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4540,9 +4540,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4553,10 +4553,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4567,10 +4567,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4581,10 +4581,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4595,9 +4595,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4608,9 +4608,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4621,9 +4621,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4634,9 +4634,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 40, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4662,9 +4662,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4675,10 +4675,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4689,10 +4689,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4703,10 +4703,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4717,9 +4717,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4730,13 +4730,13 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4747,13 +4747,13 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4764,9 +4764,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 40, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE @@ -4793,9 +4793,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4806,10 +4806,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4820,10 +4820,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4834,10 +4834,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4848,10 +4848,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4862,10 +4862,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ TRUE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4876,10 +4876,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4890,10 +4890,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 40, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, /* expected_deserialized = */ FALSE, /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE @@ -4908,15 +4908,15 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) } /* check_flush_cache__multi_entry() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__multi_entry_test() + * Function: check_flush_cache__multi_entry_test() * - * Purpose: Run a multi entry flush cache test. + * Purpose: Run a multi entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/13/05 * * Modifications: @@ -4933,9 +4933,9 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; + herr_t result; unsigned u; - size_t total_entry_size = 0; + size_t total_entry_size = 0; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -4943,7 +4943,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /* This gets used a lot, so lets leave it in. */ HDfprintf(stdout, "check_flush_cache__multi_entry_test: test %d\n", - test_num); + test_num); #endif /* JRM */ if(cache_ptr == NULL) { @@ -5127,15 +5127,15 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } /* check_flush_cache__multi_entry_test() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__pe_multi_entry_test() + * Function: check_flush_cache__pe_multi_entry_test() * - * Purpose: Run a multi entry flush cache test. + * Purpose: Run a multi entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/5/06 * * Modifications: @@ -5152,10 +5152,10 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, { H5C_t *cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; + herr_t result; unsigned u; int j; - size_t total_entry_size = 0; + size_t total_entry_size = 0; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -5163,7 +5163,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, /* This is useful debugging code. Leave it in for now. */ HDfprintf(stdout, "check_flush_cache__pe_multi_entry_test: test %d\n", - test_num); + test_num); #endif /* JRM */ if(cache_ptr == NULL) { @@ -5201,8 +5201,8 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || (spec[u].entry_index < 0) || (spec[u].entry_index > max_indices[spec[u].entry_type]) || - (spec[u].num_pins < 0) || - (spec[u].num_pins > MAX_PINS)) { + (spec[u].num_pins < 0) || + (spec[u].num_pins > MAX_PINS)) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5231,14 +5231,14 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, total_entry_size += entry_sizes[spec[u].entry_type]; - for (j = 0; j < spec[u].num_pins; j++) - { + for (j = 0; j < spec[u].num_pins; j++) + { create_pinned_entry_dependency(file_ptr, - spec[u].entry_type, - spec[u].entry_index, - spec[u].pin_type[j], - spec[u].pin_idx[j]); - } + spec[u].entry_type, + spec[u].entry_index, + spec[u].pin_type[j], + spec[u].pin_idx[j]); + } u++; } @@ -5358,21 +5358,21 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } /* check_flush_cache__pe_multi_entry_test() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__flush_ops() + * Function: check_flush_cache__flush_ops() * - * Purpose: Run the flush ops cache tests. + * Purpose: Run the flush ops cache tests. * - * These are tests that test the cache's ability to handle - * the case in which the flush callback dirties, resizes, - * and/or moves entries. + * These are tests that test the cache's ability to handle + * the case in which the flush callback dirties, resizes, + * and/or moves entries. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/3/06 * * Modifications: @@ -5399,468 +5399,468 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) if(pass) /* test #1 */ { - /* start with a very simple test, in which there are two entries - * resident in cache, and the second entry dirties the first in - * the flush callback. No size changes, and no flush flags. - */ - int test_num = 1; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 2; - unsigned init_expected_index_len = 2; - size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 2; - size_t expected_index_size = 2 * PICO_ENTRY_SIZE; - struct fo_flush_cache_test_spec spec[2] = - { + /* start with a very simple test, in which there are two entries + * resident in cache, and the second entry dirties the first in + * the flush callback. No size changes, and no flush flags. + */ + int test_num = 1; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 2; + unsigned init_expected_index_len = 2; + size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; + unsigned expected_index_len = 2; + size_t expected_index_size = 2 * PICO_ENTRY_SIZE; + struct fo_flush_cache_test_spec spec[2] = + { { /* entry_num = */ 0, /* entry_type = */ 0, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, { /* entry_num = */ 1, /* entry_type = */ 0, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #2 */ { - /* Same as test 1, only this time set the flush invalidate flag. - * Note that we must repeat all tests with the flush invalidate flag - * as this triggers a different set of code to execute the flush. - * - * Create two entries resident in cache, and have the second entry - * dirty the first in the flush callback. - */ - int test_num = 2; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 2; - unsigned init_expected_index_len = 2; - size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 0; - size_t expected_index_size = 0; - struct fo_flush_cache_test_spec spec[2] = - { + /* Same as test 1, only this time set the flush invalidate flag. + * Note that we must repeat all tests with the flush invalidate flag + * as this triggers a different set of code to execute the flush. + * + * Create two entries resident in cache, and have the second entry + * dirty the first in the flush callback. + */ + int test_num = 2; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 2; + unsigned init_expected_index_len = 2; + size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; + unsigned expected_index_len = 0; + size_t expected_index_size = 0; + struct fo_flush_cache_test_spec spec[2] = + { { /* entry_num = */ 0, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, { /* entry_num = */ 1, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr*/ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr*/ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #3 */ { - /* Single entry test verifying that the cache can handle the case in - * which the call back function resizes the entry for which it has - * been called. - */ - int test_num = 3; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; - unsigned expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; - struct fo_flush_cache_test_spec spec[1] = - { + /* Single entry test verifying that the cache can handle the case in + * which the call back function resizes the entry for which it has + * been called. + */ + int test_num = 3; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; + unsigned expected_index_len = 1; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 4, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr:*/ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 4, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr:*/ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #4 */ { - /* Repeat test #4 with the flush invalidate flag. - * - * Single entry test verifying that the cache can handle the case in - * which the call back function resizes the entry for which it has - * been called. - */ - int test_num = 4; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; - unsigned expected_index_len = 0; - size_t expected_index_size = 0; - struct fo_flush_cache_test_spec spec[1] = - { + /* Repeat test #4 with the flush invalidate flag. + * + * Single entry test verifying that the cache can handle the case in + * which the call back function resizes the entry for which it has + * been called. + */ + int test_num = 4; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; + unsigned expected_index_len = 0; + size_t expected_index_size = 0; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 4, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 4, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #5 & #6 */ { - /* Single entry test verifying that the cache can handle the case in - * which the call back function first resizes and then moves the - * entry for which it has been called. - * - * Run this entry twice, as the first run moves the entry to its - * alternate address, and the second moves it back. + /* Single entry test verifying that the cache can handle the case in + * which the call back function first resizes and then moves the + * entry for which it has been called. + * + * Run this entry twice, as the first run moves the entry to its + * alternate address, and the second moves it back. * * 10/8/07 -- JRM * Added a resize operation to this test to satisfy the new * requiremnt that any resize of an entry on flush will always * be accompanied by a resize. Note that as a result, this * test becomes redundant with later tests. - */ - int test_num = 5; /* and 6 */ - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; - struct fo_flush_cache_test_spec spec[1] = - { + */ + int test_num = 5; /* and 6 */ + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 1; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 2, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 2, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - - /* this change forces the move to move the target entry back to its - * main address. The first test moved it to its alternate address. - * - * Note that these two tests are not the same, as in the first test, - * the moved entry is moved forward in the slist. In the second - * it is moved backwards. - * - * Since there is only one entry in the cache, this doesn't really - * matter in this case. But we will do similar tests later with - * other entries in the cache. - */ - if(pass) { - - spec[0].flush_ops[1].flag = TRUE; - test_num = 6; + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + + /* this change forces the move to move the target entry back to its + * main address. The first test moved it to its alternate address. + * + * Note that these two tests are not the same, as in the first test, + * the moved entry is moved forward in the slist. In the second + * it is moved backwards. + * + * Since there is only one entry in the cache, this doesn't really + * matter in this case. But we will do similar tests later with + * other entries in the cache. + */ + if(pass) { + + spec[0].flush_ops[1].flag = TRUE; + test_num = 6; check_flush_cache__flush_op_test(file_ptr, test_num, @@ -5871,118 +5871,118 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) init_expected_index_size, expected_index_len, expected_index_size, - check_size, - checks); - } + check_size, + checks); + } } if(pass) /* test #7 & #8 */ { - /* Run tests 5 & 6 again, using the flush invalidate flag on the - * second test. - * - * Single entry test verifying that the cache can handle the case in - * which the call back function moves the entry for which it has - * been called. - * - * Run this entry twice, as the first run moves the entry to its - * alternate address, and the second moves it back. + /* Run tests 5 & 6 again, using the flush invalidate flag on the + * second test. + * + * Single entry test verifying that the cache can handle the case in + * which the call back function moves the entry for which it has + * been called. + * + * Run this entry twice, as the first run moves the entry to its + * alternate address, and the second moves it back. * * 10/8/07 -- JRM * Added a resize operation to this test to satisfy the new * requiremnt that any resize of an entry on flush will always * be accompanied by a resize. Note that as a result, this * test becomes redundant with later tests. - */ - int test_num = 7; /* and 8 */ - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; - struct fo_flush_cache_test_spec spec[1] = - { + */ + int test_num = 7; /* and 8 */ + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 1; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 2, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 2, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - - /* this change forces the move to move the target entry back to its - * main address. The first test moved it to its alternate address. - * - * Note that these two tests are not the same, as in the first test, - * the moved entry is moved forward in the slist. In the second - * it is moved backwards. - * - * Since there is only one entry in the cache, this doesn't really - * matter in this case. But we will do similar tests later with - * other entries in the cache. - */ - - if(pass) { + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + + /* this change forces the move to move the target entry back to its + * main address. The first test moved it to its alternate address. + * + * Note that these two tests are not the same, as in the first test, + * the moved entry is moved forward in the slist. In the second + * it is moved backwards. + * + * Since there is only one entry in the cache, this doesn't really + * matter in this case. But we will do similar tests later with + * other entries in the cache. + */ + + if(pass) { test_num = 8; - flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - expected_index_len = 0; - expected_index_size = 0; - spec[0].flush_ops[1].flag = TRUE; - spec[0].expected_destroyed = TRUE; + flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + expected_index_len = 0; + expected_index_size = 0; + spec[0].flush_ops[1].flag = TRUE; + spec[0].expected_destroyed = TRUE; check_flush_cache__flush_op_test(file_ptr, test_num, @@ -5993,104 +5993,104 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) init_expected_index_size, expected_index_len, expected_index_size, - check_size, - checks); - } + check_size, + checks); + } } if(pass) /* test #9 & #10 */ { - /* Single entry test verifying that the cache can handle the case in - * which the call back function both resizes and moves the entry - * for which it has been called. - * - * Again, we run this entry twice, as the first run moves the entry + /* Single entry test verifying that the cache can handle the case in + * which the call back function both resizes and moves the entry + * for which it has been called. + * + * Again, we run this entry twice, as the first run moves the entry * to its alternate address, and the second moves it back. - */ - int test_num = 9; /* and 10 */ - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; - unsigned expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; - struct fo_flush_cache_test_spec spec[1] = - { + */ + int test_num = 9; /* and 10 */ + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; + unsigned expected_index_len = 1; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 2, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 2, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 2, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 2, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - - /* this change forces the move to move the target entry back to its - * main address. The first test moved it to its alternate address. - * - * Note that these two tests are not the same, as in the first test, - * the moved entry is moved forward in the slist. In the second - * it is moved backwards. - * - * Since there is only one entry in the cache, this doesn't really - * matter in this case. But we will do similar tests later with - * other entries in the cache. - */ - if(pass) { - - spec[0].flush_ops[1].flag = TRUE; - test_num = 10; + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + + /* this change forces the move to move the target entry back to its + * main address. The first test moved it to its alternate address. + * + * Note that these two tests are not the same, as in the first test, + * the moved entry is moved forward in the slist. In the second + * it is moved backwards. + * + * Since there is only one entry in the cache, this doesn't really + * matter in this case. But we will do similar tests later with + * other entries in the cache. + */ + if(pass) { + + spec[0].flush_ops[1].flag = TRUE; + test_num = 10; check_flush_cache__flush_op_test(file_ptr, test_num, @@ -6101,111 +6101,111 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) init_expected_index_size, expected_index_len, expected_index_size, - check_size, - checks); - } + check_size, + checks); + } } if(pass) /* test #11 & #12 */ { - /* Repeat the previous test with the flush invalidate flag on the - * second test. - * - * Single entry test verifying that the cache can handle the case in - * which the call back function both resizes and moves the entry - * for which it has been called. - * - * Again, we run this entry twice, as the first run moves the entry to its - * alternate address, and the second moves it back. - */ - int test_num = 11; /* and 12 */ - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; - unsigned expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; - struct fo_flush_cache_test_spec spec[1] = - { + /* Repeat the previous test with the flush invalidate flag on the + * second test. + * + * Single entry test verifying that the cache can handle the case in + * which the call back function both resizes and moves the entry + * for which it has been called. + * + * Again, we run this entry twice, as the first run moves the entry to its + * alternate address, and the second moves it back. + */ + int test_num = 11; /* and 12 */ + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; + unsigned expected_index_len = 1; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 2, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 2, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 2, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 2, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - - /* this change forces the move to move the target entry back to its - * main address. The first test moved it to its alternate address. - * - * Note that these two tests are not the same, as in the first test, - * the moved entry is moved forward in the slist. In the second - * it is moved backwards. - * - * Since there is only one entry in the cache, this doesn't really - * matter in this case. But we will do similar tests later with - * other entries in the cache. - */ - if(pass) { + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + + /* this change forces the move to move the target entry back to its + * main address. The first test moved it to its alternate address. + * + * Note that these two tests are not the same, as in the first test, + * the moved entry is moved forward in the slist. In the second + * it is moved backwards. + * + * Since there is only one entry in the cache, this doesn't really + * matter in this case. But we will do similar tests later with + * other entries in the cache. + */ + if(pass) { test_num = 12; - flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - expected_index_len = 0; - expected_index_size = 0; - spec[0].flush_ops[1].flag = TRUE; - spec[0].expected_destroyed = TRUE; + flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + expected_index_len = 0; + expected_index_size = 0; + spec[0].flush_ops[1].flag = TRUE; + spec[0].expected_destroyed = TRUE; check_flush_cache__flush_op_test(file_ptr, @@ -6217,500 +6217,500 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) init_expected_index_size, expected_index_len, expected_index_size, - check_size, - checks); - } + check_size, + checks); + } } if(pass) /* test #13 */ { - /* Test the ability of the cache to handle the case in which - * the flush function of an entry that is resident in cache - * dirties two entries that are not in cache. No size - * changes. - * - * At present, I am assured that this case will never occur, but - * lets make sure we can handle it regardless. - */ - int test_num = 13; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 3; - size_t expected_index_size = 3 * PICO_ENTRY_SIZE; - struct fo_flush_cache_test_spec spec[1] = - { + /* Test the ability of the cache to handle the case in which + * the flush function of an entry that is resident in cache + * dirties two entries that are not in cache. No size + * changes. + * + * At present, I am assured that this case will never occur, but + * lets make sure we can handle it regardless. + */ + int test_num = 13; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; + unsigned expected_index_len = 3; + size_t expected_index_size = 3 * PICO_ENTRY_SIZE; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ 0, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 2, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 2, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 2; - struct fo_flush_entry_check checks[2] = - { - { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ PICO_ENTRY_SIZE, - /* in_cache = */ TRUE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ PICO_ENTRY_SIZE, - /* in_cache = */ TRUE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 2; + struct fo_flush_entry_check checks[2] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ PICO_ENTRY_SIZE, + /* in_cache = */ TRUE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ PICO_ENTRY_SIZE, + /* in_cache = */ TRUE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #14 */ { - /* Repeat previous test with the flush invalidate flag. - * - * Test the ability of the cache to handle the case in which - * the flush function of an entry that is resident in cache - * dirties two entries that are not in cache. No size - * changes. - * - * At present, I am assured that this case will never occur, but - * lets make sure we can handle it regardless. - */ - int test_num = 14; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 0; - size_t expected_index_size = (size_t)0; - struct fo_flush_cache_test_spec spec[1] = - { + /* Repeat previous test with the flush invalidate flag. + * + * Test the ability of the cache to handle the case in which + * the flush function of an entry that is resident in cache + * dirties two entries that are not in cache. No size + * changes. + * + * At present, I am assured that this case will never occur, but + * lets make sure we can handle it regardless. + */ + int test_num = 14; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; + unsigned expected_index_len = 0; + size_t expected_index_size = (size_t)0; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ 0, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 2, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 2, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 2; - struct fo_flush_entry_check checks[2] = - { - { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ PICO_ENTRY_SIZE, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ PICO_ENTRY_SIZE, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - } - }; + }; + int check_size = 2; + struct fo_flush_entry_check checks[2] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ PICO_ENTRY_SIZE, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ PICO_ENTRY_SIZE, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #15 */ { - /* Test the ability of the cache to handle the case in which - * the flush function of an entry that is resident in cache - * resizes and dirties two entries that are not in cache. - * - * At present, I am assured that this case will never occur, but - * lets make sure we can handle it regardless. - */ - int test_num = 15; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 3; - size_t expected_index_size = VARIABLE_ENTRY_SIZE + - (VARIABLE_ENTRY_SIZE / 4) + - (VARIABLE_ENTRY_SIZE / 2); - struct fo_flush_cache_test_spec spec[1] = - { + /* Test the ability of the cache to handle the case in which + * the flush function of an entry that is resident in cache + * resizes and dirties two entries that are not in cache. + * + * At present, I am assured that this case will never occur, but + * lets make sure we can handle it regardless. + */ + int test_num = 15; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 3; + size_t expected_index_size = VARIABLE_ENTRY_SIZE + + (VARIABLE_ENTRY_SIZE / 4) + + (VARIABLE_ENTRY_SIZE / 2); + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 4, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 4, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 2; - struct fo_flush_entry_check checks[2] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ TRUE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 2; + struct fo_flush_entry_check checks[2] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ TRUE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #16 */ { - /* Repeat previous test with the flush invalidate flag. - * - * Test the ability of the cache to handle the case in which - * the flush function of an entry that is resident in cache - * resizes and dirties two entries that are not in cache. - * - * At present, I am assured that this case will never occur, but - * lets make sure we can handle it regardless. - */ - int test_num = 16; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 0; - size_t expected_index_size = (size_t)0; - struct fo_flush_cache_test_spec spec[1] = - { + /* Repeat previous test with the flush invalidate flag. + * + * Test the ability of the cache to handle the case in which + * the flush function of an entry that is resident in cache + * resizes and dirties two entries that are not in cache. + * + * At present, I am assured that this case will never occur, but + * lets make sure we can handle it regardless. + */ + int test_num = 16; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 0; + size_t expected_index_size = (size_t)0; + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 4, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 4, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 2; - struct fo_flush_entry_check checks[2] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - } - }; + }; + int check_size = 2; + struct fo_flush_entry_check checks[2] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #17 & #18 */ { - /* Test the ability of the cache to handle the case in which - * the flush function of an entry that is resident in cache - * resizes, dirties, and moves two entries that are not in cache. - * - * At present, I am assured that this case will never occur, but - * lets make sure we can handle it regardless. - */ - int test_num = 17; /* and 18 */ - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 3; - size_t expected_index_size = VARIABLE_ENTRY_SIZE + - (VARIABLE_ENTRY_SIZE / 4) + - (VARIABLE_ENTRY_SIZE / 2); - struct fo_flush_cache_test_spec spec[1] = - { + /* Test the ability of the cache to handle the case in which + * the flush function of an entry that is resident in cache + * resizes, dirties, and moves two entries that are not in cache. + * + * At present, I am assured that this case will never occur, but + * lets make sure we can handle it regardless. + */ + int test_num = 17; /* and 18 */ + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 3; + size_t expected_index_size = VARIABLE_ENTRY_SIZE + + (VARIABLE_ENTRY_SIZE / 4) + + (VARIABLE_ENTRY_SIZE / 2); + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 2; - struct fo_flush_entry_check checks[2] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 2; + struct fo_flush_entry_check checks[2] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - - /* this change forces the moves to move the target entries back to - * their main address. The first test moved them to their alternate - * address. - * - * Note that these two tests are not the same, as in the first test, - * the moved entries are moved forward in the slist. In the second - * they are moved backwards. - */ - if(pass) { - - test_num = 18; - spec[0].flush_ops[2].flag = TRUE; - spec[0].flush_ops[5].flag = TRUE; - checks[0].at_main_addr = TRUE; - checks[1].at_main_addr = TRUE; + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + + /* this change forces the moves to move the target entries back to + * their main address. The first test moved them to their alternate + * address. + * + * Note that these two tests are not the same, as in the first test, + * the moved entries are moved forward in the slist. In the second + * they are moved backwards. + */ + if(pass) { + + test_num = 18; + spec[0].flush_ops[2].flag = TRUE; + spec[0].flush_ops[5].flag = TRUE; + checks[0].at_main_addr = TRUE; + checks[1].at_main_addr = TRUE; check_flush_cache__flush_op_test(file_ptr, test_num, @@ -6721,131 +6721,131 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) init_expected_index_size, expected_index_len, expected_index_size, - check_size, - checks); - } + check_size, + checks); + } } if(pass) /* test #19 & #20 */ { - /* Repeat the above test with the flush invalidate flag on the - * second test. - * - * Test the ability of the cache to handle the case in which - * the flush function of an entry that is resident in cache - * resizes, dirties, and moves two entries that are not in cache. - * - * At present, I am assured that this case will never occur, but - * lets make sure we can handle it regardless. - */ - int test_num = 19; /* and 20 */ - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 1; - unsigned init_expected_index_len = 1; - size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 3; - size_t expected_index_size = VARIABLE_ENTRY_SIZE + - (VARIABLE_ENTRY_SIZE / 4) + - (VARIABLE_ENTRY_SIZE / 2); - struct fo_flush_cache_test_spec spec[1] = - { + /* Repeat the above test with the flush invalidate flag on the + * second test. + * + * Test the ability of the cache to handle the case in which + * the flush function of an entry that is resident in cache + * resizes, dirties, and moves two entries that are not in cache. + * + * At present, I am assured that this case will never occur, but + * lets make sure we can handle it regardless. + */ + int test_num = 19; /* and 20 */ + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 1; + unsigned init_expected_index_len = 1; + size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 3; + size_t expected_index_size = VARIABLE_ENTRY_SIZE + + (VARIABLE_ENTRY_SIZE / 4) + + (VARIABLE_ENTRY_SIZE / 2); + struct fo_flush_cache_test_spec spec[1] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 2; - struct fo_flush_entry_check checks[2] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 2; + struct fo_flush_entry_check checks[2] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - - /* this change forces the moves to move the target entries back to - * their main address. The first test moved them to their alternate - * address. - * - * Note that these two tests are not the same, as in the first test, - * the moved entries are moved forward in the slist. In the second - * they are moved backwards. - */ - if(pass) { - - test_num = 20; - flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - expected_index_len = 0; - expected_index_size = (size_t)0; + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + + /* this change forces the moves to move the target entries back to + * their main address. The first test moved them to their alternate + * address. + * + * Note that these two tests are not the same, as in the first test, + * the moved entries are moved forward in the slist. In the second + * they are moved backwards. + */ + if(pass) { + + test_num = 20; + flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + expected_index_len = 0; + expected_index_size = (size_t)0; spec[0].expected_destroyed = TRUE; - spec[0].flush_ops[2].flag = TRUE; - spec[0].flush_ops[5].flag = TRUE; - checks[0].at_main_addr = TRUE; - checks[0].in_cache = FALSE; - checks[0].expected_destroyed = TRUE; - checks[1].at_main_addr = TRUE; - checks[1].in_cache = FALSE; - checks[1].expected_destroyed = TRUE; + spec[0].flush_ops[2].flag = TRUE; + spec[0].flush_ops[5].flag = TRUE; + checks[0].at_main_addr = TRUE; + checks[0].in_cache = FALSE; + checks[0].expected_destroyed = TRUE; + checks[1].at_main_addr = TRUE; + checks[1].in_cache = FALSE; + checks[1].expected_destroyed = TRUE; check_flush_cache__flush_op_test(file_ptr, test_num, @@ -6856,757 +6856,757 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) init_expected_index_size, expected_index_len, expected_index_size, - check_size, - checks); - } + check_size, + checks); + } } if(pass) /* test #21 */ { - /* Now mix things up a bit. - * - * Load several entries, two of which have flush functions that - * resize, dirty, and move two entries that are not in the - * cache. Mark only one of these entries, and then flush the - * cache with the flush marked entries flag. - * - * This is the only test in which we test the - * H5C__FLUSH_MARKED_ENTRIES_FLAG. The hope is that since - * we test the two features extensively by themselves, so - * it should be sufficient to verify that they play together - * as expected. - */ - int test_num = 21; - unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 4; - unsigned init_expected_index_len = 4; - size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE); - unsigned expected_index_len = 6; - size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + - (VARIABLE_ENTRY_SIZE / 4) + - (VARIABLE_ENTRY_SIZE / 2) + - (2 * PICO_ENTRY_SIZE); - struct fo_flush_cache_test_spec spec[4] = - { + /* Now mix things up a bit. + * + * Load several entries, two of which have flush functions that + * resize, dirty, and move two entries that are not in the + * cache. Mark only one of these entries, and then flush the + * cache with the flush marked entries flag. + * + * This is the only test in which we test the + * H5C__FLUSH_MARKED_ENTRIES_FLAG. The hope is that since + * we test the two features extensively by themselves, so + * it should be sufficient to verify that they play together + * as expected. + */ + int test_num = 21; + unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; + int spec_size = 4; + unsigned init_expected_index_len = 4; + size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE); + unsigned expected_index_len = 6; + size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + + (VARIABLE_ENTRY_SIZE / 4) + + (VARIABLE_ENTRY_SIZE / 2) + + (2 * PICO_ENTRY_SIZE); + struct fo_flush_cache_test_spec spec[4] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 11, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 11, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 2, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 3, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 4; - struct fo_flush_entry_check checks[4] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ TRUE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ TRUE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 2, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 10, - /* expected_size = */ VARIABLE_ENTRY_SIZE, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 3, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 12, - /* expected_size = */ VARIABLE_ENTRY_SIZE, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 4; + struct fo_flush_entry_check checks[4] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ TRUE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ TRUE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 10, + /* expected_size = */ VARIABLE_ENTRY_SIZE, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 12, + /* expected_size = */ VARIABLE_ENTRY_SIZE, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - reset_entries(); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + reset_entries(); } if(pass) /* test #22 */ { - /* Mix things up some more. - * - * Load lots of entries, some of which have flush functions that - * resize, dirty, and move two entries that are not in the - * cache. - * - * Also load entries that have flush ops on entries that are in - * cache. - */ - int test_num = 22; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 6; - unsigned init_expected_index_len = 6; - size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); - unsigned expected_index_len = 10; - size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + - (2 * (VARIABLE_ENTRY_SIZE / 4)) + - (2 * (VARIABLE_ENTRY_SIZE / 2)) + - (4 * PICO_ENTRY_SIZE); - struct fo_flush_cache_test_spec spec[6] = - { + /* Mix things up some more. + * + * Load lots of entries, some of which have flush functions that + * resize, dirty, and move two entries that are not in the + * cache. + * + * Also load entries that have flush ops on entries that are in + * cache. + */ + int test_num = 22; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 6; + unsigned init_expected_index_len = 6; + size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); + unsigned expected_index_len = 10; + size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + + (2 * (VARIABLE_ENTRY_SIZE / 4)) + + (2 * (VARIABLE_ENTRY_SIZE / 2)) + + (4 * PICO_ENTRY_SIZE); + struct fo_flush_cache_test_spec spec[6] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 11, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 11, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 2, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 3, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 4, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { /* entry_num = */ 5, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 4; - struct fo_flush_entry_check checks[4] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 2, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 10, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 3, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 12, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 4; + struct fo_flush_entry_check checks[4] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 10, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 12, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - reset_entries(); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + reset_entries(); } if(pass) /* test #23 */ { - /* Repeat test #23 with the flush invalidate flag set. - * - * Mix things up some more. - * - * Load lots of entries, some of which have flush functions that - * resize, dirty, and move two entries that are not in the - * cache. - * - * Also load entries that have flush ops on entries that are in - * cache. - */ - int test_num = 23; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 6; - unsigned init_expected_index_len = 6; - size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); - unsigned expected_index_len = 0; - size_t expected_index_size = 0; - struct fo_flush_cache_test_spec spec[6] = - { + /* Repeat test #23 with the flush invalidate flag set. + * + * Mix things up some more. + * + * Load lots of entries, some of which have flush functions that + * resize, dirty, and move two entries that are not in the + * cache. + * + * Also load entries that have flush ops on entries that are in + * cache. + */ + int test_num = 23; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 6; + unsigned init_expected_index_len = 6; + size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); + unsigned expected_index_len = 0; + size_t expected_index_size = 0; + struct fo_flush_cache_test_spec spec[6] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 11, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 6, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 11, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 6, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { /* entry_num = */ 2, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 0, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 0, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { /* entry_num = */ 3, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 1, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 1, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { /* entry_num = */ 4, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { /* entry_num = */ 5, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 4; - struct fo_flush_entry_check checks[4] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 0, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 2, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 10, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 3, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 12, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - } - }; + }; + int check_size = 4; + struct fo_flush_entry_check checks[4] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 0, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 2, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 10, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 4, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 3, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 12, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); - reset_entries(); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); + reset_entries(); } /* So much for tests involving only flush operations. @@ -7615,1512 +7615,1512 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) */ if(pass) /* test #24 */ { - /* Pico entries 50 and 150 pin pico entry 100, and also dirty - * pico entry 100 on flush. - */ - int test_num = 24; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 3; - unsigned init_expected_index_len = 3; - size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 3; - size_t expected_index_size = 3 * PICO_ENTRY_SIZE; - struct fo_flush_cache_test_spec spec[3] = - { + /* Pico entries 50 and 150 pin pico entry 100, and also dirty + * pico entry 100 on flush. + */ + int test_num = 24; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 3; + unsigned init_expected_index_len = 3; + size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; + unsigned expected_index_len = 3; + size_t expected_index_size = 3 * PICO_ENTRY_SIZE; + struct fo_flush_cache_test_spec spec[3] = + { { /* entry_num = */ 0, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 1, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 1, - /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 50, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 1, + /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 2, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 150, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 1, - /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, - { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 150, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 1, + /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, + { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #25 */ { - /* Repeat the previous test with the flush invalidate flag. - * - * Pico entries 50 and 150 pin pico entry 100, and also dirty - * pico entry 100 on flush. - */ - int test_num = 25; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 3; - unsigned init_expected_index_len = 3; - size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 0; - size_t expected_index_size = (size_t)0; - struct fo_flush_cache_test_spec spec[3] = - { + /* Repeat the previous test with the flush invalidate flag. + * + * Pico entries 50 and 150 pin pico entry 100, and also dirty + * pico entry 100 on flush. + */ + int test_num = 25; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 3; + unsigned init_expected_index_len = 3; + size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; + unsigned expected_index_len = 0; + size_t expected_index_size = (size_t)0; + struct fo_flush_cache_test_spec spec[3] = + { { /* entry_num = */ 0, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 1, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 1, - /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 50, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 1, + /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 2, /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 150, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 1, - /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, - { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 150, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 1, + /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 1, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, + { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ (size_t)0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ (size_t)0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); } if(pass) /* test #26 */ { - /* This one is complex. - * - * In the following overvies table, VET stands for - * VARIABLE_ENTRY_TYPE. - * - * In trying to follow what happens when we flush the - * set of entries constructed below, recall that each - * flush operation is executed the first time the - * entry is flushed, and then not executed again. - * This may be a weakness in the tests, but that - * is the way it is for now. - * - * After thinking about it for a while, I'm not sure that - * the interaction between pins and flush operations needs - * all that much testing, as the two are essentially - * orthoginal. Thus this is a bit of a smoke check to - * verify that we get the expected results. - * - * (VET, 100) initially not resident in cache - * - * (VET, 200) initially clean and resident in cache - * - * (VET, 300) initially not resident in cache - * - * (VET, 2100) initially clean and resident in cache - * - * (VET, 2200) initially not resident in cache - * - * (VET, 2300) initially clean and resident in cache - * - * (VET, 1000) initially clean, and in cache - * dirties (VET, 100) - * resizes (VET, 200) - * dirty (VET, 300) -- dirty first to bring into cache. - * moves (VET, 300) - * - * (VET, 2000) initially clean, and in cache - * dirties (VET, 2100) - * resizes (VET, 2200) - * moves (VET, 2300) - * - * (VET, 350) initially clean, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * resizes (VET, 350) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 450) initially dirty, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * moves (VET, 450) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 650) initially clean, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * resizes (VET, 650) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 750) initially dirty, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * resizes (VET, 750) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 500) initially dirty, and in cache - * dirties (VET, 350) - * dirties (VET, 450) - * dirties (VET, 650) - * dirties (VET, 750) - */ - int test_num = 26; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 10; - unsigned init_expected_index_len = 10; - size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 13; - size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE; - struct fo_flush_cache_test_spec spec[10] = - { + /* This one is complex. + * + * In the following overvies table, VET stands for + * VARIABLE_ENTRY_TYPE. + * + * In trying to follow what happens when we flush the + * set of entries constructed below, recall that each + * flush operation is executed the first time the + * entry is flushed, and then not executed again. + * This may be a weakness in the tests, but that + * is the way it is for now. + * + * After thinking about it for a while, I'm not sure that + * the interaction between pins and flush operations needs + * all that much testing, as the two are essentially + * orthoginal. Thus this is a bit of a smoke check to + * verify that we get the expected results. + * + * (VET, 100) initially not resident in cache + * + * (VET, 200) initially clean and resident in cache + * + * (VET, 300) initially not resident in cache + * + * (VET, 2100) initially clean and resident in cache + * + * (VET, 2200) initially not resident in cache + * + * (VET, 2300) initially clean and resident in cache + * + * (VET, 1000) initially clean, and in cache + * dirties (VET, 100) + * resizes (VET, 200) + * dirty (VET, 300) -- dirty first to bring into cache. + * moves (VET, 300) + * + * (VET, 2000) initially clean, and in cache + * dirties (VET, 2100) + * resizes (VET, 2200) + * moves (VET, 2300) + * + * (VET, 350) initially clean, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * resizes (VET, 350) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 450) initially dirty, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * moves (VET, 450) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 650) initially clean, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * resizes (VET, 650) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 750) initially dirty, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * resizes (VET, 750) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 500) initially dirty, and in cache + * dirties (VET, 350) + * dirties (VET, 450) + * dirties (VET, 650) + * dirties (VET, 750) + */ + int test_num = 26; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 10; + unsigned init_expected_index_len = 10; + size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 13; + size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE; + struct fo_flush_cache_test_spec spec[10] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 200, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 200, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 2100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 2, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2300, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 2300, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 3, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1000, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 4, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 1000, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 4, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 4, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2000, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 2000, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 5, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 350, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 350, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 6, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 450, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 450, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 7, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 650, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 650, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 8, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 750, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 750, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 9, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 500, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 4, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 500, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 4, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 3; - struct fo_flush_entry_check checks[3] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 100, - /* expected_size = */ VARIABLE_ENTRY_SIZE, - /* in_cache = */ TRUE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 300, - /* expected_size = */ VARIABLE_ENTRY_SIZE, - /* in_cache = */ TRUE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - }, - { - /* entry_num = */ 2, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2200, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ TRUE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE - } - - }; + }; + int check_size = 3; + struct fo_flush_entry_check checks[3] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 100, + /* expected_size = */ VARIABLE_ENTRY_SIZE, + /* in_cache = */ TRUE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 300, + /* expected_size = */ VARIABLE_ENTRY_SIZE, + /* in_cache = */ TRUE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2200, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ TRUE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE + } + + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); - reset_entries(); + reset_entries(); } if(pass) /* test #27 */ { - /* Repeat test #26 with the flush invalidate flag. - * - * In the following overview table, VET stands for - * VARIABLE_ENTRY_TYPE. - * - * In trying to follow what happens when we flush the - * set of entries constructed below, recall that each - * flush operation is executed the first time the - * entry is flushed, and then not executed again. - * This may be a weakness in the tests, but that - * is the way it is for now. - * - * After thinking about it for a while, I'm not sure that - * the interaction between pins and flush operations needs - * all that much testing, as the two are essentially - * orthoginal. The big thing is to verify that flushes of - * pinned entries with flush ops result in the expected - * updates of the cache. - * - * Thus this is a bit of a smoke check to * verify that we - * get the expected results. - * - * (VET, 100) initially not resident in cache - * - * (VET, 200) initially clean and resident in cache - * - * (VET, 300) initially not resident in cache - * - * (VET, 2100) initially clean and resident in cache - * - * (VET, 2200) initially not resident in cache - * - * (VET, 2300) initially clean and resident in cache - * - * (VET, 1000) initially clean, and in cache - * dirties (VET, 100) - * resizes (VET, 200) - * dirty (VET, 300) -- dirty first to bring into cache. - * moves (VET, 300) - * - * (VET, 2000) initially clean, and in cache - * dirties (VET, 2100) - * resizes (VET, 2200) - * moves (VET, 2300) - * - * (VET, 350) initially clean, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * resizes (VET, 350) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 450) initially dirty, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * moves (VET, 450) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 650) initially clean, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * resizes (VET, 650) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 750) initially dirty, and in cache - * pins (VET, 1000) - * dirties (VET, 1000) - * resizes (VET, 750) - * pins (VET, 2000) - * dirties (VET, 2000) - * - * (VET, 500) initially dirty, and in cache - * dirties (VET, 350) - * dirties (VET, 450) - * dirties (VET, 650) - * dirties (VET, 750) - */ - int test_num = 27; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 10; - unsigned init_expected_index_len = 10; - size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 0; - size_t expected_index_size = (size_t)0; - struct fo_flush_cache_test_spec spec[10] = - { + /* Repeat test #26 with the flush invalidate flag. + * + * In the following overview table, VET stands for + * VARIABLE_ENTRY_TYPE. + * + * In trying to follow what happens when we flush the + * set of entries constructed below, recall that each + * flush operation is executed the first time the + * entry is flushed, and then not executed again. + * This may be a weakness in the tests, but that + * is the way it is for now. + * + * After thinking about it for a while, I'm not sure that + * the interaction between pins and flush operations needs + * all that much testing, as the two are essentially + * orthoginal. The big thing is to verify that flushes of + * pinned entries with flush ops result in the expected + * updates of the cache. + * + * Thus this is a bit of a smoke check to * verify that we + * get the expected results. + * + * (VET, 100) initially not resident in cache + * + * (VET, 200) initially clean and resident in cache + * + * (VET, 300) initially not resident in cache + * + * (VET, 2100) initially clean and resident in cache + * + * (VET, 2200) initially not resident in cache + * + * (VET, 2300) initially clean and resident in cache + * + * (VET, 1000) initially clean, and in cache + * dirties (VET, 100) + * resizes (VET, 200) + * dirty (VET, 300) -- dirty first to bring into cache. + * moves (VET, 300) + * + * (VET, 2000) initially clean, and in cache + * dirties (VET, 2100) + * resizes (VET, 2200) + * moves (VET, 2300) + * + * (VET, 350) initially clean, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * resizes (VET, 350) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 450) initially dirty, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * moves (VET, 450) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 650) initially clean, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * resizes (VET, 650) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 750) initially dirty, and in cache + * pins (VET, 1000) + * dirties (VET, 1000) + * resizes (VET, 750) + * pins (VET, 2000) + * dirties (VET, 2000) + * + * (VET, 500) initially dirty, and in cache + * dirties (VET, 350) + * dirties (VET, 450) + * dirties (VET, 650) + * dirties (VET, 750) + */ + int test_num = 27; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 10; + unsigned init_expected_index_len = 10; + size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 0; + size_t expected_index_size = (size_t)0; + struct fo_flush_cache_test_spec spec[10] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 200, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 200, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 2100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 2, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2300, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 2300, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 3, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 1000, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 4, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 1000, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 4, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 4, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2000, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 2000, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 5, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 350, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 350, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 6, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 450, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 450, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 7, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 650, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 650, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 8, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 750, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 2, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 750, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 2, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 9, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 500, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 4, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 500, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 4, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 3; - struct fo_flush_entry_check checks[3] = - { - { - /* entry_num = */ 0, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 100, - /* expected_size = */ VARIABLE_ENTRY_SIZE, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 1, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 300, - /* expected_size = */ VARIABLE_ENTRY_SIZE, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 2, - /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 2200, - /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, - /* in_cache = */ FALSE, - /* at_main_addr = */ TRUE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE - } - - }; + }; + int check_size = 3; + struct fo_flush_entry_check checks[3] = + { + { + /* entry_num = */ 0, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 100, + /* expected_size = */ VARIABLE_ENTRY_SIZE, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 300, + /* expected_size = */ VARIABLE_ENTRY_SIZE, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 2, + /* entry_type = */ VARIABLE_ENTRY_TYPE, + /* entry_index = */ 2200, + /* expected_size = */ VARIABLE_ENTRY_SIZE / 2, + /* in_cache = */ FALSE, + /* at_main_addr = */ TRUE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE + } + + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); - reset_entries(); + reset_entries(); } if(pass) /* test #28 */ { - /* Test the expected fheap case, in which an entry dirties - * and resizes itself, and dirties an entry which it has - * pinned. - */ - int test_num = 28; - unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 5; - unsigned init_expected_index_len = 5; - size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 5; - size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE; - struct fo_flush_cache_test_spec spec[5] = - { + /* Test the expected fheap case, in which an entry dirties + * and resizes itself, and dirties an entry which it has + * pinned. + */ + int test_num = 28; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 5; + unsigned init_expected_index_len = 5; + size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 5; + size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE; + struct fo_flush_cache_test_spec spec[5] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 200, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 2, - /* num_pins = */ 1, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 200, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 2, + /* num_pins = */ 1, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 2, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 300, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 4, - /* num_pins = */ 1, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 300, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 4, + /* num_pins = */ 1, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 3, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 400, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 400, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, - { + { /* entry_num = */ 4, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 500, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 4, - /* num_pins = */ 1, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_index = */ 500, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 4, + /* num_pins = */ 1, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ 0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ 0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); - reset_entries(); + reset_entries(); } if(pass) /* test #29 */ { - /* Repeat test #28 with the flush invalidate flag. - * - * Test the expected fheap case, in which an entry dirties - * and resizes itself, and dirties an entry which it has - * pinned. - */ - int test_num = 29; - unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 5; - unsigned init_expected_index_len = 5; - size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 0; - size_t expected_index_size = 0; - struct fo_flush_cache_test_spec spec[5] = - { + /* Repeat test #28 with the flush invalidate flag. + * + * Test the expected fheap case, in which an entry dirties + * and resizes itself, and dirties an entry which it has + * pinned. + */ + int test_num = 29; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 5; + unsigned init_expected_index_len = 5; + size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; + unsigned expected_index_len = 0; + size_t expected_index_size = 0; + struct fo_flush_cache_test_spec spec[5] = + { { /* entry_num = */ 0, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 1, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 200, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 2, - /* num_pins = */ 1, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 200, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 2, + /* num_pins = */ 1, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 2, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 300, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 4, - /* num_pins = */ 1, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 300, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 4, + /* num_pins = */ 1, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 3, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 400, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* resize_flag = */ FALSE, - /* new_size = */ 0, - /* num_pins = */ 0, - /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 0, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 400, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, + /* new_size = */ 0, + /* num_pins = */ 0, + /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 0, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, - { + { /* entry_num = */ 4, /* entry_type = */ VARIABLE_ENTRY_TYPE, - /* entry_index = */ 500, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* resize_flag = */ TRUE, - /* new_size = */ VARIABLE_ENTRY_SIZE / 4, - /* num_pins = */ 1, - /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, - /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 3, - /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, - { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_deserialized = */ TRUE, - /* expected_serialized = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_index = */ 500, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, + /* new_size = */ VARIABLE_ENTRY_SIZE / 4, + /* num_pins = */ 1, + /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, + /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, + /* num_flush_ops = */ 3, + /* flush_ops = */ + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } - }; - int check_size = 0; - struct fo_flush_entry_check checks[1] = - { - { - /* entry_num = */ 0, - /* entry_type = */ 0, - /* entry_index = */ 0, - /* expected_size = */ 0, - /* in_cache = */ FALSE, - /* at_main_addr = */ FALSE, - /* is_dirty = */ FALSE, - /* is_protected = */ FALSE, - /* is_pinned = */ FALSE, - /* expected_deserialized = */ FALSE, - /* expected_serialized = */ FALSE, - /* expected_destroyed = */ FALSE - } - }; + }; + int check_size = 0; + struct fo_flush_entry_check checks[1] = + { + { + /* entry_num = */ 0, + /* entry_type = */ 0, + /* entry_index = */ 0, + /* expected_size = */ 0, + /* in_cache = */ FALSE, + /* at_main_addr = */ FALSE, + /* is_dirty = */ FALSE, + /* is_protected = */ FALSE, + /* is_pinned = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, spec, - init_expected_index_len, - init_expected_index_size, - expected_index_len, - expected_index_size, - check_size, - checks); + init_expected_index_len, + init_expected_index_size, + expected_index_len, + expected_index_size, + check_size, + checks); - reset_entries(); + reset_entries(); } /* finally finish up with the flush ops eviction test */ @@ -9130,16 +9130,16 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) } /* check_flush_cache__flush_ops() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__flush_op_test() + * Function: check_flush_cache__flush_op_test() * - * Purpose: Run a flush op flush cache test. Of the nature of - * flush operations, this is a multi-entry test. + * Purpose: Run a flush op flush cache test. Of the nature of + * flush operations, this is a multi-entry test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/3/06 * * Modifications: @@ -9153,16 +9153,16 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - unsigned init_expected_index_len, - size_t init_expected_index_size, - unsigned expected_index_len, - size_t expected_index_size, - int check_size, - struct fo_flush_entry_check check[]) + unsigned init_expected_index_len, + size_t init_expected_index_size, + unsigned expected_index_len, + size_t expected_index_size, + int check_size, + struct fo_flush_entry_check check[]) { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; + herr_t result; int i; int j; test_entry_t * base_addr; @@ -9170,7 +9170,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, #if 0 /* This is useful debugging code -- lets keep it around. */ HDfprintf(stdout, "check_flush_cache__flush_op_test: test %d\n", - test_num); + test_num); #endif if(cache_ptr == NULL) { @@ -9208,10 +9208,10 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, (spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || (spec[i].entry_index < 0) || (spec[i].entry_index > max_indices[spec[i].entry_type]) || - (spec[i].num_pins < 0) || - (spec[i].num_pins > MAX_PINS) || - (spec[i].num_flush_ops < 0) || - (spec[i].num_flush_ops > MAX_FLUSH_OPS)) { + (spec[i].num_pins < 0) || + (spec[i].num_pins > MAX_PINS) || + (spec[i].num_flush_ops < 0) || + (spec[i].num_flush_ops > MAX_FLUSH_OPS)) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9234,22 +9234,22 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /* Check for nonsense values if hbool_t is an integral * type instead of a real Boolean. */ - ((check[i].in_cache != TRUE) && - (check[i].in_cache != FALSE)) || - ((check[i].at_main_addr != TRUE) && - (check[i].at_main_addr != FALSE)) || - ((check[i].is_dirty != TRUE) && - (check[i].is_dirty != FALSE)) || - ((check[i].is_protected != TRUE) && - (check[i].is_protected != FALSE)) || - ((check[i].is_pinned != TRUE) && - (check[i].is_pinned != FALSE)) || - ((check[i].expected_deserialized != TRUE) && - (check[i].expected_deserialized != FALSE)) || - ((check[i].expected_serialized != TRUE) && - (check[i].expected_serialized != FALSE)) || - ((check[i].expected_destroyed != TRUE) && - (check[i].expected_destroyed != FALSE)) || + ((check[i].in_cache != TRUE) && + (check[i].in_cache != FALSE)) || + ((check[i].at_main_addr != TRUE) && + (check[i].at_main_addr != FALSE)) || + ((check[i].is_dirty != TRUE) && + (check[i].is_dirty != FALSE)) || + ((check[i].is_protected != TRUE) && + (check[i].is_protected != FALSE)) || + ((check[i].is_pinned != TRUE) && + (check[i].is_pinned != FALSE)) || + ((check[i].expected_deserialized != TRUE) && + (check[i].expected_deserialized != FALSE)) || + ((check[i].expected_serialized != TRUE) && + (check[i].expected_serialized != FALSE)) || + ((check[i].expected_destroyed != TRUE) && + (check[i].expected_destroyed != FALSE)) || #endif /* H5_HAVE_STDBOOL_H */ (check[i].expected_size <= (size_t)0) ) { @@ -9277,32 +9277,32 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if(spec[i].resize_flag) resize_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].new_size, TRUE); + spec[i].new_size, TRUE); unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].flags); + spec[i].flags); } - for (j = 0; j < spec[i].num_pins; j++) - { + for (j = 0; j < spec[i].num_pins; j++) + { create_pinned_entry_dependency(file_ptr, - spec[i].entry_type, - spec[i].entry_index, - spec[i].pin_type[j], - spec[i].pin_idx[j]); - } - - for (j = 0; j < spec[i].num_flush_ops; j++) - { - add_flush_op(spec[i].entry_type, - spec[i].entry_index, - spec[i].flush_ops[j].op_code, - spec[i].flush_ops[j].type, - spec[i].flush_ops[j].idx, - spec[i].flush_ops[j].flag, - spec[i].flush_ops[j].size, + spec[i].entry_type, + spec[i].entry_index, + spec[i].pin_type[j], + spec[i].pin_idx[j]); + } + + for (j = 0; j < spec[i].num_flush_ops; j++) + { + add_flush_op(spec[i].entry_type, + spec[i].entry_index, + spec[i].flush_ops[j].op_code, + spec[i].flush_ops[j].type, + spec[i].flush_ops[j].idx, + spec[i].flush_ops[j].flag, + spec[i].flush_ops[j].size, spec[i].flush_ops[j].order_ptr); - } + } i++; } @@ -9356,8 +9356,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); - HDfprintf(stdout, "entry_ptr->header.is_dirty = %d\n", - (int)(entry_ptr->header.is_dirty)); + HDfprintf(stdout, "entry_ptr->header.is_dirty = %d\n", + (int)(entry_ptr->header.is_dirty)); #endif pass = FALSE; @@ -9374,113 +9374,113 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i = 0; while(pass && (i < check_size)) { - if(check[i].in_cache != entry_in_cache(cache_ptr, - check[i].entry_type, - check[i].entry_index)) { + if(check[i].in_cache != entry_in_cache(cache_ptr, + check[i].entry_type, + check[i].entry_index)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Check1 failed on entry %d after flush op test #%d.", i, test_num); failure_mssg = msg; - } + } base_addr = entries[check[i].entry_type]; entry_ptr = &(base_addr[check[i].entry_index]); - if((entry_ptr->size != check[i].expected_size) || - ((!entry_ptr->header.destroy_in_progress) && - (check[i].in_cache) && - (entry_ptr->header.size != check[i].expected_size)) || - (entry_ptr->at_main_addr != check[i].at_main_addr) || - (entry_ptr->is_dirty != check[i].is_dirty) || - (entry_ptr->header.is_dirty != check[i].is_dirty) || - (entry_ptr->is_protected != check[i].is_protected) || - (entry_ptr->header.is_protected != check[i].is_protected) || + if((entry_ptr->size != check[i].expected_size) || + ((!entry_ptr->header.destroy_in_progress) && + (check[i].in_cache) && + (entry_ptr->header.size != check[i].expected_size)) || + (entry_ptr->at_main_addr != check[i].at_main_addr) || + (entry_ptr->is_dirty != check[i].is_dirty) || + (entry_ptr->header.is_dirty != check[i].is_dirty) || + (entry_ptr->is_protected != check[i].is_protected) || + (entry_ptr->header.is_protected != check[i].is_protected) || (entry_ptr->is_pinned != check[i].is_pinned) || (entry_ptr->header.is_pinned != check[i].is_pinned) || - (entry_ptr->deserialized != check[i].expected_deserialized) || - (entry_ptr->serialized != check[i].expected_serialized) || - (entry_ptr->destroyed != check[i].expected_destroyed)) { + (entry_ptr->deserialized != check[i].expected_deserialized) || + (entry_ptr->serialized != check[i].expected_serialized) || + (entry_ptr->destroyed != check[i].expected_destroyed)) { #if 0 /* This is useful debugging code. Lets keep it around for a while. */ - if(entry_ptr->size != check[i].expected_size) { - HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n", - (int)(entry_ptr->size), - (int)(check[i].expected_size)); - } - if((!entry_ptr->header.destroy_in_progress) && - (check[i].in_cache) && + if(entry_ptr->size != check[i].expected_size) { + HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n", + (int)(entry_ptr->size), + (int)(check[i].expected_size)); + } + if((!entry_ptr->header.destroy_in_progress) && + (check[i].in_cache) && (entry_ptr->header.size != check[i].expected_size)) { HDfprintf(stdout, "(!destroy in progress and in cache and size (expected) = %d (%d).\n", (int)(entry_ptr->header.size), - (int)(check[i].expected_size)); - } - if(entry_ptr->at_main_addr != check[i].at_main_addr) { - HDfprintf(stdout, "(%d,%d) at main addr (expected) = %d (%d).\n", - (int)(check[i].entry_type), - (int)(check[i].entry_index), + (int)(check[i].expected_size)); + } + if(entry_ptr->at_main_addr != check[i].at_main_addr) { + HDfprintf(stdout, "(%d,%d) at main addr (expected) = %d (%d).\n", + (int)(check[i].entry_type), + (int)(check[i].entry_index), (int)(entry_ptr->at_main_addr), - (int)(check[i].at_main_addr)); + (int)(check[i].at_main_addr)); } - if(entry_ptr->is_dirty != check[i].is_dirty) { - HDfprintf(stdout, "entry_ptr->is_dirty (expected) = %d (%d).\n", - (int)(entry_ptr->is_dirty), - (int)(check[i].is_dirty)); - } - if(entry_ptr->header.is_dirty != check[i].is_dirty) { - HDfprintf(stdout, "entry_ptr->header.is_dirty (expected) = %d (%d).\n", - (int)(entry_ptr->header.is_dirty), - (int)(check[i].is_dirty)); - } - if(entry_ptr->is_protected != check[i].is_protected) { + if(entry_ptr->is_dirty != check[i].is_dirty) { + HDfprintf(stdout, "entry_ptr->is_dirty (expected) = %d (%d).\n", + (int)(entry_ptr->is_dirty), + (int)(check[i].is_dirty)); + } + if(entry_ptr->header.is_dirty != check[i].is_dirty) { + HDfprintf(stdout, "entry_ptr->header.is_dirty (expected) = %d (%d).\n", + (int)(entry_ptr->header.is_dirty), + (int)(check[i].is_dirty)); + } + if(entry_ptr->is_protected != check[i].is_protected) { HDfprintf(stdout, "entry_ptr->is_protected (expected) = %d (%d).\n", - (int)(entry_ptr->is_protected), - (int)(check[i].is_protected)); - } - if(entry_ptr->header.is_protected != check[i].is_protected) { + (int)(entry_ptr->is_protected), + (int)(check[i].is_protected)); + } + if(entry_ptr->header.is_protected != check[i].is_protected) { HDfprintf(stdout, "entry_ptr->header.is_protected (expected) = %d (%d).\n", - (int)(entry_ptr->is_protected), - (int)(check[i].is_protected)); - } - if(entry_ptr->is_pinned != check[i].is_pinned) { - HDfprintf(stdout, "entry_ptr->is_pinned (expected) = %d (%d).\n", - (int)(entry_ptr->is_pinned), - (int)(check[i].is_pinned)); - } - if(entry_ptr->header.is_pinned != check[i].is_pinned) { - HDfprintf(stdout, "entry_ptr->header.is_pinned (expected) = %d (%d).\n", - (int)(entry_ptr->header.is_pinned), - (int)(check[i].is_pinned)); - } - if(entry_ptr->deserialized != - check[i].expected_deserialized) { - HDfprintf(stdout, - "entry_ptr->deserialized (expected) = %d (%d).\n", - (int)(entry_ptr->deserialized), - (int)(check[i].expected_deserialized)); - } - if(entry_ptr->serialized != check[i].expected_serialized) { - HDfprintf(stdout, - "entry_ptr->serialized (expected) = %d (%d).\n", - (int)(entry_ptr->serialized), - (int)(check[i].expected_serialized)); - } - if(entry_ptr->destroyed != check[i].expected_destroyed) { - HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n", - (int)(entry_ptr->destroyed), - (int)(check[i].expected_destroyed)); - } + (int)(entry_ptr->is_protected), + (int)(check[i].is_protected)); + } + if(entry_ptr->is_pinned != check[i].is_pinned) { + HDfprintf(stdout, "entry_ptr->is_pinned (expected) = %d (%d).\n", + (int)(entry_ptr->is_pinned), + (int)(check[i].is_pinned)); + } + if(entry_ptr->header.is_pinned != check[i].is_pinned) { + HDfprintf(stdout, "entry_ptr->header.is_pinned (expected) = %d (%d).\n", + (int)(entry_ptr->header.is_pinned), + (int)(check[i].is_pinned)); + } + if(entry_ptr->deserialized != + check[i].expected_deserialized) { + HDfprintf(stdout, + "entry_ptr->deserialized (expected) = %d (%d).\n", + (int)(entry_ptr->deserialized), + (int)(check[i].expected_deserialized)); + } + if(entry_ptr->serialized != check[i].expected_serialized) { + HDfprintf(stdout, + "entry_ptr->serialized (expected) = %d (%d).\n", + (int)(entry_ptr->serialized), + (int)(check[i].expected_serialized)); + } + if(entry_ptr->destroyed != check[i].expected_destroyed) { + HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n", + (int)(entry_ptr->destroyed), + (int)(check[i].expected_destroyed)); + } #endif pass = FALSE; HDsnprintf(msg, (size_t)128, "Check2 failed on entry %d after flush op test #%d.", i, test_num); failure_mssg = msg; - } - i++; + } + i++; } } @@ -9526,8 +9526,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } else if((cache_ptr->index_len != 0) || (cache_ptr->index_size != 0) || - (cache_ptr->clean_index_size != 0) || - (cache_ptr->dirty_index_size != 0)) { + (cache_ptr->clean_index_size != 0) || + (cache_ptr->dirty_index_size != 0)) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9544,7 +9544,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - entry_ptr->size = entry_sizes[spec[i].entry_type]; + entry_ptr->size = entry_sizes[spec[i].entry_type]; entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; @@ -9559,7 +9559,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, base_addr = entries[check[i].entry_type]; entry_ptr = &(base_addr[check[i].entry_index]); - entry_ptr->size = entry_sizes[check[i].entry_type]; + entry_ptr->size = entry_sizes[check[i].entry_type]; entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; @@ -9572,26 +9572,26 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } /* check_flush_cache__flush_op_test() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__flush_op_eviction_test() + * Function: check_flush_cache__flush_op_eviction_test() * - * Purpose: Verify that flush operations work as expected when an + * Purpose: Verify that flush operations work as expected when an * entry is evicted. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/3/06 * * Modifications: * - * Updated test for minor changes in the behaviour - * of H5C__flush_single_entry(). + * Updated test for minor changes in the behaviour + * of H5C__flush_single_entry(). * - * JRM -- 2/16/15 + * JRM -- 2/16/15 * *------------------------------------------------------------------------- */ @@ -9600,11 +9600,11 @@ static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - int i; - int num_variable_entries = 10; - int num_monster_entries = 31; - int num_large_entries = 0; - herr_t result; + int i; + int num_variable_entries = 10; + int num_monster_entries = 31; + int num_large_entries = 0; + herr_t result; test_entry_t * entry_ptr; test_entry_t * base_addr; struct expected_entry_status expected[10 + 31 + 14] = @@ -9614,63 +9614,63 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * array only processes as much of it as it is told to, we don't have to * worry about maintaining the status of entries that we haven't used yet. */ - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 8, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { VARIABLE_ENTRY_TYPE, 9, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 8, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { VARIABLE_ENTRY_TYPE, 9, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; if(pass) { @@ -9689,15 +9689,15 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) || (cache_ptr->min_clean_size != (1 * 1024 * 1024))) { - pass = FALSE; - failure_mssg = - "unexpected cache config at start of flush op eviction test."; + pass = FALSE; + failure_mssg = + "unexpected cache config at start of flush op eviction test."; } else { /* set min clean size to zero for this test as it simplifies - * computing the expected cache size after each operation. - */ + * computing the expected cache size after each operation. + */ cache_ptr->min_clean_size = 0; } @@ -9710,112 +9710,112 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * other entries into the cache until the cache is full. At * that point, load yet more entries into the cache, and see * if the flush operations are performed as expected. - * - * To make things a bit more interesting, we also include a - * couple of pins. + * + * To make things a bit more interesting, we also include a + * couple of pins. */ - /* reset the stats before we start. If stats are enabled, we will - * check to see if they are as expected at the end. - */ - H5C_stats__reset(cache_ptr); + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); - /* load a few entries with pin relationships and flush ops. - * Start by just loading the entries. - */ + /* load a few entries with pin relationships and flush ops. + * Start by just loading the entries. + */ - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, (VARIABLE_ENTRY_SIZE / 4), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, (VARIABLE_ENTRY_SIZE / 4), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, (VARIABLE_ENTRY_SIZE / 4), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, (VARIABLE_ENTRY_SIZE / 4), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, (VARIABLE_ENTRY_SIZE / 2), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, (VARIABLE_ENTRY_SIZE / 2), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET); - protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET); - if((cache_ptr->index_len != 10) || + if((cache_ptr->index_len != 10) || (cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 4)) + - (2 * (VARIABLE_ENTRY_SIZE / 2)) + - (4 * VARIABLE_ENTRY_SIZE))) { - - pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 1."; - } - } - - if(pass) { - - /* Now set up the pinning relationships: - * - * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5) - * (VET, 9) is pinned by (VET, 5), and (VET, 7) - */ - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1, - VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, - VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, - VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, - VARIABLE_ENTRY_TYPE, 9); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7, - VARIABLE_ENTRY_TYPE, 9); - - /* Next, set up the flush operations: - * - * Briefly, (VET, 1) dirties (VET, 0) - * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE - * - * (VET, 3) dirties (VET, 0) - * resizes (VET, 0) to VARIABLE_ENTRY_SIZE - * moves (VET, 0) to its alternate address - * - * (VET, 5) dirties (VET, 0) - * resizes itself to VARIABLE_ENTRY_SIZE / 2 + (2 * (VARIABLE_ENTRY_SIZE / 2)) + + (4 * VARIABLE_ENTRY_SIZE))) { + + pass = FALSE; + failure_mssg = "unexpected size/len in flush op eviction test 1."; + } + } + + if(pass) { + + /* Now set up the pinning relationships: + * + * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5) + * (VET, 9) is pinned by (VET, 5), and (VET, 7) + */ + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1, + VARIABLE_ENTRY_TYPE, 0); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, + VARIABLE_ENTRY_TYPE, 0); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, + VARIABLE_ENTRY_TYPE, 0); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, + VARIABLE_ENTRY_TYPE, 9); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7, + VARIABLE_ENTRY_TYPE, 9); + + /* Next, set up the flush operations: + * + * Briefly, (VET, 1) dirties (VET, 0) + * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE + * + * (VET, 3) dirties (VET, 0) + * resizes (VET, 0) to VARIABLE_ENTRY_SIZE + * moves (VET, 0) to its alternate address + * + * (VET, 5) dirties (VET, 0) + * resizes itself to VARIABLE_ENTRY_SIZE / 2 * * (VET, 7) dirties (VET, 9) - * - * (VET, 9) dirties (VET, 8) - */ + * + * (VET, 9) dirties (VET, 8) + */ add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, TRUE, - 3 * VARIABLE_ENTRY_SIZE / 4, NULL); + 3 * VARIABLE_ENTRY_SIZE / 4, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); @@ -9838,648 +9838,648 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - /* to summarize, at present the following variable size entries - * are in cache with the following characteristics: - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 2.5 KB Y Y - - - * - * (VET, 1) Y 2.5 KB Y N 0 dirty (VET, 0), - * resize (VET, 0) to 7.5 KB - * - * (VET, 2) Y 10 KB N N - - - * - * - * (VET, 3) Y 2.5 KB N N 0 dirty (VET, 0) - * resize (VET, 0) to 10 KB - * move (VET, 0) to its alternate address - * - * (VET, 4) Y 10 KB N N - - - * - * - * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) - * resize (VET, 5) to 5 KB - * - * (VET, 6) Y 5 KB Y N - - - * - * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) - * - * (VET, 8) Y 10 KB N N - - - * - * (VET, 9) Y 10 KB N N - dirty (VET, 8) - * - * Recall that in this test bed, flush operations are excuted the - * first time the associated entry is flushed, and are then - * deleted. - */ + /* to summarize, at present the following variable size entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 2.5 KB Y Y - - + * + * (VET, 1) Y 2.5 KB Y N 0 dirty (VET, 0), + * resize (VET, 0) to 7.5 KB + * + * (VET, 2) Y 10 KB N N - - + * + * + * (VET, 3) Y 2.5 KB N N 0 dirty (VET, 0) + * resize (VET, 0) to 10 KB + * move (VET, 0) to its alternate address + * + * (VET, 4) Y 10 KB N N - - + * + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB + * + * (VET, 6) Y 5 KB Y N - - + * + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) + * + * (VET, 8) Y 10 KB N N - - + * + * (VET, 9) Y 10 KB N N - dirty (VET, 8) + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ /* Now fill up the cache with other, unrelated entries */ - for (i = 0; i < 31; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 0; i < 31; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - for (i = 0; i < 1; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 0; i < 1; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - /* The cache should now be exactly full */ - if((cache_ptr->index_len != 42) || + /* The cache should now be exactly full */ + if((cache_ptr->index_len != 42) || (cache_ptr->index_size != 2 * 1024 * 1024) || - (cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 4) + - (2 * VARIABLE_ENTRY_SIZE / 2) + - (4 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (1 * LARGE_ENTRY_SIZE)))) { + (cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + + (4 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (1 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 2."; + failure_mssg = "unexpected size/len in flush op eviction test 2."; - } else { + } else { - /* verify the expected status of all entries we have loaded to date: */ + /* verify the expected status of all entries we have loaded to date: */ num_large_entries = 1; - verify_entry_status(cache_ptr, - 0, - (num_variable_entries + num_monster_entries + num_large_entries), - expected); - } - } - - if(pass) { - - /* Now load a large entry. This should result in the eviction - * of (VET,2), and the increase in the size of (VET, 0) from .25 - * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE. - * - * The following table illustrates the intended state of affairs - * after the eviction: - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 7.5 KB Y Y - - - * - * (VET, 1) Y 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) Y 2.5 KB Y N 0 dirty (VET, 0) - * resize (VET, 0) to 10 KB - * move (VET, 0) to its alternate address - * - * (VET, 4) Y 10 KB N N - - - * - * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) - * resize (VET, 5) to 5 KB - * - * (VET, 6) Y 5 KB Y N - - - * - * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) - * - * (VET, 8) Y 10 KB N N - - - * - * (VET, 9) Y 10 KB N Y - dirty (VET, 8) - * - * Start by updating the expected table for the expected changes in entry status: - */ - expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4; - expected[1].is_dirty = FALSE; - expected[1].serialized = TRUE; - expected[2].in_cache = FALSE; - expected[2].destroyed = TRUE; + verify_entry_status(cache_ptr, + 0, + (num_variable_entries + num_monster_entries + num_large_entries), + expected); + } + } + + if(pass) { + + /* Now load a large entry. This should result in the eviction + * of (VET,2), and the increase in the size of (VET, 0) from .25 + * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE. + * + * The following table illustrates the intended state of affairs + * after the eviction: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 7.5 KB Y Y - - + * + * (VET, 1) Y 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) Y 2.5 KB Y N 0 dirty (VET, 0) + * resize (VET, 0) to 10 KB + * move (VET, 0) to its alternate address + * + * (VET, 4) Y 10 KB N N - - + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB + * + * (VET, 6) Y 5 KB Y N - - + * + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) + * + * (VET, 8) Y 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) + * + * Start by updating the expected table for the expected changes in entry status: + */ + expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4; + expected[1].is_dirty = FALSE; + expected[1].serialized = TRUE; + expected[2].in_cache = FALSE; + expected[2].destroyed = TRUE; num_large_entries = 2; - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); - if((cache_ptr->index_len != 42) || + if((cache_ptr->index_len != 42) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (VARIABLE_ENTRY_SIZE) + - (VARIABLE_ENTRY_SIZE / 2) + - (LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((1 * (3 * VARIABLE_ENTRY_SIZE / 4)) + - (3 * VARIABLE_ENTRY_SIZE / 4) + - (2 * VARIABLE_ENTRY_SIZE / 2) + - (3 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (2 * LARGE_ENTRY_SIZE)))) { - pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 3."; - } - - /* verify entry status */ - verify_entry_status(cache_ptr, - 1, + (VARIABLE_ENTRY_SIZE) + + (VARIABLE_ENTRY_SIZE / 2) + + (LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((1 * (3 * VARIABLE_ENTRY_SIZE / 4)) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + + (3 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (2 * LARGE_ENTRY_SIZE)))) { + pass = FALSE; + failure_mssg = "unexpected size/len in flush op eviction test 3."; + } + + /* verify entry status */ + verify_entry_status(cache_ptr, + 1, (num_variable_entries + num_monster_entries + num_large_entries), - expected); - } - - if(pass) { - - /* Now load another large entry. This should result in the eviction - * of (VET, 4), the increase in the size of (VET, 0) from .75 - * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming - * of (VET, 0) to its alternate address. - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 10 KB Y Y - - - * - * (VET, 1) Y 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) Y 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) - * resize (VET, 5) to 5 KB - * - * (VET, 6) Y 5 KB Y N - - - * - * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) - * - * (VET, 8) Y 10 KB N N - - - * - * (VET, 9) Y 10 KB N Y - dirty (VET, 8) - * - * Start by updating the expected table for the expected changes in entry status: - */ - expected[0].size = VARIABLE_ENTRY_SIZE; - expected[0].at_main_addr = FALSE; - expected[3].is_dirty = FALSE; - expected[3].serialized = TRUE; - expected[4].in_cache = FALSE; - expected[4].destroyed = TRUE; + expected); + } + + if(pass) { + + /* Now load another large entry. This should result in the eviction + * of (VET, 4), the increase in the size of (VET, 0) from .75 + * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming + * of (VET, 0) to its alternate address. + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 10 KB Y Y - - + * + * (VET, 1) Y 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) Y 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB + * + * (VET, 6) Y 5 KB Y N - - + * + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) + * + * (VET, 8) Y 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) + * + * Start by updating the expected table for the expected changes in entry status: + */ + expected[0].size = VARIABLE_ENTRY_SIZE; + expected[0].at_main_addr = FALSE; + expected[3].is_dirty = FALSE; + expected[3].serialized = TRUE; + expected[4].in_cache = FALSE; + expected[4].destroyed = TRUE; num_large_entries = 3; - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG); - if((cache_ptr->index_len != 42) || + if((cache_ptr->index_len != 42) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (2 * VARIABLE_ENTRY_SIZE) + - (3 * VARIABLE_ENTRY_SIZE / 4) + - (2 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 4) + - (2 * VARIABLE_ENTRY_SIZE / 2) + - (3 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (3 * LARGE_ENTRY_SIZE)))) { - - pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 4."; - } - - /* verify entry status */ - verify_entry_status(cache_ptr, - 2, + (2 * VARIABLE_ENTRY_SIZE) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + + (3 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (3 * LARGE_ENTRY_SIZE)))) { + + pass = FALSE; + failure_mssg = "unexpected size/len in flush op eviction test 4."; + } + + /* verify entry status */ + verify_entry_status(cache_ptr, + 2, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { - /* load two more large entries. This should result in (VET, 5) being - * flushed, and increasing its size from 1/4 VARIABLE_ENTRY_SIZE to - * VARIABLE_ENTRY_SIZE. - * - * As a result of this size increase, the cache will have to look - * for another entry to evict. After flushing (VET, 6) and (VET, 7), - * it should evict (VET, 8), yielding the needed memory and dirtying + /* load two more large entries. This should result in (VET, 5) being + * flushed, and increasing its size from 1/4 VARIABLE_ENTRY_SIZE to + * VARIABLE_ENTRY_SIZE. + * + * As a result of this size increase, the cache will have to look + * for another entry to evict. After flushing (VET, 6) and (VET, 7), + * it should evict (VET, 8), yielding the needed memory and dirtying * (VET, 9). - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 10 KB Y Y - - - * - * (VET, 1) Y 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) Y 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) Y 5 KB N N 0, 9 - - * - * (VET, 6) Y 5 KB N N - - - * - * (VET, 7) Y 5 KB N N 9 - - * - * (VET, 8) N 10 KB N N - - - * - * (VET, 9) Y 10 KB N Y - dirty (VET, 8) - * - * Start by updating the expected table for the expected changes in entry status: - */ - - expected[5].size = VARIABLE_ENTRY_SIZE / 2; - expected[5].is_dirty = FALSE; - expected[5].serialized = TRUE; - expected[6].is_dirty = FALSE; - expected[6].serialized = TRUE; - expected[7].is_dirty = FALSE; - expected[7].serialized = TRUE; - expected[8].in_cache = FALSE; - expected[8].destroyed = TRUE; - expected[9].is_dirty = TRUE; + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 10 KB Y Y - - + * + * (VET, 1) Y 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) Y 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) Y 5 KB N N 0, 9 - + * + * (VET, 6) Y 5 KB N N - - + * + * (VET, 7) Y 5 KB N N 9 - + * + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) + * + * Start by updating the expected table for the expected changes in entry status: + */ + + expected[5].size = VARIABLE_ENTRY_SIZE / 2; + expected[5].is_dirty = FALSE; + expected[5].serialized = TRUE; + expected[6].is_dirty = FALSE; + expected[6].serialized = TRUE; + expected[7].is_dirty = FALSE; + expected[7].serialized = TRUE; + expected[8].in_cache = FALSE; + expected[8].destroyed = TRUE; + expected[9].is_dirty = TRUE; num_large_entries = 5; - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 4); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 4); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); /* verify cache size */ - if((cache_ptr->index_len != 43) || + if((cache_ptr->index_len != 43) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (3 * VARIABLE_ENTRY_SIZE) + - (1 * VARIABLE_ENTRY_SIZE / 4) + - (3 * VARIABLE_ENTRY_SIZE / 4) + - (4 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + - (3 * VARIABLE_ENTRY_SIZE / 2) + - (2 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (5 * LARGE_ENTRY_SIZE)))) { - - pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 5."; - } - - /* verify entry status */ - verify_entry_status(cache_ptr, - 3, + (3 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (4 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (5 * LARGE_ENTRY_SIZE)))) { + + pass = FALSE; + failure_mssg = "unexpected size/len in flush op eviction test 5."; + } + + /* verify entry status */ + verify_entry_status(cache_ptr, + 3, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { /* now touch all the non VARIABLE_ENTRY_TYPE entries in the - * cache to bring all the VARIABLE_ENTRY_TYPE entries to the - * end of the LRU list. - * - * Note that we don't have to worry about (VET, 0) and (VET, 9) - * as they are pinned and thus not in the LRU list to begin with. - */ - for (i = 0; i < 31; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + * cache to bring all the VARIABLE_ENTRY_TYPE entries to the + * end of the LRU list. + * + * Note that we don't have to worry about (VET, 0) and (VET, 9) + * as they are pinned and thus not in the LRU list to begin with. + */ + for (i = 0; i < 31; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - for (i = 0; i < 5; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 0; i < 5; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 43) || + if((cache_ptr->index_len != 43) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (3 * VARIABLE_ENTRY_SIZE) + - (1 * VARIABLE_ENTRY_SIZE / 4) + - (3 * VARIABLE_ENTRY_SIZE / 4) + - (4 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + - (3 * VARIABLE_ENTRY_SIZE / 2) + - (2 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (5 * LARGE_ENTRY_SIZE)))) { - - pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 6."; - } - - /* verify entry status */ - verify_entry_status(cache_ptr, - 4, + (3 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (4 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (5 * LARGE_ENTRY_SIZE)))) { + + pass = FALSE; + failure_mssg = "unexpected size/len in flush op eviction test 6."; + } + + /* verify entry status */ + verify_entry_status(cache_ptr, + 4, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { - /* Now load three more large entries. This should result - * in the evictions of (VET, 1), (VET, 3), and (VET, 5), and the + /* Now load three more large entries. This should result + * in the evictions of (VET, 1), (VET, 3), and (VET, 5), and the * unpinning of (VET, 0) - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 10 KB Y N - - - * - * (VET, 1) N 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) N 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) N 5 KB N N - - - * - * (VET, 6) Y 5 KB N N - - - * - * (VET, 7) Y 5 KB N N 9 - - * - * (VET, 8) N 10 KB N N - - - * - * (VET, 9) Y 10 KB N Y - dirty (VET, 8) - * - * Start by updating the expected table for the expected changes in entry status: - */ - - expected[0].is_pinned = FALSE; - expected[1].in_cache = FALSE; - expected[1].destroyed = TRUE; - expected[3].in_cache = FALSE; - expected[3].destroyed = TRUE; - expected[5].in_cache = FALSE; - expected[5].destroyed = TRUE; + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 10 KB Y N - - + * + * (VET, 1) N 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) Y 5 KB N N - - + * + * (VET, 7) Y 5 KB N N 9 - + * + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) + * + * Start by updating the expected table for the expected changes in entry status: + */ + + expected[0].is_pinned = FALSE; + expected[1].in_cache = FALSE; + expected[1].destroyed = TRUE; + expected[3].in_cache = FALSE; + expected[3].destroyed = TRUE; + expected[5].in_cache = FALSE; + expected[5].destroyed = TRUE; num_large_entries = 8; - for (i = 5; i < 8; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 5; i < 8; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 43) || + if((cache_ptr->index_len != 43) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (4 * VARIABLE_ENTRY_SIZE) + - (1 * VARIABLE_ENTRY_SIZE / 4) + - (3 * VARIABLE_ENTRY_SIZE / 4) + - (7 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) + - (2 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (8 * LARGE_ENTRY_SIZE)))) { - - pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 7."; - } - - /* verify entry status */ - verify_entry_status(cache_ptr, - 5, + (4 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (7 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (8 * LARGE_ENTRY_SIZE)))) { + + pass = FALSE; + failure_mssg = "unexpected size/len in flush op eviction test 7."; + } + + /* verify entry status */ + verify_entry_status(cache_ptr, + 5, (num_variable_entries + num_monster_entries + num_large_entries), - expected); - } - - if(pass) { - - /* load another large entry. (VET, 6) should be evicted. - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 10 KB Y N - - - * - * (VET, 1) N 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) N 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) N 5 KB N N - - - * - * (VET, 6) N 5 KB N N - - - * - * (VET, 7) Y 5 KB N N 9 - - * - * (VET, 8) N 10 KB N N - - - * - * (VET, 9) Y 10 KB N Y - dirty (VET, 8) - * - * Start by updating the expected table for the expected changes in entry status: - */ - - expected[6].in_cache = FALSE; - expected[6].destroyed = TRUE; + expected); + } + + if(pass) { + + /* load another large entry. (VET, 6) should be evicted. + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 10 KB Y N - - + * + * (VET, 1) N 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) N 5 KB N N - - + * + * (VET, 7) Y 5 KB N N 9 - + * + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) + * + * Start by updating the expected table for the expected changes in entry status: + */ + + expected[6].in_cache = FALSE; + expected[6].destroyed = TRUE; num_large_entries = 9; - for (i = 8; i < 9; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 8; i < 9; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 43) || + if((cache_ptr->index_len != 43) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (3 * VARIABLE_ENTRY_SIZE) - - (VARIABLE_ENTRY_SIZE / 2) + - (8 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE / 2) + - (2 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (9 * LARGE_ENTRY_SIZE)))) { + (3 * VARIABLE_ENTRY_SIZE) - + (VARIABLE_ENTRY_SIZE / 2) + + (8 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (9 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 8."; - } + failure_mssg = "unexpected size/len in flush op eviction test 8."; + } - /* verify entry status */ - verify_entry_status(cache_ptr, - 6, + /* verify entry status */ + verify_entry_status(cache_ptr, + 6, (num_variable_entries + num_monster_entries + num_large_entries), - expected); - } - - if(pass) { - - /* Load another large entry. - * - * (VET, 7) should be evicted, and (VET, 9) should be unpinned. - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) Y 10 KB Y N - - - * - * (VET, 1) N 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) N 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) N 5 KB N N - - - * - * (VET, 6) N 5 KB N N - - - * - * (VET, 7) N 5 KB N N - - - * - * (VET, 8) N 10 KB N N - - - * - * (VET, 9) Y 10 KB Y N - dirty (VET, 8) - * - * Start by updating the expected table for the expected changes in entry status: - */ - - expected[7].in_cache = FALSE; - expected[7].destroyed = TRUE; - expected[9].is_pinned = FALSE; + expected); + } + + if(pass) { + + /* Load another large entry. + * + * (VET, 7) should be evicted, and (VET, 9) should be unpinned. + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) Y 10 KB Y N - - + * + * (VET, 1) N 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) N 5 KB N N - - + * + * (VET, 7) N 5 KB N N - - + * + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB Y N - dirty (VET, 8) + * + * Start by updating the expected table for the expected changes in entry status: + */ + + expected[7].in_cache = FALSE; + expected[7].destroyed = TRUE; + expected[9].is_pinned = FALSE; num_large_entries = 10; - for (i = 9; i < 10; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 9; i < 10; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 43) || + if((cache_ptr->index_len != 43) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (4 * VARIABLE_ENTRY_SIZE) + - (9 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (10 * LARGE_ENTRY_SIZE)))) { + (4 * VARIABLE_ENTRY_SIZE) + + (9 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (10 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 9."; - } + failure_mssg = "unexpected size/len in flush op eviction test 9."; + } - /* verify entry status */ - verify_entry_status(cache_ptr, - 7, + /* verify entry status */ + verify_entry_status(cache_ptr, + 7, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { /* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the - * cache to bring all the VARIABLE_ENTRY_TYPE entries to the - * end of the LRU list. - * - * Both (VET, 0) and (VET, 7) have been unpinned, so they are - * now in the LRU list. - */ - for (i = 0; i < 31; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + * cache to bring all the VARIABLE_ENTRY_TYPE entries to the + * end of the LRU list. + * + * Both (VET, 0) and (VET, 7) have been unpinned, so they are + * now in the LRU list. + */ + for (i = 0; i < 31; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - for (i = 0; i < 10; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 0; i < 10; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 43) || + if((cache_ptr->index_len != 43) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (4 * VARIABLE_ENTRY_SIZE) + - (9 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (10 * LARGE_ENTRY_SIZE)))) { + (4 * VARIABLE_ENTRY_SIZE) + + (9 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (10 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 10."; - } + failure_mssg = "unexpected size/len in flush op eviction test 10."; + } - /* verify entry status */ - verify_entry_status(cache_ptr, - 8, + /* verify entry status */ + verify_entry_status(cache_ptr, + 8, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { - /* load two more large entries. Things get a bit complicated here, - * so I'll go through the operation step by step. + /* load two more large entries. Things get a bit complicated here, + * so I'll go through the operation step by step. * * Initially, the cache has 4 KB of empty space, so the first entry - * (LET, 10) is loaded via calls to H5C_protect() H5C_unprotect() - * without causing any evictions. + * (LET, 10) is loaded via calls to H5C_protect() H5C_unprotect() + * without causing any evictions. * * However, this is not the case for the call of H5C_protect() on - * (LET, 11). + * (LET, 11). * * Before inserting (LET, 11), H5C_protect(LET, 11) must try to - * free up at least 4 KB of space. To do this, it starts scanning - * up the LRU list to find entries to evict. + * free up at least 4 KB of space. To do this, it starts scanning + * up the LRU list to find entries to evict. * * (VET, 0) is at the bottom of the LRU list, and thus is the first - * entry considered. However, it is dirty, so it flushed to disk, + * entry considered. However, it is dirty, so it flushed to disk, * moved to the top of the LRU list, and marked clean. * * (VET, 9) is the next entry on the bottom of the LRU list. It is - * dirty too, calls its serialize callback function to construct an - * on disk image of the entry, and moves it to the top of the LRU + * dirty too, calls its serialize callback function to construct an + * on disk image of the entry, and moves it to the top of the LRU * list after the serialize callback returns. * - * However, (VET 9)'s serialize function needs to modify (VET, 8), + * However, (VET 9)'s serialize function needs to modify (VET, 8), * which is currently not in cache. Thus it calls H5C_protect(VET, 8) - * to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and - * then attempts to evict entries to make space for it. + * to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and + * then attempts to evict entries to make space for it. * * However, H5C_make_space_in_cache() now exits without taking * any action on re-entrant calls. Thus H5C_protect(VET, 8) simply * loads the entry into the cache -- resulting in a cache that is - * 10 KB oversize. The subsequent unprotect puts (VET, 8) at the + * 10 KB oversize. The subsequent unprotect puts (VET, 8) at the * head of the LRU and marks it dirty. * - * After (VET, 9) is serialized, it is flushed, and moved to the + * After (VET, 9) is serialized, it is flushed, and moved to the * head of the LRU. * - * At this point, the H5C_make_space_in_cache() call made by + * At this point, the H5C_make_space_in_cache() call made by * H5C_protect(LET, 11) now has 14 KB of space to make. * * The next entries on the LRU are (MET, 0) thru (MET, 30), - * (LET, 0) thru (LET, 10), and (VET, 8) -- all of which are dirty, + * (LET, 0) thru (LET, 10), and (VET, 8) -- all of which are dirty, * and are therefore flushed and moved to the head of the LRU list. * * The next entry on the bottom of the LRU list is (VET, 0), which - * is clean, and is therefore evicted, leaving H5C_make_space_in_cache() + * is clean, and is therefore evicted, leaving H5C_make_space_in_cache() * with 4 KB of space to create. * - * This space is sufficient, so H5C_protect(VET, 8) inserts - * (VET, 8) into the cache's index, marks it as protected, and - * returns to the serialize function for (VET, 9). + * This space is sufficient, so H5C_protect(VET, 8) inserts + * (VET, 8) into the cache's index, marks it as protected, and + * returns to the serialize function for (VET, 9). * * When the serialize function for (VET, 9) is done with (VET, 8), it * calls H5C_unprotect(VET, 8), which markes (VET, 8) as dirty and @@ -10489,101 +10489,101 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * evicted -- leaving 6 KB of free space after (LET, 11) is inserted * into the cache. * - * H5C_unprotect(LET, 11) marks (LET, 11) as unprotected, and then - * returns as well. - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) N 10 KB N N - - - * - * (VET, 1) N 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) N 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) N 5 KB N N - - - * - * (VET, 6) N 5 KB N N - - - * - * (VET, 7) N 5 KB N N - - - * - * (VET, 8) Y 10 KB N N - - - * - * (VET, 9) N 10 KB N N - - - * - * Start by updating the expected table for the expected changes in - * entry status: - * - * Note that we reset the loaded, flushed, and destroyed - * fields of (VET,8) so we can track what is happening. - */ - base_addr = entries[VARIABLE_ENTRY_TYPE]; - entry_ptr = &(base_addr[8]); - entry_ptr->deserialized = FALSE; - entry_ptr->deserialized = FALSE; - entry_ptr->destroyed = FALSE; - - expected[0].in_cache = FALSE; - expected[0].is_dirty = FALSE; - expected[0].serialized = TRUE; - expected[0].destroyed = TRUE; - expected[8].in_cache = TRUE; - expected[8].is_dirty = FALSE; - expected[8].deserialized = TRUE; - expected[8].serialized = TRUE; - expected[8].destroyed = FALSE; - expected[9].in_cache = FALSE; - expected[9].is_dirty = FALSE; - expected[9].serialized = TRUE; - expected[9].destroyed = TRUE; - - expected[10].in_cache = TRUE; - expected[10].is_dirty = FALSE; - expected[10].serialized = TRUE; - expected[10].destroyed = FALSE; + * H5C_unprotect(LET, 11) marks (LET, 11) as unprotected, and then + * returns as well. + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) N 10 KB N N - - + * + * (VET, 1) N 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) N 5 KB N N - - + * + * (VET, 7) N 5 KB N N - - + * + * (VET, 8) Y 10 KB N N - - + * + * (VET, 9) N 10 KB N N - - + * + * Start by updating the expected table for the expected changes in + * entry status: + * + * Note that we reset the loaded, flushed, and destroyed + * fields of (VET,8) so we can track what is happening. + */ + base_addr = entries[VARIABLE_ENTRY_TYPE]; + entry_ptr = &(base_addr[8]); + entry_ptr->deserialized = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->destroyed = FALSE; + + expected[0].in_cache = FALSE; + expected[0].is_dirty = FALSE; + expected[0].serialized = TRUE; + expected[0].destroyed = TRUE; + expected[8].in_cache = TRUE; + expected[8].is_dirty = FALSE; + expected[8].deserialized = TRUE; + expected[8].serialized = TRUE; + expected[8].destroyed = FALSE; + expected[9].in_cache = FALSE; + expected[9].is_dirty = FALSE; + expected[9].serialized = TRUE; + expected[9].destroyed = TRUE; + + expected[10].in_cache = TRUE; + expected[10].is_dirty = FALSE; + expected[10].serialized = TRUE; + expected[10].destroyed = FALSE; num_large_entries = 12; - for (i = num_variable_entries; - i < num_variable_entries + num_monster_entries + num_large_entries - 1; - i++) - { + for (i = num_variable_entries; + i < num_variable_entries + num_monster_entries + num_large_entries - 1; + i++) + { expected[i].is_dirty = FALSE; - expected[i].serialized = TRUE; - } + expected[i].serialized = TRUE; + } - for (i = 10; i < 12; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 10; i < 12; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 44) || + if((cache_ptr->index_len != 44) || (cache_ptr->index_size != (2 * 1024 * 1024) - (2 * 1024) - (1 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (12 * LARGE_ENTRY_SIZE)))) { + (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (12 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 11."; - } + failure_mssg = "unexpected size/len in flush op eviction test 11."; + } - /* verify entry status */ - verify_entry_status(cache_ptr, - 9, - (num_variable_entries + num_monster_entries + + /* verify entry status */ + verify_entry_status(cache_ptr, + 9, + (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { @@ -10592,8 +10592,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET); - /* protect and unprotect VET 8 to dirty it and move it to the - * top of the LRU. Since we are dirtying it again, reset its + /* protect and unprotect VET 8 to dirty it and move it to the + * top of the LRU. Since we are dirtying it again, reset its * serialized flag. */ base_addr = entries[VARIABLE_ENTRY_TYPE]; @@ -10605,14 +10605,14 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the - * cache to evict VET 9 and move VET 8 to the bottom of the LRU. + * cache to evict VET 9 and move VET 8 to the bottom of the LRU. * * Must do this twice to get the desired result. - */ + */ - /* skip MET 0 in first pass so that we evict VET 9 when we - * reload MET 0 + /* skip MET 0 in first pass so that we evict VET 9 when we + * reload MET 0 * * Since we are reloading MET 0, reset its destroyed flag. */ @@ -10620,40 +10620,40 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) entry_ptr = &(base_addr[0]); entry_ptr->destroyed = FALSE; - for (i = 1; i < num_monster_entries; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 1; i < num_monster_entries; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - for (i = 0; i < num_large_entries; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 0; i < num_large_entries; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - for (i = 0; i < num_monster_entries; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 0; i < num_monster_entries; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - for (i = 0; i < num_large_entries; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 0; i < num_large_entries; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - /* update the expected array to mark all these entries dirty again. */ - for (i = num_variable_entries; - i < num_variable_entries + num_monster_entries + num_large_entries - 1; - i++) - { + /* update the expected array to mark all these entries dirty again. */ + for (i = num_variable_entries; + i < num_variable_entries + num_monster_entries + num_large_entries - 1; + i++) + { expected[i].is_dirty = TRUE; - } + } - /* update MET 0 to set its in cache flag, and reset - * its destroyed flag + /* update MET 0 to set its in cache flag, and reset + * its destroyed flag */ expected[10].in_cache = TRUE; @@ -10671,118 +10671,118 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* verify cache size */ - if((cache_ptr->index_len != 44) || + if((cache_ptr->index_len != 44) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (5 * VARIABLE_ENTRY_SIZE) + - (11 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + - (12 * LARGE_ENTRY_SIZE)))) { + (5 * VARIABLE_ENTRY_SIZE) + + (11 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (12 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 12."; - } + failure_mssg = "unexpected size/len in flush op eviction test 12."; + } - /* modifications to the H5C__flush_single_entry() function have - * changed the behavior of the cache slightly, causing - * this test to fail. Comment out for now -- come back and + /* modifications to the H5C__flush_single_entry() function have + * changed the behavior of the cache slightly, causing + * this test to fail. Comment out for now -- come back and * fix if all goes well. */ - /* verify entry status */ - verify_entry_status(cache_ptr, - 10, + /* verify entry status */ + verify_entry_status(cache_ptr, + 10, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } if(pass) { /* Load two more large entries. - * - * Since (VET, 8) is dirty, at first this will just cause (VET, 8) - * to be flushed. - * - * But all other entries in the cache are dirty, so the cache will - * flush them all, and then evict (VET, 8) on the second pass. - * - * The following table shows the expected states of the variable - * size entries after the test. - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (VET, 0) N 10 KB N N - - - * - * (VET, 1) N 2.5 KB N N - - - * - * (VET, 2) N 10 KB N N - - - * - * (VET, 3) N 2.5 KB N N - - - * - * (VET, 4) N 10 KB N N - - - * - * (VET, 5) N 5 KB N N - - - * - * (VET, 6) N 5 KB N N - - - * - * (VET, 7) N 5 KB N N - - - * - * (VET, 8) N 10 KB N N - - - * - * (VET, 9) N 10 KB N N - - - * - * Start by updating the expected table for the expected changes in - * entry status: - */ - - expected[8].in_cache = FALSE; - expected[8].is_dirty = FALSE; - expected[8].serialized = TRUE; - expected[8].destroyed = TRUE; + * + * Since (VET, 8) is dirty, at first this will just cause (VET, 8) + * to be flushed. + * + * But all other entries in the cache are dirty, so the cache will + * flush them all, and then evict (VET, 8) on the second pass. + * + * The following table shows the expected states of the variable + * size entries after the test. + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (VET, 0) N 10 KB N N - - + * + * (VET, 1) N 2.5 KB N N - - + * + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) N 5 KB N N - - + * + * (VET, 7) N 5 KB N N - - + * + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) N 10 KB N N - - + * + * Start by updating the expected table for the expected changes in + * entry status: + */ + + expected[8].in_cache = FALSE; + expected[8].is_dirty = FALSE; + expected[8].serialized = TRUE; + expected[8].destroyed = TRUE; num_large_entries = 14; - /* a newly loaded entry is not inserted in the cache until after - * space has been made for it. Thus (LET, 13) will not be flushed. - */ - for (i = num_variable_entries; - i < num_variable_entries + num_monster_entries + num_large_entries - 1; - i++) - { + /* a newly loaded entry is not inserted in the cache until after + * space has been made for it. Thus (LET, 13) will not be flushed. + */ + for (i = num_variable_entries; + i < num_variable_entries + num_monster_entries + num_large_entries - 1; + i++) + { expected[i].is_dirty = FALSE; - expected[i].serialized = TRUE; - } + expected[i].serialized = TRUE; + } - for (i = 12; i < 14; i++) - { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + for (i = 12; i < 14; i++) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } /* verify cache size */ - if((cache_ptr->index_len != 45) || + if((cache_ptr->index_len != 45) || (cache_ptr->index_size != (2 * 1024 * 1024) - - (6 * VARIABLE_ENTRY_SIZE) + - (13 * LARGE_ENTRY_SIZE)) || - (cache_ptr->index_size != ((31 * MONSTER_ENTRY_SIZE) + - (14 * LARGE_ENTRY_SIZE)))) { + (6 * VARIABLE_ENTRY_SIZE) + + (13 * LARGE_ENTRY_SIZE)) || + (cache_ptr->index_size != ((31 * MONSTER_ENTRY_SIZE) + + (14 * LARGE_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in flush op eviction test 13."; - } + failure_mssg = "unexpected size/len in flush op eviction test 13."; + } - /* modifications to the H5C__flush_single_entry() function have - * changed the behavior of the cache slightly, causing - * this test to fail. Comment out for now -- come back and + /* modifications to the H5C__flush_single_entry() function have + * changed the behavior of the cache slightly, causing + * this test to fail. Comment out for now -- come back and * fix if all goes well. */ - /* verify entry status */ - verify_entry_status(cache_ptr, - 11, + /* verify entry status */ + verify_entry_status(cache_ptr, + 11, (num_variable_entries + num_monster_entries + num_large_entries), - expected); + expected); } /* at this point we have cycled all the variable size entries through @@ -10820,7 +10820,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) */ if(pass) { - if((cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[VARIABLE_ENTRY_TYPE] != 0) || (cache_ptr->clears[VARIABLE_ENTRY_TYPE] != 0) || (cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 9) || @@ -10846,7 +10846,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - if((cache_ptr->insertions[LARGE_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[LARGE_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[LARGE_ENTRY_TYPE] != 0) || (cache_ptr->clears[LARGE_ENTRY_TYPE] != 0) || (cache_ptr->flushes[LARGE_ENTRY_TYPE] != 25) || @@ -10872,7 +10872,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 62) || @@ -10899,33 +10899,33 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - reset_entries(); + reset_entries(); } return; } /* check_flush_cache__flush_op_eviction_test() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__single_entry() + * Function: check_flush_cache__single_entry() * - * Purpose: Verify that flush_cache behaves as expected when the cache - * contains only one element. + * Purpose: Verify that flush_cache behaves as expected when the cache + * contains only one element. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/05 * * Modifications: * - * JRM -- 3/29/06 - * Added tests for pinned entries. + * JRM -- 3/29/06 + * Added tests for pinned entries. * - * JRM -- 5/17/06 - * Complete reqrite of pinned entry tests to accomodate - * the new H5C_mark_entry_dirty() call. + * JRM -- 5/17/06 + * Complete reqrite of pinned entry tests to accomodate + * the new H5C_mark_entry_dirty() call. * *------------------------------------------------------------------------- */ @@ -12079,22 +12079,22 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* Now run single entry tests for pinned entries. Test all combinations * of: * - * 1) Unpin by unprotect vs. unpin by call to H5C_unpin_entry(). + * 1) Unpin by unprotect vs. unpin by call to H5C_unpin_entry(). * - * 2) Marked dirty by unprotect or not. + * 2) Marked dirty by unprotect or not. * - * 3) Marked dirty by call to H5C_mark_entry_dirty() or not. + * 3) Marked dirty by call to H5C_mark_entry_dirty() or not. * * 4) Marked dirty by call to H5C_mark_entry_dirty() while protected * or not. * * 5) Marked dirty by call to H5C_mark_entry_dirty() while pinned or not. * - * 6) Entry marked for flush or not. + * 6) Entry marked for flush or not. * - * 7) Call flush with H5C__FLUSH_MARKED_ENTRIES_FLAG or not. + * 7) Call flush with H5C__FLUSH_MARKED_ENTRIES_FLAG or not. * - * 8) Call flush with H5C__FLUSH_CLEAR_ONLY_FLAG or not. + * 8) Call flush with H5C__FLUSH_CLEAR_ONLY_FLAG or not. * * This yields a total of 256 tests. * @@ -12137,320 +12137,320 @@ check_flush_cache__single_entry(H5F_t * file_ptr) if(pass) { - int i; - struct pinned_single_entry_test_spec - { - int test_num; - int entry_type; - int entry_idx; - hbool_t dirty_flag; - hbool_t mark_dirty; - hbool_t pop_mark_dirty_prot; - hbool_t pop_mark_dirty_pinned; - hbool_t unprotect_unpin; - unsigned int flags; - unsigned int flush_flags; - hbool_t expected_serialized; - hbool_t expected_destroyed; - } spec[256] = - /* pop pop - * ent unprot mark mark - * test entry -ry dirty mark dirty dirty unprot flush expect expect + int i; + struct pinned_single_entry_test_spec + { + int test_num; + int entry_type; + int entry_idx; + hbool_t dirty_flag; + hbool_t mark_dirty; + hbool_t pop_mark_dirty_prot; + hbool_t pop_mark_dirty_pinned; + hbool_t unprotect_unpin; + unsigned int flags; + unsigned int flush_flags; + hbool_t expected_serialized; + hbool_t expected_destroyed; + } spec[256] = + /* pop pop + * ent unprot mark mark + * test entry -ry dirty mark dirty dirty unprot flush expect expect * num type idx flag dirty prot pinned unpin flags flags srlzd destroy - */ - { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, - { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, - { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, - { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, - { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, - { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, - { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, - { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, - { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE } }; - - i = 0; - while(pass && (i < 256)) - { - check_flush_cache__pinned_single_entry_test - ( + */ + { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE } }; + + i = 0; + while(pass && (i < 256)) + { + check_flush_cache__pinned_single_entry_test + ( /* file_ptr */ file_ptr, /* test_num */ spec[i].test_num, /* entry_type */ spec[i].entry_type, /* entry_idx */ spec[i].entry_idx, /* dirty_flag */ spec[i].dirty_flag, - /* mark_dirty */ spec[i].mark_dirty, + /* mark_dirty */ spec[i].mark_dirty, /* pop_mark_dirty_prot */ spec[i].pop_mark_dirty_prot, /* pop_mark_dirty_pinned */ spec[i].pop_mark_dirty_pinned, - /* unprotect_unpin */ spec[i].unprotect_unpin, + /* unprotect_unpin */ spec[i].unprotect_unpin, /* flags */ spec[i].flags, /* flush_flags */ spec[i].flush_flags, /* expected_serialized */ spec[i].expected_serialized, /* expected_destroyed */ spec[i].expected_destroyed ); - i++; - } + i++; + } } return; } /* check_flush_cache__single_entry() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__single_entry_test() + * Function: check_flush_cache__single_entry_test() * - * Purpose: Run a single entry flush cache test. + * Purpose: Run a single entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/05 * * Modifications: @@ -12472,7 +12472,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; + herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr = NULL; @@ -12612,26 +12612,26 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, } /* check_flush_cache__single_entry_test() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_cache__pinned_single_entry_test() + * Function: check_flush_cache__pinned_single_entry_test() * - * Purpose: Run a pinned single entry flush cache test. + * Purpose: Run a pinned single entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 3/28/06 * * Modifications: * - * JRM -- 5/17/06 - * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned - * flags and supporting code to allow us to test the - * H5C_mark_entry_dirty() call. Use the - * call to mark the entry dirty while the entry is protected - * if pop_mark_dirty_prot is TRUE, and to mark the entry - * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. + * JRM -- 5/17/06 + * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned + * flags and supporting code to allow us to test the + * H5C_mark_entry_dirty() call. Use the + * call to mark the entry dirty while the entry is protected + * if pop_mark_dirty_prot is TRUE, and to mark the entry + * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. * *------------------------------------------------------------------------- */ @@ -12642,10 +12642,10 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int entry_type, int entry_idx, hbool_t unprot_dirty_flag, - hbool_t mark_dirty, - hbool_t pop_mark_dirty_prot, - hbool_t pop_mark_dirty_pinned, - hbool_t unprotect_unpin, + hbool_t mark_dirty, + hbool_t pop_mark_dirty_prot, + hbool_t pop_mark_dirty_pinned, + hbool_t unprotect_unpin, unsigned int flags, unsigned int flush_flags, hbool_t expected_serialized, @@ -12654,7 +12654,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; hbool_t expected_deserialized = TRUE; - herr_t result; + herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr = NULL; @@ -12692,24 +12692,24 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, protect_entry(file_ptr, entry_type, entry_idx); - if(pop_mark_dirty_prot) { + if(pop_mark_dirty_prot) { - mark_entry_dirty(entry_type, entry_idx); - } + mark_entry_dirty(entry_type, entry_idx); + } unprotect_entry(file_ptr, entry_type, entry_idx, (unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | (flags | H5C__PIN_ENTRY_FLAG)); - if(mark_dirty) { + if(mark_dirty) { mark_entry_dirty(entry_type, entry_idx); - } + } - if(pop_mark_dirty_pinned) { + if(pop_mark_dirty_pinned) { - mark_entry_dirty(entry_type, entry_idx); - } + mark_entry_dirty(entry_type, entry_idx); + } } if(pass) { @@ -12820,15 +12820,15 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, } /* check_flush_cache__pinned_single_entry_test() */ - + /*------------------------------------------------------------------------- - * Function: check_get_entry_status() + * Function: check_get_entry_status() * - * Purpose: Verify that H5C_get_entry_status() behaves as expected. + * Purpose: Verify that H5C_get_entry_status() behaves as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/28/06 * * Modifications: @@ -12841,11 +12841,11 @@ check_get_entry_status(unsigned paged) { static char msg[128]; herr_t result; - hbool_t in_cache; - hbool_t is_dirty; - hbool_t is_protected; - hbool_t is_pinned; - size_t entry_size; + hbool_t in_cache; + hbool_t is_dirty; + hbool_t is_protected; + hbool_t is_pinned; + size_t entry_size; H5F_t * file_ptr = NULL; test_entry_t * base_addr = NULL; test_entry_t * entry_ptr = NULL; @@ -12886,14 +12886,14 @@ check_get_entry_status(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 1."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 1."); @@ -12914,14 +12914,14 @@ check_get_entry_status(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 2."); failure_mssg = msg; - } else if(!in_cache || is_dirty || is_protected || is_pinned) { + } else if(!in_cache || is_dirty || is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 2."); @@ -12940,14 +12940,14 @@ check_get_entry_status(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 3."); failure_mssg = msg; - } else if(!in_cache || is_dirty || !is_protected || is_pinned) { + } else if(!in_cache || is_dirty || !is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 3."); @@ -12966,14 +12966,14 @@ check_get_entry_status(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 4."); failure_mssg = msg; - } else if(!in_cache || is_dirty || is_protected || !is_pinned) { + } else if(!in_cache || is_dirty || is_protected || !is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 4."); @@ -12992,14 +12992,14 @@ check_get_entry_status(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 5."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || !is_pinned) { + } else if(!in_cache || !is_dirty || is_protected || !is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 5."); @@ -13018,14 +13018,14 @@ check_get_entry_status(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 6."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || is_pinned) { + } else if(!in_cache || !is_dirty || is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 6."); @@ -13050,15 +13050,15 @@ check_get_entry_status(unsigned paged) } /* check_get_entry_status() */ - + /*------------------------------------------------------------------------- - * Function: check_expunge_entry() + * Function: check_expunge_entry() * - * Purpose: Verify that H5C_expunge_entry() behaves as expected. + * Purpose: Verify that H5C_expunge_entry() behaves as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/5/06 * * Modifications: @@ -13072,11 +13072,11 @@ check_expunge_entry(unsigned paged) { static char msg[128]; herr_t result; - hbool_t in_cache; - hbool_t is_dirty; - hbool_t is_protected; - hbool_t is_pinned; - size_t entry_size; + hbool_t in_cache; + hbool_t is_dirty; + hbool_t is_protected; + hbool_t is_pinned; + size_t entry_size; H5F_t * file_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -13106,30 +13106,30 @@ check_expunge_entry(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 1."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; } else if((entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 1."); failure_mssg = msg; - } + } } /* protect an entry to force the cache to load it, and then unprotect @@ -13149,28 +13149,28 @@ check_expunge_entry(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 2."); failure_mssg = msg; - } else if(!in_cache || is_dirty || is_protected || is_pinned) { + } else if(!in_cache || is_dirty || is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 2."); failure_mssg = msg; - } + } } /* Expunge the entry and then verify that it is no longer in the cache. @@ -13186,34 +13186,34 @@ check_expunge_entry(unsigned paged) if(pass) { /* entry shouldn't be in cache -- only in_cache should be touched - * by the status call. Thus, only check that boolean. + * by the status call. Thus, only check that boolean. */ result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 3."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 3."); failure_mssg = msg; - } + } } /* now repeat the process with a different entry. On unprotect @@ -13231,30 +13231,30 @@ check_expunge_entry(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 4."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; } else if((entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 4."); failure_mssg = msg; - } + } } /* protect the entry to force the cache to load it, and then unprotect @@ -13273,30 +13273,30 @@ check_expunge_entry(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 5."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || is_pinned) { + } else if(!in_cache || !is_dirty || is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 5."); failure_mssg = msg; - } + } } /* Expunge the entry and then verify that it is no longer in the cache. @@ -13312,35 +13312,35 @@ check_expunge_entry(unsigned paged) if(pass) { /* entry shouldn't be in cache -- only in_cache should be touched - * by the status call. Thus, only check that boolean. + * by the status call. Thus, only check that boolean. */ result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 6."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 6."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 6."); failure_mssg = msg; - } + } } if(pass) { @@ -13360,21 +13360,21 @@ check_expunge_entry(unsigned paged) } /* check_expunge_entry() */ - + /*------------------------------------------------------------------------- - * Function: check_multiple_read_protect() + * Function: check_multiple_read_protect() * - * Purpose: Verify that multiple, simultaneous read protects of a - * single entry perform as expectd. + * Purpose: Verify that multiple, simultaneous read protects of a + * single entry perform as expectd. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/1/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -13427,8 +13427,8 @@ check_multiple_read_protect(unsigned paged) entry_ptr = &((entries[0])[0]); if((entry_ptr->header.is_protected) || - (entry_ptr->header.is_read_only) || - (entry_ptr->header.ro_ref_count != 0)) { + (entry_ptr->header.is_read_only) || + (entry_ptr->header.ro_ref_count != 0)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 1.\n"; @@ -13437,11 +13437,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 0) || - (cache_ptr->max_read_protects[0] != 0)) { + (cache_ptr->read_protects[0] != 0) || + (cache_ptr->max_read_protects[0] != 0)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 1.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 1.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13450,8 +13450,8 @@ check_multiple_read_protect(unsigned paged) protect_entry_ro(file_ptr, 0, 0); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 1)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 1)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 2.\n"; @@ -13460,11 +13460,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 1) || - (cache_ptr->max_read_protects[0] != 1)) { + (cache_ptr->read_protects[0] != 1) || + (cache_ptr->max_read_protects[0] != 1)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 2.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 2.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13473,8 +13473,8 @@ check_multiple_read_protect(unsigned paged) protect_entry_ro(file_ptr, 0, 0); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 2)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 2)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 3.\n"; @@ -13483,11 +13483,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 2) || - (cache_ptr->max_read_protects[0] != 2)) { + (cache_ptr->read_protects[0] != 2) || + (cache_ptr->max_read_protects[0] != 2)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 3.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 3.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13496,8 +13496,8 @@ check_multiple_read_protect(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 1)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 1)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 4.\n"; @@ -13506,11 +13506,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 2) || - (cache_ptr->max_read_protects[0] != 2)) { + (cache_ptr->read_protects[0] != 2) || + (cache_ptr->max_read_protects[0] != 2)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 4.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 4.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13519,8 +13519,8 @@ check_multiple_read_protect(unsigned paged) protect_entry_ro(file_ptr, 0, 0); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 2)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 2)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 5.\n"; @@ -13529,11 +13529,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 3) || - (cache_ptr->max_read_protects[0] != 2)) { + (cache_ptr->read_protects[0] != 3) || + (cache_ptr->max_read_protects[0] != 2)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 5.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 5.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13542,8 +13542,8 @@ check_multiple_read_protect(unsigned paged) protect_entry_ro(file_ptr, 0, 0); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 3)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 3)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 6.\n"; @@ -13552,11 +13552,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 4) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 4) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 6.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 6.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13565,8 +13565,8 @@ check_multiple_read_protect(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 2)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 2)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 7.\n"; @@ -13575,11 +13575,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 4) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 4) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 7.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 7.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13588,8 +13588,8 @@ check_multiple_read_protect(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if((!(entry_ptr->header.is_protected)) || - (!(entry_ptr->header.is_read_only)) || - (entry_ptr->header.ro_ref_count != 1)) { + (!(entry_ptr->header.is_read_only)) || + (entry_ptr->header.ro_ref_count != 1)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 8.\n"; @@ -13598,11 +13598,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 4) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 4) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 8.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 8.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13611,8 +13611,8 @@ check_multiple_read_protect(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if((entry_ptr->header.is_protected) || - (entry_ptr->header.is_read_only) || - (entry_ptr->header.ro_ref_count != 0)) { + (entry_ptr->header.is_read_only) || + (entry_ptr->header.ro_ref_count != 0)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 9.\n"; @@ -13621,11 +13621,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 0) || - (cache_ptr->read_protects[0] != 4) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 4) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 9.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 9.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13639,8 +13639,8 @@ check_multiple_read_protect(unsigned paged) protect_entry(file_ptr, 0, 0); if((!(entry_ptr->header.is_protected)) || - (entry_ptr->header.is_read_only) || - (entry_ptr->header.ro_ref_count != 0)) { + (entry_ptr->header.is_read_only) || + (entry_ptr->header.ro_ref_count != 0)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 10.\n"; @@ -13649,11 +13649,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 1) || - (cache_ptr->read_protects[0] != 4) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 4) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 10.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 10.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13662,8 +13662,8 @@ check_multiple_read_protect(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if((entry_ptr->header.is_protected) || - (entry_ptr->header.is_read_only) || - (entry_ptr->header.ro_ref_count != 0)) { + (entry_ptr->header.is_read_only) || + (entry_ptr->header.ro_ref_count != 0)) { pass = FALSE; failure_mssg = "Unexpected ro protected status 11.\n"; @@ -13672,11 +13672,11 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 1) || - (cache_ptr->read_protects[0] != 4) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 4) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 11.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 11.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13691,80 +13691,80 @@ check_multiple_read_protect(unsigned paged) if(pass) { - protect_entry(file_ptr, 0, 2); /* (0,2) write */ + protect_entry(file_ptr, 0, 2); /* (0,2) write */ protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (1) */ - protect_entry(file_ptr, 0, 6); /* (0,6) write */ + protect_entry(file_ptr, 0, 6); /* (0,6) write */ unprotect_entry(file_ptr, 0, 2, /* (0,2) unprotect */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); - protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (1) */ - protect_entry(file_ptr, 0, 1); /* (0,1) write */ - protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (2) */ - protect_entry(file_ptr, 0, 0); /* (0,0) write */ - protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (2) */ + protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (1) */ + protect_entry(file_ptr, 0, 1); /* (0,1) write */ + protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (2) */ + protect_entry(file_ptr, 0, 0); /* (0,0) write */ + protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (2) */ unprotect_entry(file_ptr, 0, 2, /* (0,2) read only (1) pin */ - H5C__PIN_ENTRY_FLAG); + H5C__PIN_ENTRY_FLAG); unprotect_entry(file_ptr, 0, 6, /* (0,6) unprotect */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); - protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (3) */ + protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (3) */ unprotect_entry(file_ptr, 0, 2, /* (0,2) unprotect */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); unprotect_entry(file_ptr, 0, 1, /* (0,1) unprotect */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); - if(pass) { + if(pass) { - entry_ptr = &((entries[0])[4]); + entry_ptr = &((entries[0])[4]); - if(H5C_pin_protected_entry((void *)entry_ptr) < 0) { + if(H5C_pin_protected_entry((void *)entry_ptr) < 0) { - pass = FALSE; - failure_mssg = "H5C_pin_protected_entry() failed.\n"; + pass = FALSE; + failure_mssg = "H5C_pin_protected_entry() failed.\n"; - } else if(!(entry_ptr->header.is_pinned)) { + } else if(!(entry_ptr->header.is_pinned)) { - pass = FALSE; - failure_mssg = "entry (0,4) not pinned.\n"; + pass = FALSE; + failure_mssg = "entry (0,4) not pinned.\n"; - } else { + } else { - /* keep test bed sanity checks happy */ - entry_ptr->is_pinned = TRUE; + /* keep test bed sanity checks happy */ + entry_ptr->is_pinned = TRUE; - } - } + } + } unprotect_entry(file_ptr, 0, 4, /* (0,4) read only (2) */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); unprotect_entry(file_ptr, 0, 4, /* (0,4) read only (1) */ - H5C__UNPIN_ENTRY_FLAG); + H5C__UNPIN_ENTRY_FLAG); if(pass && (entry_ptr->header.is_pinned)) { pass = FALSE; failure_mssg = "enty (0,4) still pinned.\n"; - } + } unprotect_entry(file_ptr, 0, 4, /* (0,4) unprotect */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); unprotect_entry(file_ptr, 0, 0, /* (0,0) unprotect */ - H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); - unpin_entry(0, 2); + unpin_entry(0, 2); } #if H5C_COLLECT_CACHE_STATS if((cache_ptr->write_protects[0] != 5) || - (cache_ptr->read_protects[0] != 9) || - (cache_ptr->max_read_protects[0] != 3)) { + (cache_ptr->read_protects[0] != 9) || + (cache_ptr->max_read_protects[0] != 3)) { - pass = FALSE; - failure_mssg = "Unexpected protect stats 11.\n"; + pass = FALSE; + failure_mssg = "Unexpected protect stats 11.\n"; } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -13786,17 +13786,17 @@ check_multiple_read_protect(unsigned paged) } /* check_multiple_read_protect() */ - + /*------------------------------------------------------------------------- - * Function: check_move_entry() + * Function: check_move_entry() * - * Purpose: Verify that H5C_move_entry behaves as expected. In - * particular, verify that it works correctly with pinned - * entries. + * Purpose: Verify that H5C_move_entry behaves as expected. In + * particular, verify that it works correctly with pinned + * entries. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/26/06 * *------------------------------------------------------------------------- @@ -13812,26 +13812,26 @@ check_move_entry(unsigned paged) { /* int entry_type = */ PICO_ENTRY_TYPE, /* int entry_index = */ 10, - /* hbool_t is_pinned = */ FALSE, - /* hbool_t is_protected = */ FALSE + /* hbool_t is_pinned = */ FALSE, + /* hbool_t is_protected = */ FALSE }, { /* int entry_type = */ PICO_ENTRY_TYPE, /* int entry_index = */ 20, - /* hbool_t is_pinned = */ TRUE, - /* hbool_t is_protected = */ FALSE + /* hbool_t is_pinned = */ TRUE, + /* hbool_t is_protected = */ FALSE }, { /* int entry_type = */ PICO_ENTRY_TYPE, /* int entry_index = */ 30, - /* hbool_t is_pinned = */ FALSE, - /* hbool_t is_protected = */ TRUE + /* hbool_t is_pinned = */ FALSE, + /* hbool_t is_protected = */ TRUE }, { /* int entry_type = */ PICO_ENTRY_TYPE, /* int entry_index = */ 40, - /* hbool_t is_pinned = */ TRUE, - /* hbool_t is_protected = */ TRUE + /* hbool_t is_pinned = */ TRUE, + /* hbool_t is_protected = */ TRUE }, }; @@ -13878,7 +13878,7 @@ check_move_entry(unsigned paged) while(pass && (u < NELMTS(test_specs))) { check_move_entry__run_test(file_ptr, u, &(test_specs[u])); - u++; + u++; } if(pass) @@ -13896,13 +13896,13 @@ check_move_entry(unsigned paged) return (unsigned)!pass; } /* check_move_entry() */ - + /*------------------------------------------------------------------------- * Function: check_move_entry__run_test() * * Purpose: Run a move entry test. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * * Return: void * @@ -13911,7 +13911,7 @@ check_move_entry(unsigned paged) * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -14080,15 +14080,15 @@ check_move_entry__run_test(H5F_t * file_ptr, } /* check_move_entry__run_test() */ - + /*------------------------------------------------------------------------- - * Function: check_pin_protected_entry() + * Function: check_pin_protected_entry() * - * Purpose: Verify that H5C_pin_protected_entry behaves as expected. + * Purpose: Verify that H5C_pin_protected_entry behaves as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/28/06 * * Modifications: @@ -14142,25 +14142,25 @@ check_pin_protected_entry(unsigned paged) base_addr = entries[0]; entry_ptr = &(base_addr[0]); - result = H5C_pin_protected_entry((void *)entry_ptr); + result = H5C_pin_protected_entry((void *)entry_ptr); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_pin_protected_entry() reports failure."); failure_mssg = msg; - } else if(!(entry_ptr->header.is_pinned)) { + } else if(!(entry_ptr->header.is_pinned)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "entry not pinned when it should be."); failure_mssg = msg; - } else { + } else { - entry_ptr->is_pinned = TRUE; - } + entry_ptr->is_pinned = TRUE; + } } unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); @@ -14182,16 +14182,16 @@ check_pin_protected_entry(unsigned paged) } /* check_pin_protected_entry() */ - + /*------------------------------------------------------------------------- - * Function: check_resize_entry() + * Function: check_resize_entry() * - * Purpose: Verify that H5C_resize_entry() and H5C_unprotect() resize - * entries as expected. + * Purpose: Verify that H5C_resize_entry() and H5C_unprotect() resize + * entries as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/7/06 * *------------------------------------------------------------------------- @@ -14202,12 +14202,12 @@ check_resize_entry(unsigned paged) { static char msg[128]; herr_t result; - hbool_t in_cache; - hbool_t is_dirty; - hbool_t is_protected; - hbool_t is_pinned; - size_t entry_size; - size_t reported_entry_size; + hbool_t in_cache; + hbool_t is_dirty; + hbool_t is_protected; + hbool_t is_pinned; + size_t entry_size; + size_t reported_entry_size; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; test_entry_t * base_addr; @@ -14262,8 +14262,8 @@ check_resize_entry(unsigned paged) pass = FALSE; failure_mssg = "file_ptr NULL from setup_cache."; - } - else + } + else { cache_ptr = file_ptr->shared->cache; @@ -14275,16 +14275,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if((cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 1."); failure_mssg = msg; - } + } } if(pass) { @@ -14295,48 +14295,48 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if((cache_ptr->index_len != 1) || + (cache_ptr->index_size != LARGE_ENTRY_SIZE) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 2."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 1."); failure_mssg = msg; - } else if(!in_cache || is_dirty || !is_protected || is_pinned) { + } else if(!in_cache || is_dirty || !is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 1."); failure_mssg = msg; - } + } } if(pass) { @@ -14374,48 +14374,48 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2)) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2))) { + if((cache_ptr->index_len != 1) || + (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2)) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 3."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 2."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || is_pinned || - (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) { + } else if(!in_cache || !is_dirty || is_protected || is_pinned || + (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 2."); failure_mssg = msg; - } + } } if(pass) { @@ -14459,48 +14459,48 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if((cache_ptr->index_len != 1) || + (cache_ptr->index_size != LARGE_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 4."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 3."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || is_pinned || - (reported_entry_size != LARGE_ENTRY_SIZE)) { + } else if(!in_cache || !is_dirty || is_protected || is_pinned || + (reported_entry_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 3."); failure_mssg = msg; - } + } } if(pass) { @@ -14515,120 +14515,120 @@ check_resize_entry(unsigned paged) result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_entry() reports failure 1."); + "H5C_resize_entry() reports failure 1."); failure_mssg = msg; - } + } } if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4)) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4))) { + if((cache_ptr->index_len != 1) || + (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4)) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 5."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 4."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || !is_pinned || - (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) { + } else if(!in_cache || !is_dirty || is_protected || !is_pinned || + (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 4."); failure_mssg = msg; - } + } } if(pass) { result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_entry() reports failure 2."); + "H5C_resize_entry() reports failure 2."); failure_mssg = msg; - } + } } if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if((cache_ptr->index_len != 1) || + (cache_ptr->index_size != LARGE_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 6."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 5."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || !is_pinned || - (reported_entry_size != LARGE_ENTRY_SIZE)) { + } else if(!in_cache || !is_dirty || is_protected || !is_pinned || + (reported_entry_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 5."); failure_mssg = msg; - } + } } if(pass) { @@ -14644,44 +14644,44 @@ check_resize_entry(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 6."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 6."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 6."); failure_mssg = msg; - } + } } if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if((cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 7."); failure_mssg = msg; - } + } } @@ -14689,19 +14689,19 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if((cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 8."); failure_mssg = msg; - } + } base_addr = entries[LARGE_ENTRY_TYPE]; entry_ptr = &(base_addr[3]); - entry_size = LARGE_ENTRY_SIZE; + entry_size = LARGE_ENTRY_SIZE; } if(pass) { @@ -14719,17 +14719,17 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 3) || - (cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if((cache_ptr->index_len != 3) || + (cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 9."); failure_mssg = msg; - } + } } if(pass) { @@ -14740,48 +14740,48 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if((cache_ptr->index_len != 4) || + (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 10."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 7."); failure_mssg = msg; - } else if(!in_cache || is_dirty || !is_protected || is_pinned) { + } else if(!in_cache || is_dirty || !is_protected || is_pinned) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 7."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 7."); failure_mssg = msg; - } + } } if(pass) { @@ -14819,50 +14819,50 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != - ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2))) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != - (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)))) { + if((cache_ptr->index_len != 4) || + (cache_ptr->index_size != + ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2))) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != + (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 11."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 8."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || is_pinned || - (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) { + } else if(!in_cache || !is_dirty || is_protected || is_pinned || + (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 8."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 8."); failure_mssg = msg; - } + } } if(pass) { @@ -14906,48 +14906,48 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE)) { + if((cache_ptr->index_len != 4) || + (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 12."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 9."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || is_pinned || - (reported_entry_size != LARGE_ENTRY_SIZE)) { + } else if(!in_cache || !is_dirty || is_protected || is_pinned || + (reported_entry_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 9."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 9."); failure_mssg = msg; - } + } } if(pass) { @@ -14962,129 +14962,129 @@ check_resize_entry(unsigned paged) result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_entry() reports failure 3."); + "H5C_resize_entry() reports failure 3."); failure_mssg = msg; - } + } } if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != - ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4))) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != - (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)))) { + if((cache_ptr->index_len != 4) || + (cache_ptr->index_size != + ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4))) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != + (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 13."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 10."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || !is_pinned || - (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) { + } else if(!in_cache || !is_dirty || is_protected || !is_pinned || + (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 10."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 10."); failure_mssg = msg; - } + } } if(pass) { result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_entry() reports failure 4."); + "H5C_resize_entry() reports failure 4."); failure_mssg = msg; - } + } } if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE)) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE))) { + if((cache_ptr->index_len != 4) || + (cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE)) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE))) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 14."); failure_mssg = msg; - } + } } if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - &reported_entry_size, &in_cache, - &is_dirty, &is_protected, &is_pinned, + &reported_entry_size, &in_cache, + &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 11."); failure_mssg = msg; - } else if(!in_cache || !is_dirty || is_protected || !is_pinned || - (reported_entry_size != LARGE_ENTRY_SIZE)) { + } else if(!in_cache || !is_dirty || is_protected || !is_pinned || + (reported_entry_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 11."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 11."); failure_mssg = msg; - } + } } if(pass) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); } @@ -15093,44 +15093,44 @@ check_resize_entry(unsigned paged) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 12."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 12."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 12."); failure_mssg = msg; - } + } } if(pass) { - if((cache_ptr->index_len != 3) || - (cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE)) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if((cache_ptr->index_len != 3) || + (cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE)) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 15."); failure_mssg = msg; - } + } } if(pass) { @@ -15148,16 +15148,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if((cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 16."); failure_mssg = msg; - } + } } if(pass) { @@ -15177,16 +15177,16 @@ check_resize_entry(unsigned paged) } /* check_resize_entry() */ - + /*------------------------------------------------------------------------- - * Function: check_evictions_enabled() + * Function: check_evictions_enabled() * - * Purpose: Verify that H5C_get_evictions_enabled() and - * H5C_set_evictions_enabled() functions perform as expected. + * Purpose: Verify that H5C_get_evictions_enabled() and + * H5C_set_evictions_enabled() functions perform as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/2/07 * * Modifications: @@ -15200,11 +15200,11 @@ check_evictions_enabled(unsigned paged) { static char msg[128]; herr_t result; - hbool_t show_progress = FALSE; - hbool_t evictions_enabled; - hbool_t in_cache; - int i; - int mile_stone = 1; + hbool_t show_progress = FALSE; + hbool_t evictions_enabled; + hbool_t in_cache; + int i; + int mile_stone = 1; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; test_entry_t * base_addr = NULL; @@ -15268,8 +15268,8 @@ check_evictions_enabled(unsigned paged) pass = FALSE; failure_mssg = "file_ptr NULL from setup_cache."; - } - else + } + else { cache_ptr = file_ptr->shared->cache; @@ -15284,17 +15284,17 @@ check_evictions_enabled(unsigned paged) /* verify that it is empty */ if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 1."); failure_mssg = msg; - } + } } if(show_progress) /* 3 */ @@ -15306,12 +15306,12 @@ check_evictions_enabled(unsigned paged) result = H5C_get_evictions_enabled(cache_ptr, &evictions_enabled); - if((result != SUCCEED) || (evictions_enabled != TRUE)) { + if((result != SUCCEED) || (evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected evictions enabled 1."); failure_mssg = msg; - } + } } if(show_progress) /* 4 */ @@ -15336,18 +15336,18 @@ check_evictions_enabled(unsigned paged) /* verify that the cache is full */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 16) || + (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 2."); failure_mssg = msg; - } + } } if(show_progress) /* 6 */ @@ -15369,17 +15369,17 @@ check_evictions_enabled(unsigned paged) /* verify that an entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 16) || + (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 0) || + (cache_ptr->slist_size != 0) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 3."); failure_mssg = msg; - } + } } if(show_progress) /* 8 */ @@ -15391,31 +15391,31 @@ check_evictions_enabled(unsigned paged) entry_ptr = &(base_addr[0]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 1."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 1."); failure_mssg = msg; - } + } } if(show_progress) /* 9 */ @@ -15436,17 +15436,17 @@ check_evictions_enabled(unsigned paged) /* verify that another entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 16) || + (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 4."); failure_mssg = msg; - } + } } if(show_progress) /* 11 */ @@ -15458,30 +15458,30 @@ check_evictions_enabled(unsigned paged) entry_ptr = &(base_addr[1]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 2."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 2."); failure_mssg = msg; - } + } } if(show_progress) /* 12 */ @@ -15493,12 +15493,12 @@ check_evictions_enabled(unsigned paged) result = H5C_set_evictions_enabled(cache_ptr, FALSE); - if(result != SUCCEED) { + if(result != SUCCEED) { pass = FALSE; HDsnprintf(msg, (size_t)128, "can't disable evictions 1."); failure_mssg = msg; - } + } } if(show_progress) /* 13 */ @@ -15508,17 +15508,17 @@ check_evictions_enabled(unsigned paged) /* verify that evictions are disabled */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if((cache_ptr->index_len != 16) || + (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != FALSE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 5."); failure_mssg = msg; - } + } } if(show_progress) /* 14 */ @@ -15540,17 +15540,17 @@ check_evictions_enabled(unsigned paged) /* verify that no entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 17) || - (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if((cache_ptr->index_len != 17) || + (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 1) || + (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != FALSE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 6."); failure_mssg = msg; - } + } } if(show_progress) /* 16 */ @@ -15571,17 +15571,17 @@ check_evictions_enabled(unsigned paged) /* verify that no entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 18) || - (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if((cache_ptr->index_len != 18) || + (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != FALSE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 7."); failure_mssg = msg; - } + } } if(show_progress) /* 18 */ @@ -15593,12 +15593,12 @@ check_evictions_enabled(unsigned paged) result = H5C_set_evictions_enabled(cache_ptr, TRUE); - if(result != SUCCEED) { + if(result != SUCCEED) { pass = FALSE; HDsnprintf(msg, (size_t)128, "can't enable evictions 1."); failure_mssg = msg; - } + } } if(show_progress) /* 19 */ @@ -15620,17 +15620,17 @@ check_evictions_enabled(unsigned paged) /* verify that no entries have been evicted */ if(pass) { - if((cache_ptr->index_len != 18) || - (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 18) || + (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 8."); failure_mssg = msg; - } + } } if(show_progress) /* 21 */ @@ -15655,17 +15655,17 @@ check_evictions_enabled(unsigned paged) if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 16) || + (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 9."); failure_mssg = msg; - } + } } if(show_progress) /* 23 */ @@ -15677,30 +15677,30 @@ check_evictions_enabled(unsigned paged) entry_ptr = &(base_addr[2]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 3."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 3."); failure_mssg = msg; - } + } } if(show_progress) /* 24 */ @@ -15712,30 +15712,30 @@ check_evictions_enabled(unsigned paged) entry_ptr = &(base_addr[3]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 4."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - (entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + (entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 4."); failure_mssg = msg; - } + } } if(show_progress) /* 25 */ @@ -15747,12 +15747,12 @@ check_evictions_enabled(unsigned paged) result = H5C_set_evictions_enabled(cache_ptr, FALSE); - if(result != SUCCEED) { + if(result != SUCCEED) { pass = FALSE; HDsnprintf(msg, (size_t)128, "can't disable evictions 2."); failure_mssg = msg; - } + } } if(show_progress) /* 26 */ @@ -15776,17 +15776,17 @@ check_evictions_enabled(unsigned paged) /* verify that the cache has grown */ if(pass) { - if((cache_ptr->index_len != 17) || - (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if((cache_ptr->index_len != 17) || + (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 2) || + (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != FALSE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 10."); failure_mssg = msg; - } + } } if(show_progress) /* 28 */ @@ -15798,12 +15798,12 @@ check_evictions_enabled(unsigned paged) result = H5C_set_evictions_enabled(cache_ptr, TRUE); - if(result != SUCCEED) { + if(result != SUCCEED) { pass = FALSE; HDsnprintf(msg, (size_t)128, "can't enable evictions 2."); failure_mssg = msg; - } + } } if(show_progress) /* 29 */ @@ -15824,17 +15824,17 @@ check_evictions_enabled(unsigned paged) /* verify that the cache has returned to its maximum size */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 3) || - (cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if((cache_ptr->index_len != 16) || + (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || + (cache_ptr->slist_len != 3) || + (cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE) || + (cache_ptr->evictions_enabled != TRUE)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 11."); failure_mssg = msg; - } + } } if(show_progress) /* 31 */ @@ -15846,30 +15846,30 @@ check_evictions_enabled(unsigned paged) entry_ptr = &(base_addr[4]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if(result < 0) { + if(result < 0) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 5."); failure_mssg = msg; - } else if(in_cache) { + } else if(in_cache) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; } else if((!entry_ptr->deserialized) || - ( entry_ptr->serialized) || - (!entry_ptr->destroyed)) { + ( entry_ptr->serialized) || + (!entry_ptr->destroyed)) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 5."); failure_mssg = msg; - } + } } if(show_progress) /* 32 */ @@ -15881,12 +15881,12 @@ check_evictions_enabled(unsigned paged) result = H5C_set_evictions_enabled(cache_ptr, FALSE); - if(result != SUCCEED) { + if(result != SUCCEED) { pass = FALSE; HDsnprintf(msg, (size_t)128, "can't disable evictions 3."); failure_mssg = msg; - } + } } if(show_progress) /* 33 */ @@ -15914,16 +15914,16 @@ check_evictions_enabled(unsigned paged) } /* check_evictions_enabled() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_protected_err() + * Function: check_flush_protected_err() * - * Purpose: Verify that an attempt to flush the cache when it contains - * a protected entry will generate an error. + * Purpose: Verify that an attempt to flush the cache when it contains + * a protected entry will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * * Modifications: @@ -15989,17 +15989,17 @@ check_flush_protected_err(unsigned paged) } /* check_flush_protected_err() */ - + /*------------------------------------------------------------------------- - * Function: check_destroy_pinned_err() + * Function: check_destroy_pinned_err() * - * Purpose: Verify that an attempt to destroy the cache when it contains - * a pinned entry that can't be unpined during the flush destroy - * will generate an error. + * Purpose: Verify that an attempt to destroy the cache when it contains + * a pinned entry that can't be unpined during the flush destroy + * will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/7/06 * * Modifications: @@ -16030,7 +16030,7 @@ check_destroy_pinned_err(unsigned paged) file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); if(H5C_prep_for_file_close(file_ptr) < 0) { pass = FALSE; @@ -16041,8 +16041,8 @@ check_destroy_pinned_err(unsigned paged) pass = FALSE; failure_mssg = "destroy succeeded on cache with pinned entry.\n"; } /* end if */ - else { - unpin_entry(0, 0); + else { + unpin_entry(0, 0); if(H5C_dest(file_ptr) < 0) { pass = FALSE; @@ -16057,11 +16057,11 @@ check_destroy_pinned_err(unsigned paged) saved_cache = NULL; } /* end if */ - /* call takedown_cache() with a NULL file_ptr parameter. - * This causes the function to close and delete the file, - * while skipping the call to H5C_dest(). - */ - takedown_cache(NULL, FALSE, FALSE); + /* call takedown_cache() with a NULL file_ptr parameter. + * This causes the function to close and delete the file, + * while skipping the call to H5C_dest(). + */ + takedown_cache(NULL, FALSE, FALSE); } /* end if */ if(pass) { PASSED(); } else { H5_FAILED(); } @@ -16073,16 +16073,16 @@ check_destroy_pinned_err(unsigned paged) } /* check_destroy_pinned_err() */ - + /*------------------------------------------------------------------------- - * Function: check_destroy_protected_err() + * Function: check_destroy_protected_err() * - * Purpose: Verify that an attempt to destroy the cache when it contains - * a protected entry will generate an error. + * Purpose: Verify that an attempt to destroy the cache when it contains + * a protected entry will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * * Modifications: @@ -16133,27 +16133,27 @@ check_destroy_protected_err(unsigned paged) pass = FALSE; failure_mssg = "destroy succeeded on cache with protected entry.\n"; } /* end if */ - else { + else { unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); if(H5C_dest(file_ptr) < 0) { pass = FALSE; failure_mssg = "destroy failed after unprotect.\n"; } /* end if */ - else { + else { file_ptr->shared->cache = NULL; - } /* end else */ - } /* end else */ + } /* end else */ + } /* end else */ if(saved_cache != NULL) { file_ptr->shared->cache = saved_cache; saved_cache = NULL; } /* end if */ - /* call takedown_cache() with a NULL file_ptr parameter. - * This causes the function to close and delete the file, - * while skipping the call to H5C_dest(). - */ - takedown_cache(NULL, FALSE, FALSE); + /* call takedown_cache() with a NULL file_ptr parameter. + * This causes the function to close and delete the file, + * while skipping the call to H5C_dest(). + */ + takedown_cache(NULL, FALSE, FALSE); } /* end if */ if(pass) { PASSED(); } else { H5_FAILED(); } @@ -16165,16 +16165,16 @@ check_destroy_protected_err(unsigned paged) } /* check_destroy_protected_err() */ - + /*------------------------------------------------------------------------- - * Function: check_duplicate_insert_err() + * Function: check_duplicate_insert_err() * - * Purpose: Verify that an attempt to insert and entry that is - * alread in the cache will generate an error. + * Purpose: Verify that an attempt to insert and entry that is + * alread in the cache will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * * Modifications: @@ -16245,21 +16245,21 @@ check_duplicate_insert_err(unsigned paged) } /* check_duplicate_insert_err() */ - + /*------------------------------------------------------------------------- - * Function: check_double_pin_err() + * Function: check_double_pin_err() * - * Purpose: Verify that an attempt to pin an entry that is already - * pinned will generate an error. + * Purpose: Verify that an attempt to pin an entry that is already + * pinned will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/24/06 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -16312,8 +16312,8 @@ check_double_pin_err(unsigned paged) } else { - unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); - } + unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); + } } if(pass) { @@ -16333,21 +16333,21 @@ check_double_pin_err(unsigned paged) } /* check_double_pin_err() */ - + /*------------------------------------------------------------------------- - * Function: check_double_unpin_err() + * Function: check_double_unpin_err() * - * Purpose: Verify that an attempt to unpin an unpinned entry will - * generate an error. + * Purpose: Verify that an attempt to unpin an unpinned entry will + * generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/24/06 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -16398,13 +16398,13 @@ check_double_unpin_err(unsigned paged) } else { - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); - } + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + } } if(pass) { - result = H5C_unpin_entry((void *)entry_ptr); + result = H5C_unpin_entry((void *)entry_ptr); if(result > 0) { @@ -16432,21 +16432,21 @@ check_double_unpin_err(unsigned paged) } /* check_double_unpin_err() */ - + /*------------------------------------------------------------------------- - * Function: check_pin_entry_errs() + * Function: check_pin_entry_errs() * - * Purpose: Verify that invalid calls to H5C_pin_protected_entry() - * generate errors as expected. + * Purpose: Verify that invalid calls to H5C_pin_protected_entry() + * generate errors as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/24/06 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -16485,7 +16485,7 @@ check_pin_entry_errs(unsigned paged) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } @@ -16504,10 +16504,10 @@ check_pin_entry_errs(unsigned paged) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); protect_entry(file_ptr, 0, 0); - } + } } if(pass) { @@ -16522,9 +16522,9 @@ check_pin_entry_errs(unsigned paged) } else { - unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); - } + } } if(pass) { @@ -16544,16 +16544,16 @@ check_pin_entry_errs(unsigned paged) } /* check_pin_entry_errs() */ - + /*------------------------------------------------------------------------- - * Function: check_double_protect_err() + * Function: check_double_protect_err() * - * Purpose: Verify that an attempt to protect an entry that is already - * protected will generate an error. + * Purpose: Verify that an attempt to protect an entry that is already + * protected will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * *------------------------------------------------------------------------- @@ -16592,8 +16592,8 @@ check_double_protect_err(unsigned paged) if(pass) { cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, - types[0], entry_ptr->addr, - &entry_ptr->addr, H5C__NO_FLAGS_SET); + types[0], entry_ptr->addr, + &entry_ptr->addr, H5C__NO_FLAGS_SET); if(cache_entry_ptr != NULL) { @@ -16624,16 +16624,16 @@ check_double_protect_err(unsigned paged) } /* check_double_protect_err() */ - + /*------------------------------------------------------------------------- - * Function: check_double_unprotect_err() + * Function: check_double_unprotect_err() * - * Purpose: Verify that an attempt to unprotect an entry that is already - * unprotected will generate an error. + * Purpose: Verify that an attempt to unprotect an entry that is already + * unprotected will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * *------------------------------------------------------------------------- @@ -16701,19 +16701,19 @@ check_double_unprotect_err(unsigned paged) } /* check_double_unprotect_err() */ - + /*------------------------------------------------------------------------- - * Function: check_mark_entry_dirty_errs() + * Function: check_mark_entry_dirty_errs() * - * Purpose: Verify that: + * Purpose: Verify that: * - * 1) a call to H5C_mark_entry_dirty with - * and unpinned and unprotected entry will generate an - * error. + * 1) a call to H5C_mark_entry_dirty with + * and unpinned and unprotected entry will generate an + * error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 5/17/06 * *------------------------------------------------------------------------- @@ -16747,14 +16747,14 @@ check_mark_entry_dirty_errs(unsigned paged) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } if(pass) { - result = H5C_mark_entry_dirty((void *)entry_ptr); + result = H5C_mark_entry_dirty((void *)entry_ptr); if(result > 0) { @@ -16782,21 +16782,21 @@ check_mark_entry_dirty_errs(unsigned paged) } /* check_mark_entry_dirty_errs() */ - + /*------------------------------------------------------------------------- - * Function: check_expunge_entry_errs() + * Function: check_expunge_entry_errs() * - * Purpose: Verify that invalid calls to H5C_expunge_entry() - * generate errors as expected. + * Purpose: Verify that invalid calls to H5C_expunge_entry() + * generate errors as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/6/06 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -16841,7 +16841,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16852,14 +16852,14 @@ check_expunge_entry_errs(unsigned paged) } else { - unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - } + } } if(pass) { - result = H5C_expunge_entry(file_ptr, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16870,14 +16870,14 @@ check_expunge_entry_errs(unsigned paged) } else { - unpin_entry(0, 0); + unpin_entry(0, 0); - } + } } if(pass) { - result = H5C_expunge_entry(file_ptr, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -16886,7 +16886,7 @@ check_expunge_entry_errs(unsigned paged) failure_mssg = "attempt to expunge an unpinned and unprotected entry failed.\n"; - } + } } @@ -16907,16 +16907,16 @@ check_expunge_entry_errs(unsigned paged) } /* check_expunge_entry_errs() */ - + /*------------------------------------------------------------------------- - * Function: check_move_entry_errs() + * Function: check_move_entry_errs() * - * Purpose: Verify that invalid calls to H5C_move_entry() - * generates errors as expected. + * Purpose: Verify that invalid calls to H5C_move_entry() + * generates errors as expected. * - * Return: void + * Return: void * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 12/10/16 * *------------------------------------------------------------------------- @@ -17000,7 +17000,7 @@ check_move_entry_errs(unsigned paged) } /* end if */ if(pass) { - result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10); + result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10); if(result >= 0) { pass = FALSE; @@ -17024,16 +17024,16 @@ check_move_entry_errs(unsigned paged) return (unsigned)!pass; } /* check_move_entry_errs() */ - + /*------------------------------------------------------------------------- - * Function: check_resize_entry_errs() + * Function: check_resize_entry_errs() * - * Purpose: Verify that invalid calls to H5C_resize_entry() - * generates errors as expected. + * Purpose: Verify that invalid calls to H5C_resize_entry() + * generates errors as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/7/06 * *------------------------------------------------------------------------- @@ -17078,7 +17078,7 @@ check_resize_entry_errs(unsigned paged) if(pass) { - result = H5C_resize_entry((void *)entry_ptr, (size_t)1); + result = H5C_resize_entry((void *)entry_ptr, (size_t)1); if(result < 0) { @@ -17088,14 +17088,14 @@ check_resize_entry_errs(unsigned paged) } else { - unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - } + } } if(pass) { - result = H5C_resize_entry((void *)entry_ptr, (size_t)0); + result = H5C_resize_entry((void *)entry_ptr, (size_t)0); if(result >= 0) { @@ -17105,9 +17105,9 @@ check_resize_entry_errs(unsigned paged) } else { - unpin_entry(0, 0); + unpin_entry(0, 0); - } + } } if(pass) { @@ -17127,16 +17127,16 @@ check_resize_entry_errs(unsigned paged) } /* check_resize_entry_errs() */ - + /*------------------------------------------------------------------------- - * Function: check_unprotect_ro_dirty_err() + * Function: check_unprotect_ro_dirty_err() * - * Purpose: If an entry is protected read only, verify that unprotecting - * it dirty will generate an error. + * Purpose: If an entry is protected read only, verify that unprotecting + * it dirty will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/3/07 * *------------------------------------------------------------------------- @@ -17187,7 +17187,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if(pass) { - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } @@ -17229,8 +17229,8 @@ check_unprotect_ro_dirty_err(unsigned paged) if(pass) { - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } @@ -17251,21 +17251,21 @@ check_unprotect_ro_dirty_err(unsigned paged) } /* check_unprotect_ro_dirty_err() */ - + /*------------------------------------------------------------------------- - * Function: check_protect_ro_rw_err() + * Function: check_protect_ro_rw_err() * - * Purpose: If an entry is protected read only, verify that protecting - * it rw will generate an error. + * Purpose: If an entry is protected read only, verify that protecting + * it rw will generate an error. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/9/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -17304,8 +17304,8 @@ check_protect_ro_rw_err(unsigned paged) if(pass) { thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, - types[0], entry_ptr->addr, - &entry_ptr->addr, H5C__NO_FLAGS_SET); + types[0], entry_ptr->addr, + &entry_ptr->addr, H5C__NO_FLAGS_SET); if(thing_ptr != NULL) { @@ -17316,7 +17316,7 @@ check_protect_ro_rw_err(unsigned paged) if(pass) { - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } if(pass) { @@ -17336,16 +17336,16 @@ check_protect_ro_rw_err(unsigned paged) } /* check_protect_ro_rw_err() */ - + /*------------------------------------------------------------------------- - * Function: check_protect_retries() + * Function: check_protect_retries() * - * Purpose: To exercise checksum verification retries for an entry with - * a speculative load. + * Purpose: To exercise checksum verification retries for an entry with + * a speculative load. * - * Return: + * Return: * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -17374,8 +17374,8 @@ check_protect_retries(unsigned paged) file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); - /* Set up read attempts for verifying checksum */ - file_ptr->shared->read_attempts = 10; + /* Set up read attempts for verifying checksum */ + file_ptr->shared->read_attempts = 10; file_ptr->shared->retries_nbins = 1; } @@ -17385,30 +17385,30 @@ check_protect_retries(unsigned paged) if(pass) { - cache_ptr = file_ptr->shared->cache; - base_addr = entries[type]; + cache_ptr = file_ptr->shared->cache; + base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - /* test case (1): - * --actual_len is smaller the initial length from get_load_size() - * --verify_chksum() returns TRUE after max_verify_ct is reached - * - */ - entry_ptr->actual_len = entry_ptr->size/2; + /* test case (1): + * --actual_len is smaller the initial length from get_load_size() + * --verify_chksum() returns TRUE after max_verify_ct is reached + * + */ + entry_ptr->actual_len = entry_ptr->size/2; entry_ptr->max_verify_ct = 3; entry_ptr->verify_ct = 0; - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); - if((cache_entry_ptr != (void *)entry_ptr) || + if((cache_entry_ptr != (void *)entry_ptr) || (!(entry_ptr->header.is_protected)) || (!(entry_ptr->header.is_read_only)) || (entry_ptr->header.ro_ref_count <= 0) || (entry_ptr->header.type != types[type]) || (entry_ptr->size != entry_ptr->header.size) || (entry_ptr->addr != entry_ptr->header.addr) || - (entry_ptr->verify_ct != entry_ptr->max_verify_ct)) { + (entry_ptr->verify_ct != entry_ptr->max_verify_ct)) { pass = FALSE; failure_mssg = "error from H5C_protect()."; @@ -17429,26 +17429,26 @@ check_protect_retries(unsigned paged) } if(pass) - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, idx, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, idx, H5C__NO_FLAGS_SET); if(pass) { entry_ptr = &(base_addr[++idx]); - /* test case (2): - * --actual_len is greater the initial length from get_load_size() - * --verify_chksum() returns FALSE even after all tries is reached - * (file_ptr->shared->read_attempts is smaller then max_verify_ct) - */ - entry_ptr->actual_len = entry_ptr->size*2; + /* test case (2): + * --actual_len is greater the initial length from get_load_size() + * --verify_chksum() returns FALSE even after all tries is reached + * (file_ptr->shared->read_attempts is smaller then max_verify_ct) + */ + entry_ptr->actual_len = entry_ptr->size*2; entry_ptr->max_verify_ct = 11; entry_ptr->verify_ct = 0; - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); - /* H5C_protect() should fail after all retries fail */ - if(cache_entry_ptr != NULL) - pass = FALSE; + /* H5C_protect() should fail after all retries fail */ + if(cache_entry_ptr != NULL) + pass = FALSE; } @@ -17467,21 +17467,21 @@ check_protect_retries(unsigned paged) } /* check_protect_retries() */ - + /*------------------------------------------------------------------------- - * Function: check_evictions_enabled_err() + * Function: check_evictions_enabled_err() * - * Purpose: Verify that H5C_get_evictions_enabled() and + * Purpose: Verify that H5C_get_evictions_enabled() and * H5C_set_evictions_enabled() generate errors as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/3/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -17524,9 +17524,9 @@ check_check_evictions_enabled_err(unsigned paged) if(pass) { - result = H5C_get_evictions_enabled(NULL, &evictions_enabled); + result = H5C_get_evictions_enabled(NULL, &evictions_enabled); - if(result == SUCCEED) { + if(result == SUCCEED) { pass = FALSE; failure_mssg = "H5C_get_evictions_enabled succeeded() 1.\n"; @@ -17535,9 +17535,9 @@ check_check_evictions_enabled_err(unsigned paged) if(pass) { - result = H5C_get_evictions_enabled(cache_ptr, NULL); + result = H5C_get_evictions_enabled(cache_ptr, NULL); - if(result == SUCCEED) { + if(result == SUCCEED) { pass = FALSE; failure_mssg = "H5C_get_evictions_enabled succeeded() 2.\n"; @@ -17546,30 +17546,30 @@ check_check_evictions_enabled_err(unsigned paged) if(pass) { - result = H5C_set_evictions_enabled(cache_ptr, TRUE); + result = H5C_set_evictions_enabled(cache_ptr, TRUE); - if(result != SUCCEED) { + if(result != SUCCEED) { pass = FALSE; failure_mssg = "H5C_set_evictions_enabled failed().\n"; - } + } } if(pass) { (cache_ptr->resize_ctl).incr_mode = H5C_incr__threshold; - result = H5C_get_evictions_enabled(cache_ptr, FALSE); + result = H5C_get_evictions_enabled(cache_ptr, FALSE); - if(result == SUCCEED) { + if(result == SUCCEED) { pass = FALSE; failure_mssg = "H5C_get_evictions_enabled succeeded() 1.\n"; } else if(cache_ptr->evictions_enabled == TRUE) { - } + } (cache_ptr->resize_ctl).incr_mode = H5C_incr__off; } @@ -17578,9 +17578,9 @@ check_check_evictions_enabled_err(unsigned paged) (cache_ptr->resize_ctl).decr_mode = H5C_decr__threshold; - result = H5C_get_evictions_enabled(cache_ptr, FALSE); + result = H5C_get_evictions_enabled(cache_ptr, FALSE); - if(result == SUCCEED) { + if(result == SUCCEED) { pass = FALSE; failure_mssg = "H5C_get_evictions_enabled succeeded() 2.\n"; @@ -17607,18 +17607,18 @@ check_check_evictions_enabled_err(unsigned paged) } /* check_evictions_enabled_err() */ - + /*------------------------------------------------------------------------- - * Function: check_auto_cache_resize() + * Function: check_auto_cache_resize() * - * Purpose: Exercise the automatic cache resizing functionality. - * The objective is to operate the auto-resize code in - * all possible modes. Unfortunately, there are quite - * a few of them. + * Purpose: Exercise the automatic cache resizing functionality. + * The objective is to operate the auto-resize code in + * all possible modes. Unfortunately, there are quite + * a few of them. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/29/04 * *------------------------------------------------------------------------- @@ -17675,9 +17675,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, @@ -18045,9 +18045,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1000 * 1000); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -18333,7 +18333,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); i++; } - + if((!rpt_fcn_called) || (rpt_status != decrease) || @@ -18377,9 +18377,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -18558,9 +18558,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -18598,7 +18598,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(cork_ageout) - cork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE); + cork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE); /* fill the cache with 1024 byte entries -- nothing should happen * for three epochs while the markers are inserted into the cache @@ -18908,7 +18908,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); if(cork_ageout) - uncork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE); + uncork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE); /* repeat the above test, but with max_decrement enabled to see @@ -18941,9 +18941,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -19453,9 +19453,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -19857,9 +19857,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -20114,9 +20114,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -20638,7 +20638,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { flush_cache(file_ptr, TRUE, FALSE, FALSE); - reset_entries(); + reset_entries(); } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20672,9 +20672,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (32 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - auto_size_ctl.flash_multiple = 1.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; + auto_size_ctl.flash_multiple = 1.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -20702,9 +20702,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if((cache_ptr->max_cache_size != (64 * 1024)) || (cache_ptr->min_clean_size != (32 * 1024)) || - (cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->cache_accesses != 0)) { + (cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->cache_accesses != 0)) { pass = FALSE; failure_mssg = "Unexpected cache config (0).\n"; @@ -20721,16 +20721,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (64 * 1024)) || - (cache_ptr->min_clean_size != (32 * 1024)) || - (cache_ptr->index_len != 1) || + if(pass && + (((cache_ptr->max_cache_size != (64 * 1024)) || + (cache_ptr->min_clean_size != (32 * 1024)) || + (cache_ptr->index_len != 1) || (cache_ptr->index_size != HUGE_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (1).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20747,17 +20747,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (80 * 1024)) || - (cache_ptr->min_clean_size != (40 * 1024)) || - (cache_ptr->index_len != 2) || + if(pass && + (((cache_ptr->max_cache_size != (80 * 1024)) || + (cache_ptr->min_clean_size != (40 * 1024)) || + (cache_ptr->index_len != 2) || (cache_ptr->index_size != (HUGE_ENTRY_SIZE + - MONSTER_ENTRY_SIZE)) || - (cache_ptr->cache_accesses != 1)))) { + MONSTER_ENTRY_SIZE)) || + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (2).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20773,17 +20773,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (144 * 1024)) || - (cache_ptr->min_clean_size != (72 * 1024)) || - (cache_ptr->index_len != 3) || + if(pass && + (((cache_ptr->max_cache_size != (144 * 1024)) || + (cache_ptr->min_clean_size != (72 * 1024)) || + (cache_ptr->index_len != 3) || (cache_ptr->index_size != ((2 * MONSTER_ENTRY_SIZE) + - HUGE_ENTRY_SIZE)) || - (cache_ptr->cache_accesses != 1)))) { + HUGE_ENTRY_SIZE)) || + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (3).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20797,16 +20797,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (144 * 1024)) || - (cache_ptr->min_clean_size != (72 * 1024)) || - (cache_ptr->index_len != 2) || + if(pass && + (((cache_ptr->max_cache_size != (144 * 1024)) || + (cache_ptr->min_clean_size != (72 * 1024)) || + (cache_ptr->index_len != 2) || (cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE)) || - (cache_ptr->cache_accesses != 2)))) { + (cache_ptr->cache_accesses != 2)))) { pass = FALSE; failure_mssg = "Unexpected cache config (4).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20816,8 +20816,8 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) */ if(pass) { - expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 1); - expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 2); + expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 1); + expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 2); if(pass) { @@ -20825,19 +20825,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(result != SUCCEED) { pass = FALSE; failure_mssg = "H5C_set_cache_auto_resize_config failed 13.\n"; - } + } } - if(pass && - (((cache_ptr->max_cache_size != (64 * 1024)) || - (cache_ptr->min_clean_size != (32 * 1024)) || - (cache_ptr->index_len != 0) || + if(pass && + (((cache_ptr->max_cache_size != (64 * 1024)) || + (cache_ptr->min_clean_size != (32 * 1024)) || + (cache_ptr->index_len != 0) || (cache_ptr->index_size != 0) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (5).\n"; - } + } } /* repeat the above basic test, only this time, use inserts to add @@ -20851,22 +20851,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) insert_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); - /* protect and unprotect a couple times to increment cache_accesses */ + /* protect and unprotect a couple times to increment cache_accesses */ protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1); unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1); unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (64 * 1024)) || - (cache_ptr->min_clean_size != (32 * 1024)) || - (cache_ptr->index_len != 1) || + if(pass && + (((cache_ptr->max_cache_size != (64 * 1024)) || + (cache_ptr->min_clean_size != (32 * 1024)) || + (cache_ptr->index_len != 1) || (cache_ptr->index_size != HUGE_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 2)))) { + (cache_ptr->cache_accesses != 2)))) { pass = FALSE; failure_mssg = "Unexpected cache config (6).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20880,17 +20880,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (80 * 1024)) || - (cache_ptr->min_clean_size != (40 * 1024)) || - (cache_ptr->index_len != 2) || + if(pass && + (((cache_ptr->max_cache_size != (80 * 1024)) || + (cache_ptr->min_clean_size != (40 * 1024)) || + (cache_ptr->index_len != 2) || (cache_ptr->index_size != - HUGE_ENTRY_SIZE + MONSTER_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 0)))) { + HUGE_ENTRY_SIZE + MONSTER_ENTRY_SIZE) || + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (7).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20901,17 +20901,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 5, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (144 * 1024)) || - (cache_ptr->min_clean_size != (72 * 1024)) || - (cache_ptr->index_len != 3) || + if(pass && + (((cache_ptr->max_cache_size != (144 * 1024)) || + (cache_ptr->min_clean_size != (72 * 1024)) || + (cache_ptr->index_len != 3) || (cache_ptr->index_size != - 2 * MONSTER_ENTRY_SIZE + HUGE_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 0)))) { + 2 * MONSTER_ENTRY_SIZE + HUGE_ENTRY_SIZE) || + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (8).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20925,16 +20925,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 6, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (144 * 1024)) || - (cache_ptr->min_clean_size != (72 * 1024)) || - (cache_ptr->index_len != 2) || + if(pass && + (((cache_ptr->max_cache_size != (144 * 1024)) || + (cache_ptr->min_clean_size != (72 * 1024)) || + (cache_ptr->index_len != 2) || (cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE)) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (9).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -20946,26 +20946,26 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) */ if(pass) { - expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 5); - expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 6); + expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 5); + expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 6); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 1024, TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 1024, TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 1024, TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, 1024, TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__DIRTIED_FLAG); - flush_cache(file_ptr, TRUE, FALSE, FALSE); + flush_cache(file_ptr, TRUE, FALSE, FALSE); if(pass) { @@ -20977,19 +20977,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) pass = FALSE; failure_mssg = "H5C_set_cache_auto_resize_config failed 13.\n"; - } + } } - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (3 * 1024)) || - (cache_ptr->index_len != 0) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (3 * 1024)) || + (cache_ptr->index_len != 0) || (cache_ptr->index_size != 0) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (10).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21009,16 +21009,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (3 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (3 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 4 * 1024) || - (cache_ptr->cache_accesses != 4)))) { + (cache_ptr->cache_accesses != 4)))) { pass = FALSE; failure_mssg = "Unexpected cache config (11).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21029,20 +21029,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (3 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (3 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (3 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (3 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 6 * 1024) || - (cache_ptr->cache_accesses != 5)))) { + (cache_ptr->cache_accesses != 5)))) { pass = FALSE; failure_mssg = "Unexpected cache config (12).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21054,20 +21054,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (10 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (10 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); - if(pass && - (((cache_ptr->max_cache_size != (13 * 1024)) || - (cache_ptr->min_clean_size != (13 * 512)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (13 * 1024)) || + (cache_ptr->min_clean_size != (13 * 512)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 13 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (13).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21078,20 +21078,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (10 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (10 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 22 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (14).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21102,20 +21102,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (10 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (10 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 31 * 1024) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (15).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21127,16 +21127,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); if(pass) { @@ -21147,19 +21147,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) pass = FALSE; failure_mssg = "H5C_set_cache_auto_resize_config failed 14.\n"; - } + } } - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (3 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (3 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 4 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (16).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21172,16 +21172,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (6 * 512)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (6 * 512)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 5 * 1024) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (17).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21190,16 +21190,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (13 * 1024)) || - (cache_ptr->min_clean_size != (13 * 512)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (13 * 1024)) || + (cache_ptr->min_clean_size != (13 * 512)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 13 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (18).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21210,16 +21210,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 22 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (19).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21230,16 +21230,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 31 * 1024) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (20).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21258,16 +21258,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__UNPIN_ENTRY_FLAG); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 31 * 1024) || - (cache_ptr->cache_accesses != 4)))) { + (cache_ptr->cache_accesses != 4)))) { pass = FALSE; failure_mssg = "Unexpected cache config (21).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21279,16 +21279,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if(pass) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); if(pass) { @@ -21299,19 +21299,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) pass = FALSE; failure_mssg = "H5C_set_cache_auto_resize_config failed 15.\n"; - } + } } - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (3 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (3 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 4 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (22).\n"; - } + } } if(pass) { @@ -21320,16 +21320,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (6 * 1024)) || - (cache_ptr->min_clean_size != (6 * 512)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (6 * 1024)) || + (cache_ptr->min_clean_size != (6 * 512)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 5 * 1024) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (23).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21338,16 +21338,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (13 * 1024)) || - (cache_ptr->min_clean_size != (13 * 512)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (13 * 1024)) || + (cache_ptr->min_clean_size != (13 * 512)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 13 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (24).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21358,16 +21358,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 22 * 1024) || - (cache_ptr->cache_accesses != 0)))) { + (cache_ptr->cache_accesses != 0)))) { pass = FALSE; failure_mssg = "Unexpected cache config (25).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21378,16 +21378,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 31 * 1024) || - (cache_ptr->cache_accesses != 1)))) { + (cache_ptr->cache_accesses != 1)))) { pass = FALSE; failure_mssg = "Unexpected cache config (26).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21406,16 +21406,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__UNPIN_ENTRY_FLAG); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 4) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 4) || (cache_ptr->index_size != 31 * 1024) || - (cache_ptr->cache_accesses != 4)))) { + (cache_ptr->cache_accesses != 4)))) { pass = FALSE; failure_mssg = "Unexpected cache config (27).\n"; - } + } } /* We have finished a basic check of the flash cache size increment @@ -21423,21 +21423,21 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) */ if(pass) { - expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13); + expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); + expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); + expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); + expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13); - if(pass && - (((cache_ptr->max_cache_size != (22 * 1024)) || - (cache_ptr->min_clean_size != (11 * 1024)) || - (cache_ptr->index_len != 0) || + if(pass && + (((cache_ptr->max_cache_size != (22 * 1024)) || + (cache_ptr->min_clean_size != (11 * 1024)) || + (cache_ptr->index_len != 0) || (cache_ptr->index_size != 0) || - (cache_ptr->cache_accesses != 4)))) { + (cache_ptr->cache_accesses != 4)))) { pass = FALSE; failure_mssg = "Unexpected cache config (28).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21471,9 +21471,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.4f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.4f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -21503,9 +21503,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if((cache_ptr->max_cache_size != (4 * 1024)) || (cache_ptr->min_clean_size != (4 * 512)) || - (cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->cache_accesses != 0)) { + (cache_ptr->index_len != 0) || + (cache_ptr->index_size != 0) || + (cache_ptr->cache_accesses != 0)) { pass = FALSE; failure_mssg = "bad cache after initialization 15.\n"; @@ -21524,17 +21524,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (4 * 1024)) || - (cache_ptr->min_clean_size != (4 * 512)) || - (cache_ptr->index_len != 1) || + if(pass && + (((cache_ptr->max_cache_size != (4 * 1024)) || + (cache_ptr->min_clean_size != (4 * 512)) || + (cache_ptr->index_len != 1) || (cache_ptr->index_size != LARGE_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 1) || - (rpt_fcn_called == TRUE)))) { + (cache_ptr->cache_accesses != 1) || + (rpt_fcn_called == TRUE)))) { pass = FALSE; failure_mssg = "Unexpected cache config (29).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21550,17 +21550,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (12 * 1024)) || - (cache_ptr->min_clean_size != (12 * 512)) || - (cache_ptr->index_len != 2) || + if(pass && + (((cache_ptr->max_cache_size != (12 * 1024)) || + (cache_ptr->min_clean_size != (12 * 512)) || + (cache_ptr->index_len != 2) || (cache_ptr->index_size != 2 * LARGE_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 1) || - (rpt_fcn_called != TRUE)))) { + (cache_ptr->cache_accesses != 1) || + (rpt_fcn_called != TRUE)))) { pass = FALSE; failure_mssg = "Unexpected cache config (30).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21577,17 +21577,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (12 * 1024)) || - (cache_ptr->min_clean_size != (12 * 512)) || - (cache_ptr->index_len != 3) || + if(pass && + (((cache_ptr->max_cache_size != (12 * 1024)) || + (cache_ptr->min_clean_size != (12 * 512)) || + (cache_ptr->index_len != 3) || (cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 3) || - (rpt_fcn_called != FALSE)))) { + (cache_ptr->cache_accesses != 3) || + (rpt_fcn_called != FALSE)))) { pass = FALSE; failure_mssg = "Unexpected cache config (31).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21628,19 +21628,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); - if(pass && - (((cache_ptr->max_cache_size != (4 * 1024 + 128)) || - (cache_ptr->min_clean_size != (2 * 1024 + 64)) || - (cache_ptr->index_len != 2) || + if(pass && + (((cache_ptr->max_cache_size != (4 * 1024 + 128)) || + (cache_ptr->min_clean_size != (2 * 1024 + 64)) || + (cache_ptr->index_len != 2) || (cache_ptr->index_size != - LARGE_ENTRY_SIZE + TINY_ENTRY_SIZE) || - (cache_ptr->cache_accesses != 1) || - (rpt_fcn_called == FALSE) || + LARGE_ENTRY_SIZE + TINY_ENTRY_SIZE) || + (cache_ptr->cache_accesses != 1) || + (rpt_fcn_called == FALSE) || (rpt_status != flash_increase)))) { pass = FALSE; failure_mssg = "Unexpected cache config (33).\n"; - } + } } if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -21661,7 +21661,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) if((cache_ptr->max_cache_size != (20 * 1024)) || (cache_ptr->min_clean_size != (10 * 1024)) || - (rpt_fcn_called == FALSE) || + (rpt_fcn_called == FALSE) || (rpt_status != at_max_size)) { pass = FALSE; @@ -21692,16 +21692,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) return (unsigned)!pass; } /* check_auto_cache_resize() */ - + /*------------------------------------------------------------------------- - * Function: check_auto_cache_resize_disable() + * Function: check_auto_cache_resize_disable() * - * Purpose: Test the various ways in which the resize code can - * be disabled. Unfortunately, there are quite a few of them. + * Purpose: Test the various ways in which the resize code can + * be disabled. Unfortunately, there are quite a few of them. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 12/16/04 * * Modifications: @@ -21748,7 +21748,7 @@ check_auto_cache_resize_disable(unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, + /* flash_incr_mode = */ H5C_flash_incr__off, /* double flash_multiple = */ 1.0f, /* double flash_threshold = */ 0.25f, @@ -21793,7 +21793,7 @@ check_auto_cache_resize_disable(unsigned paged) pass = FALSE; failure_mssg = "file_ptr NULL from setup_cache."; - } + } else { cache_ptr = file_ptr->shared->cache; @@ -21856,9 +21856,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -22014,9 +22014,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -22171,9 +22171,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -22328,9 +22328,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -22485,9 +22485,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -22641,9 +22641,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__off; @@ -22799,9 +22799,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -23026,9 +23026,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -23260,9 +23260,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -23498,9 +23498,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -23625,9 +23625,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -23752,9 +23752,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -23879,9 +23879,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -24006,9 +24006,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -24134,9 +24134,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__off; @@ -24290,9 +24290,9 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 1.0f; - auto_size_ctl.flash_threshold = 0.25f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 1.0f; + auto_size_ctl.flash_threshold = 0.25f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -24347,16 +24347,16 @@ check_auto_cache_resize_disable(unsigned paged) (cache_ptr->index_size != LARGE_ENTRY_SIZE) || (rpt_fcn_called != FALSE)))) { - HDfprintf(stdout, "\nmax_cache_size = %ld.\n", - (long)(cache_ptr->max_cache_size)); - HDfprintf(stdout, "min_clean_size = %ld.\n", - (long)(cache_ptr->min_clean_size)); - HDfprintf(stdout, "index_len = %ld.\n", - (long)(cache_ptr->index_len)); - HDfprintf(stdout, "index_size = %ld.\n", - (long)(cache_ptr->index_size)); - HDfprintf(stdout, "rpt_fcn_called = %ld.\n", - (long)(rpt_fcn_called)); + HDfprintf(stdout, "\nmax_cache_size = %ld.\n", + (long)(cache_ptr->max_cache_size)); + HDfprintf(stdout, "min_clean_size = %ld.\n", + (long)(cache_ptr->min_clean_size)); + HDfprintf(stdout, "index_len = %ld.\n", + (long)(cache_ptr->index_len)); + HDfprintf(stdout, "index_size = %ld.\n", + (long)(cache_ptr->index_size)); + HDfprintf(stdout, "rpt_fcn_called = %ld.\n", + (long)(rpt_fcn_called)); pass = FALSE; failure_mssg = "Unexpected cache size change results 46.\n"; @@ -24386,16 +24386,16 @@ check_auto_cache_resize_disable(unsigned paged) (cache_ptr->index_size != MONSTER_ENTRY_SIZE) || (rpt_fcn_called != FALSE)))) { - HDfprintf(stdout, "\nmax_cache_size = %ld.\n", - (long)(cache_ptr->max_cache_size)); - HDfprintf(stdout, "min_clean_size = %ld.\n", - (long)(cache_ptr->min_clean_size)); - HDfprintf(stdout, "index_len = %ld.\n", - (long)(cache_ptr->index_len)); - HDfprintf(stdout, "index_size = %ld.\n", - (long)(cache_ptr->index_size)); - HDfprintf(stdout, "rpt_fcn_called = %ld.\n", - (long)(rpt_fcn_called)); + HDfprintf(stdout, "\nmax_cache_size = %ld.\n", + (long)(cache_ptr->max_cache_size)); + HDfprintf(stdout, "min_clean_size = %ld.\n", + (long)(cache_ptr->min_clean_size)); + HDfprintf(stdout, "index_len = %ld.\n", + (long)(cache_ptr->index_len)); + HDfprintf(stdout, "index_size = %ld.\n", + (long)(cache_ptr->index_size)); + HDfprintf(stdout, "rpt_fcn_called = %ld.\n", + (long)(rpt_fcn_called)); pass = FALSE; failure_mssg = "Unexpected cache size change results 47.\n"; @@ -24423,16 +24423,16 @@ check_auto_cache_resize_disable(unsigned paged) } /* check_auto_cache_resize_disable() */ - + /*------------------------------------------------------------------------- - * Function: check_auto_cache_resize_epoch_markers() + * Function: check_auto_cache_resize_epoch_markers() * - * Purpose: Verify that the auto-resize code manages epoch markers - * correctly. + * Purpose: Verify that the auto-resize code manages epoch markers + * correctly. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 12/16/04 * * Modifications: @@ -24476,9 +24476,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, @@ -24565,9 +24565,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -24739,9 +24739,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -24860,9 +24860,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -24939,9 +24939,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -25052,9 +25052,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); - auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0f; - auto_size_ctl.flash_threshold = 0.5f; + auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__off; @@ -25129,21 +25129,21 @@ check_auto_cache_resize_epoch_markers(unsigned paged) } /* check_auto_cache_resize_epoch_markers() */ - + /*------------------------------------------------------------------------- - * Function: check_auto_cache_resize_input_errs() + * Function: check_auto_cache_resize_input_errs() * - * Purpose: Verify that H5C_set_cache_auto_resize_config() detects - * and rejects invalid input. + * Purpose: Verify that H5C_set_cache_auto_resize_config() detects + * and rejects invalid input. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/29/04 * * Modifications: * - * Added code to verify that errors in the flash cache size + * Added code to verify that errors in the flash cache size * increment related fields are caught as well. * * JRM -- 1/17/08 @@ -25183,9 +25183,9 @@ check_auto_cache_resize_input_errs(unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, @@ -25291,9 +25291,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25366,9 +25366,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25442,9 +25442,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25515,9 +25515,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25590,9 +25590,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25662,9 +25662,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25738,9 +25738,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25810,9 +25810,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25882,9 +25882,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -25957,9 +25957,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26029,9 +26029,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26096,7 +26096,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = - (enum H5C_cache_incr_mode) -1; /* INVALID */ + (enum H5C_cache_incr_mode) -1; /* INVALID */ invalid_auto_size_ctl.lower_hr_threshold = 0.75f; @@ -26105,9 +26105,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26169,7 +26169,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = - (enum H5C_cache_incr_mode) 2; /* INVALID */ + (enum H5C_cache_incr_mode) 2; /* INVALID */ invalid_auto_size_ctl.lower_hr_threshold = 0.75f; @@ -26178,9 +26178,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26253,9 +26253,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26325,9 +26325,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26397,9 +26397,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26472,9 +26472,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26547,10 +26547,10 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = - (enum H5C_cache_flash_incr_mode) -1; /* INVALID */ - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = + (enum H5C_cache_flash_incr_mode) -1; /* INVALID */ + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26622,10 +26622,10 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = - H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 0.09f; /* INVALID */ - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = + H5C_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 0.09f; /* INVALID */ + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26695,10 +26695,10 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = - H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 10.01f; /* INVALID */ - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = + H5C_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 10.01f; /* INVALID */ + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26770,10 +26770,10 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = - H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 1.0f; - invalid_auto_size_ctl.flash_threshold = 0.09f; /* INVALID */ + invalid_auto_size_ctl.flash_incr_mode = + H5C_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 1.0f; + invalid_auto_size_ctl.flash_threshold = 0.09f; /* INVALID */ invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26843,10 +26843,10 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = - H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 1.0f; - invalid_auto_size_ctl.flash_threshold = 1.001f; /* INVALID */ + invalid_auto_size_ctl.flash_incr_mode = + H5C_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 1.0f; + invalid_auto_size_ctl.flash_threshold = 1.001f; /* INVALID */ invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -26919,13 +26919,13 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = - (enum H5C_cache_decr_mode) -1; /* INVALID */ + (enum H5C_cache_decr_mode) -1; /* INVALID */ invalid_auto_size_ctl.upper_hr_threshold = 0.999f; @@ -26992,13 +26992,13 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = - (enum H5C_cache_decr_mode) 4; /* INVALID */ + (enum H5C_cache_decr_mode) 4; /* INVALID */ invalid_auto_size_ctl.upper_hr_threshold = 0.999f; @@ -27068,9 +27068,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -27140,9 +27140,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; @@ -27215,9 +27215,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -27286,9 +27286,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -27361,9 +27361,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out; @@ -27432,9 +27432,9 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0f; - invalid_auto_size_ctl.flash_threshold = 0.5f; + invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -27538,21 +27538,21 @@ check_auto_cache_resize_input_errs(unsigned paged) } /* check_auto_cache_resize_input_errs() */ - + /*------------------------------------------------------------------------- - * Function: check_auto_cache_resize_aux_fcns() + * Function: check_auto_cache_resize_aux_fcns() * - * Purpose: Verify that the auxilary functions associated with - * the automatic cache resize capability are operating - * correctly. These functions are: + * Purpose: Verify that the auxilary functions associated with + * the automatic cache resize capability are operating + * correctly. These functions are: * - * H5C_get_cache_size() - * H5C_get_cache_hit_rate() - * H5C_reset_cache_hit_rate_stats() + * H5C_get_cache_size() + * H5C_get_cache_hit_rate() + * H5C_reset_cache_hit_rate_stats() * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 11/4/04 * * Modifications: @@ -27601,9 +27601,9 @@ check_auto_cache_resize_aux_fcns(unsigned paged) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off, @@ -28078,11 +28078,11 @@ check_auto_cache_resize_aux_fcns(unsigned paged) } /* check_auto_cache_resize_aux_fcns() */ - + /*------------------------------------------------------------------------- - * Function: check_metadata_blizzard_absence() + * Function: check_metadata_blizzard_absence() * - * Purpose: Test to verify that a 'metadata blizzard' can not occur + * Purpose: Test to verify that a 'metadata blizzard' can not occur * upon insertion into the cache. * * A 'metadata blizzard' in this context occurs when the cache @@ -28096,9 +28096,9 @@ check_auto_cache_resize_aux_fcns(unsigned paged) * flushing the entire cache is what constitutes a 'metadata * blizzard'. * - * Return: void + * Return: void * - * Programmer: Mike McGreevy + * Programmer: Mike McGreevy * <mamcgree@hdfgroup.org> * 12/16/08 * @@ -28129,158 +28129,158 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) */ struct expected_entry_status expected[150] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; pass = TRUE; @@ -28441,13 +28441,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) */ /* entry w/ index 0 has now been flushed and is now clean. */ - expected[0].is_dirty = FALSE; - expected[0].serialized = TRUE; + expected[0].is_dirty = FALSE; + expected[0].serialized = TRUE; /* entry w/ index 26 is now in the cache and dirty. */ - expected[26].in_cache = TRUE; - expected[26].is_dirty = TRUE; - expected[26].deserialized = (unsigned char)deserialized; + expected[26].in_cache = TRUE; + expected[26].is_dirty = TRUE; + expected[26].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28495,13 +28495,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) */ /* entry w/ index 1 has now been flushed and is now clean. */ - expected[1].is_dirty = FALSE; - expected[1].serialized = TRUE; + expected[1].is_dirty = FALSE; + expected[1].serialized = TRUE; /* entry w/ index 27 is now in the cache and dirty. */ - expected[27].in_cache = TRUE; - expected[27].is_dirty = TRUE; - expected[27].deserialized = (unsigned char)deserialized; + expected[27].in_cache = TRUE; + expected[27].is_dirty = TRUE; + expected[27].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28544,9 +28544,9 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) expected[entry_idx - 26].is_dirty = FALSE; expected[entry_idx - 26].serialized = TRUE; - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28617,19 +28617,19 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) */ /* entry w/ index 0 has been evicted. */ - expected[0].in_cache = FALSE; - expected[0].destroyed = TRUE; + expected[0].in_cache = FALSE; + expected[0].destroyed = TRUE; /* entries w/ indices 24,25 have now been flushed and are clean. */ - expected[24].is_dirty = FALSE; - expected[24].serialized = TRUE; - expected[25].is_dirty = FALSE; - expected[25].serialized = TRUE; + expected[24].is_dirty = FALSE; + expected[24].serialized = TRUE; + expected[25].is_dirty = FALSE; + expected[25].serialized = TRUE; /* entry w/ index 50 is now in the cache and dirty */ - expected[50].in_cache = TRUE; - expected[50].is_dirty = TRUE; - expected[50].deserialized = (unsigned char)deserialized; + expected[50].in_cache = TRUE; + expected[50].is_dirty = TRUE; + expected[50].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28672,13 +28672,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } /* This past inserted entry is now in the cache and dirty */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* The entry inserted 50 insertions ago has been evicted */ - expected[entry_idx - 50].in_cache = FALSE; - expected[entry_idx - 50].destroyed = TRUE; + expected[entry_idx - 50].in_cache = FALSE; + expected[entry_idx - 50].destroyed = TRUE; /* If the newly inserted entry is among the first 24 * insertions in this loop, then the insertion will @@ -28803,13 +28803,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } /* This past inserted entry is now in the cache and dirty */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* The entry with ID minus 50 will have been evicted */ - expected[entry_idx - 50].in_cache = FALSE; - expected[entry_idx - 50].destroyed = TRUE; + expected[entry_idx - 50].in_cache = FALSE; + expected[entry_idx - 50].destroyed = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28851,17 +28851,17 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) */ /* entry w/ index 76 has been evicted. */ - expected[76].in_cache = FALSE; - expected[76].destroyed = TRUE; + expected[76].in_cache = FALSE; + expected[76].destroyed = TRUE; /* entry w/ index 100 has now been flushed and is now clean. */ - expected[100].is_dirty = FALSE; - expected[100].serialized = TRUE; + expected[100].is_dirty = FALSE; + expected[100].serialized = TRUE; /* entry w/ index 26 is now in the cache and dirty. */ - expected[126].in_cache = TRUE; - expected[126].is_dirty = TRUE; - expected[126].deserialized = (unsigned char)deserialized; + expected[126].in_cache = TRUE; + expected[126].is_dirty = TRUE; + expected[126].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28897,13 +28897,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } /* This past inserted entry is now in the cache and dirty */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* The entry with ID minus 50 will have been evicted */ - expected[entry_idx - 50].in_cache = FALSE; - expected[entry_idx - 50].destroyed = TRUE; + expected[entry_idx - 50].in_cache = FALSE; + expected[entry_idx - 50].destroyed = TRUE; /* The entry with ID minus 26 will now be clean */ expected[entry_idx - 26].is_dirty = FALSE; @@ -28939,15 +28939,15 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } /* check_metadata_blizzard_absence() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_deps() + * Function: check_flush_deps() * - * Purpose: Exercise the flush dependency routines. + * Purpose: Exercise the flush dependency routines. * - * Return: 0 on success, non-zero on failure + * Return: 0 on success, non-zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 3/12/09 * *------------------------------------------------------------------------- @@ -28963,13 +28963,13 @@ check_flush_deps(unsigned paged) unsigned u; /* Local index variable */ struct expected_entry_status expected[5] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; if(paged) @@ -29020,16 +29020,16 @@ check_flush_deps(unsigned paged) if(!pass) CACHE_ERROR("protect_entry failed") /* Check the parent's entry status */ - entry_ptr = &(base_addr[1]); - if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, + entry_ptr = &(base_addr[1]); + if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") /* Check the child's entry status */ - entry_ptr = &(base_addr[0]); - if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, + entry_ptr = &(base_addr[0]); + if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || is_flush_dep_child) @@ -29039,16 +29039,16 @@ check_flush_deps(unsigned paged) if(!pass) CACHE_ERROR("create_flush_dependency failed") /* Check the parent's entry status */ - entry_ptr = &(base_addr[1]); - if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, + entry_ptr = &(base_addr[1]); + if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || !is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") /* Check the child's entry status */ - entry_ptr = &(base_addr[0]); - if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, + entry_ptr = &(base_addr[0]); + if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || !is_flush_dep_child) @@ -30678,15 +30678,15 @@ done: return (unsigned)!pass; } /* check_flush_deps() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_deps_err() + * Function: check_flush_deps_err() * - * Purpose: Check the flush dependency routines for error conditions. + * Purpose: Check the flush dependency routines for error conditions. * - * Return: 0 on success, non-zero on failure + * Return: 0 on success, non-zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 3/16/09 * *------------------------------------------------------------------------- @@ -30901,16 +30901,16 @@ done: return (unsigned)!pass; } /* check_flush_deps_err() */ - + /*------------------------------------------------------------------------- - * Function: check_flush_deps_order() + * Function: check_flush_deps_order() * - * Purpose: Verify that the order that entries with flush dependencies + * Purpose: Verify that the order that entries with flush dependencies * is correct * - * Return: 0 on success, non-zero on failure + * Return: 0 on success, non-zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 3/17/09 * *------------------------------------------------------------------------- @@ -30925,13 +30925,13 @@ check_flush_deps_order(unsigned paged) unsigned u; /* Local index variable */ struct expected_entry_status expected[5] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; unsigned flush_order; /* Index for tracking flush order */ @@ -33473,15 +33473,15 @@ done: return (unsigned)!pass; } /* check_flush_deps_order() */ - + /*------------------------------------------------------------------------- - * Function: check_notify_cb() + * Function: check_notify_cb() * - * Purpose: Exercise the client 'notify' callback. + * Purpose: Exercise the client 'notify' callback. * - * Return: 0 on success, non-zero on failure + * Return: 0 on success, non-zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 4/28/09 * *------------------------------------------------------------------------- @@ -33498,13 +33498,13 @@ check_notify_cb(unsigned paged) unsigned u; /* Local index variable */ struct expected_entry_status expected[5] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { NOTIFY_ENTRY_TYPE, 0, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { NOTIFY_ENTRY_TYPE, 1, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { NOTIFY_ENTRY_TYPE, 2, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { NOTIFY_ENTRY_TYPE, 0, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { NOTIFY_ENTRY_TYPE, 1, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { NOTIFY_ENTRY_TYPE, 2, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; if(paged) @@ -33545,7 +33545,7 @@ check_notify_cb(unsigned paged) if(!pass) CACHE_ERROR("verify_entry_status failed") /* Check the entry's 'after insert' count */ - entry_ptr = &(base_addr[u]); + entry_ptr = &(base_addr[u]); if(1 != entry_ptr->notify_after_insert_count) CACHE_ERROR("invalid notify after insert count") if(0 != entry_ptr->notify_before_evict_count) @@ -33573,7 +33573,7 @@ check_notify_cb(unsigned paged) if(!pass) CACHE_ERROR("verify_entry_status failed") /* Check the entry's 'before evict' count */ - entry_ptr = &(base_addr[u]); + entry_ptr = &(base_addr[u]); if(1 != entry_ptr->notify_after_insert_count) CACHE_ERROR("invalid notify after insert count") if(1 != entry_ptr->notify_before_evict_count) @@ -33601,7 +33601,7 @@ check_notify_cb(unsigned paged) if(!pass) CACHE_ERROR("verify_entry_status failed") /* Check the entry's 'after insert' count */ - entry_ptr = &(base_addr[u]); + entry_ptr = &(base_addr[u]); if(2 != entry_ptr->notify_after_insert_count) CACHE_ERROR("invalid notify after insert count") if(1 != entry_ptr->notify_before_evict_count) @@ -33628,7 +33628,7 @@ check_notify_cb(unsigned paged) if(!pass) CACHE_ERROR("verify_entry_status failed") /* Check the entry's 'after insert' count */ - entry_ptr = &(base_addr[u]); + entry_ptr = &(base_addr[u]); if(2 != entry_ptr->notify_after_insert_count) CACHE_ERROR("invalid notify after insert count") if(1 != entry_ptr->notify_before_evict_count) @@ -33656,7 +33656,7 @@ check_notify_cb(unsigned paged) if(!pass) CACHE_ERROR("verify_entry_status failed") /* Check the entry's 'before evict' count */ - entry_ptr = &(base_addr[u]); + entry_ptr = &(base_addr[u]); if(2 != entry_ptr->notify_after_insert_count) CACHE_ERROR("invalid notify after insert count") if(2 != entry_ptr->notify_before_evict_count) @@ -33676,18 +33676,18 @@ done: return (unsigned)!pass; } /* check_notify_cb() */ - + /*------------------------------------------------------------------------- - * Function: check_metadata_cork + * Function: check_metadata_cork * - * Purpose: To verify that dirty corked entries are not evicted from the cache - * but clean corked entries can be evicted from the cache. - * The min_clean_size does not have effect. - * NOTE: This is a modification of check_metadata_blizzard_absence(). + * Purpose: To verify that dirty corked entries are not evicted from the cache + * but clean corked entries can be evicted from the cache. + * The min_clean_size does not have effect. + * NOTE: This is a modification of check_metadata_blizzard_absence(). * - * Return: void + * Return: void * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * *------------------------------------------------------------------------- */ @@ -33714,158 +33714,158 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) */ struct expected_entry_status expected[150] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} } ; pass = TRUE; @@ -33912,9 +33912,9 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) * Phase 1: * * Inserting dirty corked entries into an empty cache, until the cache - * violates the min_clean_size requirement. - * Since entries are all dirty and corked, no entry will get flushed or - * evicted. + * violates the min_clean_size requirement. + * Since entries are all dirty and corked, no entry will get flushed or + * evicted. * * ======================================================================== * ======================================================================== @@ -33966,9 +33966,9 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) * Phase 2: * * Inserting entries into a cache that violates the min_clean_size, - * until the cache is full. - * Since entries are all dirty and corked, no entry during this phase - * will get flushed or evicted. + * until the cache is full. + * Since entries are all dirty and corked, no entry during this phase + * will get flushed or evicted. * * ======================================================================== * ======================================================================== @@ -33997,14 +33997,14 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) * * Expected status is that there are 27 entries in the cache, and * all entries remain the same as before since they are all corked - * and dirty + * and dirty */ /* entry w/ index 26 is now in the cache and dirty. */ - expected[26].in_cache = TRUE; - expected[26].is_dirty = TRUE; - expected[26].deserialized = (unsigned char)deserialized; - expected[26].is_corked = TRUE; + expected[26].in_cache = TRUE; + expected[26].is_dirty = TRUE; + expected[26].deserialized = (unsigned char)deserialized; + expected[26].is_corked = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -34043,10 +34043,10 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) * all entries are dirty corked entries. * */ - expected[27].in_cache = TRUE; - expected[27].is_dirty = TRUE; - expected[27].deserialized = (unsigned char)deserialized; - expected[27].is_corked = TRUE; + expected[27].in_cache = TRUE; + expected[27].is_dirty = TRUE; + expected[27].deserialized = (unsigned char)deserialized; + expected[27].is_corked = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -34082,12 +34082,12 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) H5C__DIRTIED_FLAG); /* unsigned int flags */ } - /* - * Expected status: all entries are dirty corked entries. + /* + * Expected status: all entries are dirty corked entries. */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; expected[entry_idx].is_corked = TRUE; /* Verify the status */ @@ -34112,8 +34112,8 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) /* ======================================================================== * ======================================================================== * Phase 3: - * Inserting entries into a cache that is completely full. - * No entry is flushed or evicted because all entries are dirty & corked. + * Inserting entries into a cache that is completely full. + * No entry is flushed or evicted because all entries are dirty & corked. * * ======================================================================== * ======================================================================== @@ -34145,10 +34145,10 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) } /* This past inserted entry is now in the cache: dirty and corked */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; - expected[entry_idx].is_corked = TRUE; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].is_corked = TRUE; /* Verify this expected status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -34192,7 +34192,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) verify_clean(); /* Verify the status of the entries. */ - /* All entries are flushed, clean but still corked */ + /* All entries are flushed, clean but still corked */ for (i = 0; i < 100; i++) { expected[i].serialized = TRUE; expected[i].is_dirty = FALSE; @@ -34211,21 +34211,21 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) if(pass) { - /* Will evict 50 clean "corked" entries all at once when inserting the 100th entry */ - for(i = 0; i < 51; i++) { - expected[i].in_cache = FALSE; - expected[i].destroyed = TRUE; - expected[i].is_corked = TRUE; - } + /* Will evict 50 clean "corked" entries all at once when inserting the 100th entry */ + for(i = 0; i < 51; i++) { + expected[i].in_cache = FALSE; + expected[i].destroyed = TRUE; + expected[i].is_corked = TRUE; + } - /* Insert the 100th entry */ - if(fill_via_insertion) { + /* Insert the 100th entry */ + if(fill_via_insertion) { insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ - 100, /* int32_t idx */ + 100, /* int32_t idx */ H5C__NO_FLAGS_SET); /* unsigned int flags */ - } else { + } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 100); /* int32-t idx */ @@ -34234,16 +34234,16 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) entry_type, /* int32_t type */ 100, /* int32_t idx */ H5C__DIRTIED_FLAG); /* unsigned int flags */ - } + } - /* The 100th inserted entry is now in the cache and dirty */ - expected[100].in_cache = TRUE; - expected[100].is_dirty = TRUE; - expected[100].deserialized = (unsigned char)deserialized; - expected[100].is_corked = TRUE; + /* The 100th inserted entry is now in the cache and dirty */ + expected[100].in_cache = TRUE; + expected[100].is_dirty = TRUE; + expected[100].deserialized = (unsigned char)deserialized; + expected[100].is_corked = TRUE; - /* verify the status */ - verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ + /* verify the status */ + verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ 100, /* int tag */ 150, /* int num_entries */ expected); /* struct expected_entry_staus[] */ @@ -34257,13 +34257,13 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) if(pass) { /* Insert 25 more corked entries (indexes 101 through 125) into the cache. */ - /* Clean entry will be evicted one a time */ + /* Clean entry will be evicted one a time */ for (entry_idx = 101; entry_idx < 126; entry_idx++) { if(fill_via_insertion) { insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ - entry_idx, /* int32_t idx */ + entry_idx, /* int32_t idx */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { @@ -34278,21 +34278,21 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) } /* The inserted entry is now in the cache and dirty */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; - expected[entry_idx].is_corked = TRUE; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].is_corked = TRUE; - expected[entry_idx - 50].in_cache = FALSE; - expected[entry_idx - 50].destroyed = TRUE; - expected[entry_idx - 50].is_corked = TRUE; + expected[entry_idx - 50].in_cache = FALSE; + expected[entry_idx - 50].destroyed = TRUE; + expected[entry_idx - 50].is_corked = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ entry_idx, /* int tag */ 150, /* int num_entries */ expected); /* struct expected_entry_staus[] */ - } /* end for */ + } /* end for */ } @@ -34306,30 +34306,30 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) /* Insert the 127th entry (index = 126) into the cache. */ if(fill_via_insertion) { - insert_entry(file_ptr, /* H5F_t * file_ptr */ - entry_type, /* int32_t type */ - 126, /* int32_t idx */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + insert_entry(file_ptr, /* H5F_t * file_ptr */ + entry_type, /* int32_t type */ + 126, /* int32_t idx */ + H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { - protect_entry(file_ptr, /* H5F_t * file_ptr */ - entry_type, /* int32_t type */ - 126); /* int32-t idx */ + protect_entry(file_ptr, /* H5F_t * file_ptr */ + entry_type, /* int32_t type */ + 126); /* int32-t idx */ - unprotect_entry(file_ptr, /* H5F_t * file_ptr */ + unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ - 126, /* int32_t idx */ + 126, /* int32_t idx */ H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Verify the status of the entries. */ - expected[126].in_cache = TRUE; - expected[126].is_dirty = TRUE; - expected[126].deserialized = (unsigned char)deserialized; - expected[126].is_corked = TRUE; + expected[126].in_cache = TRUE; + expected[126].is_dirty = TRUE; + expected[126].deserialized = (unsigned char)deserialized; + expected[126].is_corked = TRUE; - expected[126 - 50].in_cache = FALSE; - expected[126 - 50].destroyed = TRUE; - expected[126 - 50].is_corked = TRUE; + expected[126 - 50].in_cache = FALSE; + expected[126 - 50].destroyed = TRUE; + expected[126 - 50].is_corked = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -34367,15 +34367,15 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) } /* This past inserted entry is now in the cache, dirty and corked */ - expected[entry_idx].in_cache = TRUE; - expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].deserialized = (unsigned char)deserialized; - expected[entry_idx].is_corked = TRUE; + expected[entry_idx].in_cache = TRUE; + expected[entry_idx].is_dirty = TRUE; + expected[entry_idx].deserialized = (unsigned char)deserialized; + expected[entry_idx].is_corked = TRUE; - /* Entry that is 50 entries away will be evicted since it is clean even though corked */ - expected[entry_idx - 50].in_cache = FALSE; - expected[entry_idx - 50].destroyed = TRUE; - expected[entry_idx - 50].is_corked = TRUE; + /* Entry that is 50 entries away will be evicted since it is clean even though corked */ + expected[entry_idx - 50].in_cache = FALSE; + expected[entry_idx - 50].destroyed = TRUE; + expected[entry_idx - 50].is_corked = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -34405,34 +34405,34 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) } /* check_metadata_cork() */ - + /*------------------------------------------------------------------------- - * Function: check_entry_deletions_during_scans() + * Function: check_entry_deletions_during_scans() * - * Purpose: With the addition of the H5C__TAKE_OWNERSHIP_FLAG, it is - * possible for an entry to be removed from the cache as a - * side effect of flushing an entry. + * Purpose: With the addition of the H5C__TAKE_OWNERSHIP_FLAG, it is + * possible for an entry to be removed from the cache as a + * side effect of flushing an entry. * - * For the most part, this doesn't cause problems. However, - * during the scans of lists, it is possible that the entry - * removed will be the next entry in the scan -- which if not - * detected, will typeically cause the cache to attempt to flush - * an entry that is no longer in the cache, and which may have - * been deleted. + * For the most part, this doesn't cause problems. However, + * during the scans of lists, it is possible that the entry + * removed will be the next entry in the scan -- which if not + * detected, will typeically cause the cache to attempt to flush + * an entry that is no longer in the cache, and which may have + * been deleted. * - * This function contans tests for correct handling on this - * situation. + * This function contans tests for correct handling on this + * situation. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/3/15 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -34460,9 +34460,9 @@ check_entry_deletions_during_scans(unsigned paged) file_ptr = setup_cache((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024), paged); } - /* run the tests. This set of tests is somewhat eclectic, as - * we are trying to test all locations where the deletion of - * an entry from the cache as a side effect of the fluch of + /* run the tests. This set of tests is somewhat eclectic, as + * we are trying to test all locations where the deletion of + * an entry from the cache as a side effect of the fluch of * a different entry could cause problems. */ @@ -34502,32 +34502,32 @@ check_entry_deletions_during_scans(unsigned paged) } /* check_entry_deletions_during_scans() */ - + /*------------------------------------------------------------------------- - * Function: cedds__expunge_dirty_entry_in_flush_test() + * Function: cedds__expunge_dirty_entry_in_flush_test() * - * Purpose: Verify that H5C_flush_cache() can handle the removal of - * a dirty entry from the cache during its scan of the - * skip list. + * Purpose: Verify that H5C_flush_cache() can handle the removal of + * a dirty entry from the cache during its scan of the + * skip list. * - * Do this by setting up a full cache, with the last entry - * on the LRU being both dirty and having a flush operation - * that deletes the second to last entry on the LRU. Then - * flush the cache, triggering the flush of the last - * item, and thereby the deletion of the second to last item. + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deletes the second to last entry on the LRU. Then + * flush the cache, triggering the flush of the last + * item, and thereby the deletion of the second to last item. * - * H5C_flush_cache() should handle this deletion gracefully. + * H5C_flush_cache() should handle this deletion gracefully. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/4/15 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -34536,8 +34536,8 @@ static void cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - int i; - herr_t result; + int i; + herr_t result; struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -34545,12 +34545,12 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) * array only processes as much of it as it is told to, we don't have to * worry about maintaining the status of entries that we haven't used yet. */ - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE} + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE} }; if(pass) { @@ -34569,15 +34569,15 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) || (cache_ptr->min_clean_size != (1 * 1024 * 1024))) { - pass = FALSE; - failure_mssg = - "unexpected cache config at start of cedds expunge dirty entry in flush test."; + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds expunge dirty entry in flush test."; } else { /* set min clean size to zero for this test as it simplifies - * computing the expected cache size after each operation. - */ + * computing the expected cache size after each operation. + */ cache_ptr->min_clean_size = 0; } @@ -34585,50 +34585,50 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) if(pass) { - /* The basic idea of this test is to setup the cache such - * that: - * - * 1) the cache contains several dirty entries. - * - * 2) the first entry on the slist is dirty, and has a flush - * operation that will remove the second entry on the + /* The basic idea of this test is to setup the cache such + * that: + * + * 1) the cache contains several dirty entries. + * + * 2) the first entry on the slist is dirty, and has a flush + * operation that will remove the second entry on the * slist. * - * Then load flush the cache. Cache should handle the - * removal of the next entry in the slist scan gracefully. + * Then load flush the cache. Cache should handle the + * removal of the next entry in the slist scan gracefully. */ - /* reset the stats before we start. If stats are enabled, we will - * check to see if they are as expected at the end. - */ - H5C_stats__reset(cache_ptr); + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); - /* Load four huge entries into the cache. Recall that huge entries + /* Load four huge entries into the cache. Recall that huge entries * are one fourth the size of monster entries (16 KB vs. 64 KB). */ - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { - protect_entry(file_ptr, HUGE_ENTRY_TYPE, i); - unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, HUGE_ENTRY_TYPE, i); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } - if((cache_ptr->index_len != 4) || + if((cache_ptr->index_len != 4) || (cache_ptr->index_size != (4 * HUGE_ENTRY_SIZE))) { pass = FALSE; - failure_mssg = "unexpected size/len in cedds expunge dirty entry in flush test (1)"; - } + failure_mssg = "unexpected size/len in cedds expunge dirty entry in flush test (1)"; + } } if(pass) { - /* Next, set up the flush operation: - * - * (HET, 0) expunges (HET, 1) - * - */ + /* Next, set up the flush operation: + * + * (HET, 0) expunges (HET, 1) + * + */ add_flush_op(HUGE_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, HUGE_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL); @@ -34636,27 +34636,27 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) if(pass) { - /* to summarize, at present the following entries - * are in cache with the following characteristics: - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (HET, 0) Y 16 KB Y N - expunge (HET 1) - * - * (HET, 1) Y 16 KB Y N - - + /* to summarize, at present the following entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (HET, 0) Y 16 KB Y N - expunge (HET 1) + * + * (HET, 1) Y 16 KB Y N - - * - * (HET, 2) Y 16 KB Y N - - + * (HET, 2) Y 16 KB Y N - - * - * (HET, 3) Y 16 KB Y N - - - * - * Recall that in this test bed, flush operations are excuted the - * first time the associated entry is flushed, and are then - * deleted. - */ + * (HET, 3) Y 16 KB Y N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ - /* verify the expected status of all entries we have loaded to date: */ - verify_entry_status(cache_ptr, 0, 4, expected); + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 4, expected); } /* flush the cache to run the test. In the process, clean up after test. */ @@ -34684,7 +34684,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) * values. */ if(pass) - if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0) || (cache_ptr->clears[HUGE_ENTRY_TYPE] != 1) || (cache_ptr->flushes[HUGE_ENTRY_TYPE] != 3) || @@ -34708,7 +34708,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) } /* end if */ if(pass) - if((cache_ptr->slist_scan_restarts != 1) || + if((cache_ptr->slist_scan_restarts != 1) || (cache_ptr->LRU_scan_restarts != 0) || (cache_ptr->index_scan_restarts != 0)) { pass = FALSE; @@ -34727,34 +34727,34 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) } /* cedds__expunge_dirty_entry_in_flush_test() */ - + /*------------------------------------------------------------------------- - * Function: cedds__H5C_make_space_in_cache() + * Function: cedds__H5C_make_space_in_cache() * - * Purpose: Verify that H5C__make_space_in_cache() can handle the - * removal from the cache of the next item in its reverse scan - * of the LRU list. + * Purpose: Verify that H5C__make_space_in_cache() can handle the + * removal from the cache of the next item in its reverse scan + * of the LRU list. * - * Do this by setting up a full cache, with the last entry - * on the LRU being both dirty and having a flush operation - * that deleted the second to last entry on the LRU. Then - * load an additional entry, triggering the flush of the last - * item, and thereby the deletion of the second to last item. + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deleted the second to last entry on the LRU. Then + * load an additional entry, triggering the flush of the last + * item, and thereby the deletion of the second to last item. * - * H5C__make_space_in_cache() should detect this deletion, and - * restart its scan of the LRU from the tail, instead of - * examining the now deleted next item up on the LRU. + * H5C__make_space_in_cache() should detect this deletion, and + * restart its scan of the LRU from the tail, instead of + * examining the now deleted next item up on the LRU. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/4/15 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -34763,10 +34763,10 @@ static void cedds__H5C_make_space_in_cache(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - int i; - const int num_huge_entries = 4; - const int num_monster_entries = 32; - herr_t result; + int i; + const int num_huge_entries = 4; + const int num_monster_entries = 32; + herr_t result; struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -34774,44 +34774,44 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) * array only processes as much of it as it is told to, we don't have to * worry about maintaining the status of entries that we haven't used yet. */ - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, }; if(pass) { @@ -34830,15 +34830,15 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) || (cache_ptr->min_clean_size != (1 * 1024 * 1024))) { - pass = FALSE; - failure_mssg = - "unexpected cache config at start of cedds H5C__make_space_in_cache() test."; + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds H5C__make_space_in_cache() test."; } else { /* set min clean size to zero for this test as it simplifies - * computing the expected cache size after each operation. - */ + * computing the expected cache size after each operation. + */ cache_ptr->min_clean_size = 0; } @@ -34846,54 +34846,54 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(pass) { - /* The basic idea of this test is to setup the cache such - * that: - * - * 1) the cache is full - * - * 2) the last entry on the LRU is dirty, and has a flush - * operation that will remove the second to last entry + /* The basic idea of this test is to setup the cache such + * that: + * + * 1) the cache is full + * + * 2) the last entry on the LRU is dirty, and has a flush + * operation that will remove the second to last entry * on the LRU from the cache. * - * Then load another entry into the cache. See if - * H5C__make_space_in_cache() detects the removal of - * the next item in the scan, and restarts the scan - * from the bottom of the LRU. Note that the newly + * Then load another entry into the cache. See if + * H5C__make_space_in_cache() detects the removal of + * the next item in the scan, and restarts the scan + * from the bottom of the LRU. Note that the newly * loaded entry must be large enough to require that * the scan continue after the entry is expunged. */ - /* reset the stats before we start. If stats are enabled, we will - * check to see if they are as expected at the end. - */ - H5C_stats__reset(cache_ptr); + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); - /* Load four huge entries into the cache. Recall that huge entries + /* Load four huge entries into the cache. Recall that huge entries * are one fourth the size of monster entries (16 KB vs. 64 KB). */ - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { - protect_entry(file_ptr, HUGE_ENTRY_TYPE, i); - unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, HUGE_ENTRY_TYPE, i); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } - if((cache_ptr->index_len != 4) || + if((cache_ptr->index_len != 4) || (cache_ptr->index_size != (4 * HUGE_ENTRY_SIZE))) { pass = FALSE; - failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (1)"; - } + failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (1)"; + } } if(pass) { - /* Next, set up the flush operation: - * - * (HET, 0) expunges (HET, 1) - * - */ + /* Next, set up the flush operation: + * + * (HET, 0) expunges (HET, 1) + * + */ add_flush_op(HUGE_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, HUGE_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL); @@ -34901,62 +34901,62 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(pass) { - /* to summarize, at present the following entries - * are in cache with the following characteristics: - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (HET, 0) Y 16 KB Y N - expunge (HET 1) - * - * (HET, 1) Y 16 KB N N - - + /* to summarize, at present the following entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (HET, 0) Y 16 KB Y N - expunge (HET 1) + * + * (HET, 1) Y 16 KB N N - - * - * (HET, 2) Y 16 KB N N - - + * (HET, 2) Y 16 KB N N - - * - * (HET, 3) Y 16 KB N N - - - * - * Recall that in this test bed, flush operations are excuted the - * first time the associated entry is flushed, and are then - * deleted. - */ + * (HET, 3) Y 16 KB N N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ /* Now fill up the cache with other, unrelated entries. Recall * that the cache size is 2 MB and 31 * 64 KB + 4 * 16 KP == 2 MB. */ - for (i = 0; i < 31; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 0; i < 31; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); - } + } - /* The cache should now be exactly full */ - if((cache_ptr->index_len != 35) || + /* The cache should now be exactly full */ + if((cache_ptr->index_len != 35) || (cache_ptr->index_size != 2 * 1024 * 1024) || - (cache_ptr->index_size != ((4 * HUGE_ENTRY_SIZE) + + (cache_ptr->index_size != ((4 * HUGE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE)))) { pass = FALSE; - failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (2)"; + failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (2)"; - } else { + } else { - /* verify the expected status of all entries we have loaded to date: */ - verify_entry_status(cache_ptr, 0, 35, expected); - } + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 35, expected); + } } if(pass) { - /* now load another monster entry. This should cause - * H5C__make_space_in_cache() to be called. (HET 0) is dirty, and is at - * the bottom of the LRU. * Thus it will be flushed, and moved to the - * head of the LRU. However, during the flush, (HET 1) should be expunged - * from the cache. Since (MET 1) is the next item in - * H5C__make_space_in_cache(), must detect its removal from the cache, + /* now load another monster entry. This should cause + * H5C__make_space_in_cache() to be called. (HET 0) is dirty, and is at + * the bottom of the LRU. * Thus it will be flushed, and moved to the + * head of the LRU. However, during the flush, (HET 1) should be expunged + * from the cache. Since (MET 1) is the next item in + * H5C__make_space_in_cache(), must detect its removal from the cache, * and refrain from trying to flush it. * * Since all entries in the cache are dirty, all entries will be flushed, - * and HET 0, 2, and 3 will be evicted to make room for the new + * and HET 0, 2, and 3 will be evicted to make room for the new * monster entry (MET, 31). * * Verify this. If H5C__make_space_in_cache() chokes, failure will @@ -34969,45 +34969,45 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(pass) { - /* if the protect succeeded, unprotect and verify that all is at + /* if the protect succeeded, unprotect and verify that all is at * it should be. */ unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG); - /* The cache should now be exactly full */ - if((cache_ptr->index_len != 32) || + /* The cache should now be exactly full */ + if((cache_ptr->index_len != 32) || (cache_ptr->index_size != 2 * 1024 * 1024) || - (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) { + (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) { pass = FALSE; - failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (3)"; + failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (3)"; - } else { + } else { - /* modify the expected table to match the new situation, and + /* modify the expected table to match the new situation, and * then call verify_entry_status(). */ for (i = 0; i < num_huge_entries; i++) { - expected[i].in_cache = FALSE; - expected[i].is_dirty = FALSE; - expected[i].serialized = TRUE; - expected[i].destroyed = TRUE; + expected[i].in_cache = FALSE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; + expected[i].destroyed = TRUE; } /* (HET, 1) was expunged, so touch its entry up accordingly */ - expected[1].is_dirty = TRUE; - expected[1].serialized = FALSE; + expected[1].is_dirty = TRUE; + expected[1].serialized = FALSE; for (i = num_huge_entries; i < num_huge_entries + num_monster_entries - 1; i++) { - expected[i].is_dirty = FALSE; - expected[i].serialized = TRUE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; } - /* verify the expected status of all entries: */ - verify_entry_status(cache_ptr, 0, 36, expected); + /* verify the expected status of all entries: */ + verify_entry_status(cache_ptr, 0, 36, expected); } } @@ -35038,7 +35038,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(pass) { - if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0) || (cache_ptr->clears[HUGE_ENTRY_TYPE] != 1) || (cache_ptr->flushes[HUGE_ENTRY_TYPE] != 3) || @@ -35063,7 +35063,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) } if(pass) - if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 32) || @@ -35087,7 +35087,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) } /* end if */ if(pass) - if((cache_ptr->slist_scan_restarts != 0) || + if((cache_ptr->slist_scan_restarts != 0) || (cache_ptr->LRU_scan_restarts != 1) || (cache_ptr->index_scan_restarts != 0)) { @@ -35108,34 +35108,34 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) } /* cedds__H5C_make_space_in_cache() */ - + /*------------------------------------------------------------------------- - * Function: cedds__H5C__autoadjust__ageout__evict_aged_out_entries() + * Function: cedds__H5C__autoadjust__ageout__evict_aged_out_entries() * - * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries() - * can handle the removal from the cache of the next item in - * its reverse scan of the LRU list. + * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries() + * can handle the removal from the cache of the next item in + * its reverse scan of the LRU list. * - * Do this by setting up a full cache, with the last entry - * on the LRU being both dirty and having a flush operation - * that deletes the second to last entry on the LRU. Then - * access the first item in the LRU repeatedly until the - * item, and thereby the deletion of the second to last item. + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deletes the second to last entry on the LRU. Then + * access the first item in the LRU repeatedly until the + * item, and thereby the deletion of the second to last item. * - * H5C__make_space_in_cache() should detect this deletion, and - * restart its scan of the LRU from the tail, instead of - * examining the now deleted next item up on the LRU. + * H5C__make_space_in_cache() should detect this deletion, and + * restart its scan of the LRU from the tail, instead of + * examining the now deleted next item up on the LRU. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/4/15 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -35144,8 +35144,8 @@ static void cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - int i; - herr_t result; + int i; + herr_t result; struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -35153,40 +35153,40 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) * array only processes as much of it as it is told to, we don't have to * worry about maintaining the status of entries that we haven't used yet. */ - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, }; H5C_auto_size_ctl_t saved_auto_size_ctl; H5C_auto_size_ctl_t test_auto_size_ctl = @@ -35215,9 +35215,9 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out, @@ -35251,15 +35251,15 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) || (cache_ptr->min_clean_size != (1 * 1024 * 1024))) { - pass = FALSE; - failure_mssg = - "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test."; + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test."; } else { /* set min clean size to zero for this test as it simplifies - * computing the expected cache size after each operation. - */ + * computing the expected cache size after each operation. + */ cache_ptr->min_clean_size = 0; } @@ -35295,49 +35295,49 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) if(pass) { - /* The basic idea of this test is to setup the cache such - * that: - * - * 1) the cache is full - * - * 2) the last entry on the LRU is dirty, and has a flush - * operation that will remove the second to last entry + /* The basic idea of this test is to setup the cache such + * that: + * + * 1) the cache is full + * + * 2) the last entry on the LRU is dirty, and has a flush + * operation that will remove the second to last entry * on the LRU from the cache. * * Then access the first item in the LRU until the epoch - * and H5C__autoadjust__ageout__evict_aged_out_entries() - * is invoked. Verify that the function deals with the - * deletion of the next item in its scan cleanly. + * and H5C__autoadjust__ageout__evict_aged_out_entries() + * is invoked. Verify that the function deals with the + * deletion of the next item in its scan cleanly. */ - /* reset the stats before we start. If stats are enabled, we will - * check to see if they are as expected at the end. - */ - H5C_stats__reset(cache_ptr); + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); /* load the first entry -- mark it dirty */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); - /* Then load the rest of the entries to fill the cache: + /* Then load the rest of the entries to fill the cache: * * Recall that the cache size is 2 MB and 32 * 64 KB == 2 MB. */ - for (i = 1; i < 32; i++) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 1; i < 32; i++) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); - } + } } if(pass) { - /* Next, set up the flush operation: - * - * (MET, 0) expunges (MET, 1) - * - */ + /* Next, set up the flush operation: + * + * (MET, 0) expunges (MET, 1) + * + */ add_flush_op(MONSTER_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, MONSTER_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL); @@ -35345,34 +35345,34 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) if(pass) { - /* to summarize, at present the following entries - * are in cache with the following characteristics: - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (MET, 0) Y 64 KB Y N - expunge (MET 1) - * - * (MET, 1-31) Y 64 KB N N - - - * - * Recall that in this test bed, flush operations are excuted the - * first time the associated entry is flushed, and are then - * deleted. - */ + /* to summarize, at present the following entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (MET, 0) Y 64 KB Y N - expunge (MET 1) + * + * (MET, 1-31) Y 64 KB N N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ - /* The cache should now be exactly full */ - if((cache_ptr->index_len != 32) || + /* The cache should now be exactly full */ + if((cache_ptr->index_len != 32) || (cache_ptr->index_size != 2 * 1024 * 1024) || - (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) { + (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) { pass = FALSE; - failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (1)"; + failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (1)"; - } else { + } else { - /* verify the expected status of all entries we have loaded to date: */ - verify_entry_status(cache_ptr, 0, 32, expected); - } + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 32, expected); + } } /* protect and unprotect (MET, 31) repeatedly until the end of the first epoch */ @@ -35398,38 +35398,38 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__NO_FLAGS_SET); } - /* at this point, only (MET, 0) and (MET, 31) should remain in the cache, - * all other entries having been evicted by the ageout adaptive cache - * resizing algorithm. (Since (MET, 0) was dirty, it was flushed and + /* at this point, only (MET, 0) and (MET, 31) should remain in the cache, + * all other entries having been evicted by the ageout adaptive cache + * resizing algorithm. (Since (MET, 0) was dirty, it was flushed and * moved to the head of the LRU by the ageout algorithm.) */ if(pass) { - if((cache_ptr->index_len != 2) || + if((cache_ptr->index_len != 2) || (cache_ptr->index_size != 2 * MONSTER_ENTRY_SIZE)) { pass = FALSE; - failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (2)"; + failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (2)"; - } else { + } else { - /* update the expected table to reflect the expected values at + /* update the expected table to reflect the expected values at * this point, and then verify. */ expected[0].is_dirty = FALSE; - expected[0].serialized = TRUE; + expected[0].serialized = TRUE; for (i = 1; i < 31; i++) { - expected[i].in_cache = FALSE; - expected[i].is_dirty = FALSE; - expected[i].destroyed = TRUE; + expected[i].in_cache = FALSE; + expected[i].is_dirty = FALSE; + expected[i].destroyed = TRUE; } - verify_entry_status(cache_ptr, 0, 32, expected); - } + verify_entry_status(cache_ptr, 0, 32, expected); + } } /* restore the initial resize configuration */ @@ -35473,7 +35473,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) */ if(pass) - if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 1) || @@ -35497,7 +35497,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) } /* end if */ if(pass) - if((cache_ptr->slist_scan_restarts != 0) || + if((cache_ptr->slist_scan_restarts != 0) || (cache_ptr->LRU_scan_restarts != 1) || (cache_ptr->index_scan_restarts != 0)) { @@ -35518,95 +35518,95 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) } /* cedds__H5C__autoadjust__ageout__evict_aged_out_entries() */ - + /*------------------------------------------------------------------------- - * Function: cedds__H5C_flush_invalidate_cache__bucket_scan() - * - * Purpose: Note: We now use the index list when we scan the - * contents of the metadata cache, so in principal, - * this test is obsolete. However, even using the - * index list, restarts are possible, and must be - * handled gracefully. - * - * As it turns out, this test triggers index list - * scan restarts, and thus with minor changes is - * still a useful test. - * - * For this reason, with the exception of changing - * to check the index_scan_restart stat instead of - * hash bucket restarts, I'm leaving the test - * alone. If and when it starts to fail due to - * other changes, we can re-work it to test - * index list scan restarts explicitly. - * - * JRM -- 11/2/16 - * - * Verify that H5C_flush_invalidate_cache() can handle - * the removal from the cache of the next item in - * its scans of hash buckets. - * - * !!!!!!!!!!WARNING !!!!!!!!!! - * - * This test may fail to function correctly if the hash - * table size or hash function is altered. - * - * To setup the test, this function depends on the fact that - * H5C_flush_invalidate_cache() does alternating scans of the - * slist and the index. If this changes, the test will likely - * also cease to function correctly. - * - * The test relies on a known hash function and hash table - * size to select a set of test entries that will all hash - * to the same hash bucket -- call it the test hash bucket. - * It also relies on known behavior of the cache to place - * the entries in the test bucket in a known order. - * - * To avoid pre-mature flushes of the entries in the - * test hash bucket, all entries are initially clean, - * with the exception of the first entry which is dirty. - * It avoids premature flushing by being the parent in - * a flush dependency. The first entry in the test bucket - * also has a flush op which expunges the second entry -- - * setting up the failure. - * - * An additional dirty entry is added (which must hash - * to a different bucket, and must have a higher address - * than at least the first entry in the test hash bucket. - * This entry is the child in a flush dependency with the - * first entry in the above hash bucket, and contains - * a flush op to destroy this flush dependency. - * - * Since the first entry in the test hash bucket has a lower - * address that the other dirty entry, the scan of the - * slist encounters it first, and passes over it because - * it has a flush dependency height of 1. - * - * The scan then encounters the second dirty entry and flushes - * it -- causing it to destroy the flush dependency and thus - * reducing the flush dependency height of the first entry in - * the test hash bucket to zero. - * - * After completing a scan of the slist, - * H5C_flush_invalidate_cache() then scans the index, - * flushing all entries of flush dependency height zero. - * - * This sets up the potential error when the first entry - * in the test hash bucket is flushed -- expunging the - * second entry as a side effect. If - * H5C_flush_invalidate_cache() fails to detect this, - * it will attempt to continue its scan of the bucket with - * an entry that has been deleted from the cache. + * Function: cedds__H5C_flush_invalidate_cache__bucket_scan() + * + * Purpose: Note: We now use the index list when we scan the + * contents of the metadata cache, so in principal, + * this test is obsolete. However, even using the + * index list, restarts are possible, and must be + * handled gracefully. + * + * As it turns out, this test triggers index list + * scan restarts, and thus with minor changes is + * still a useful test. + * + * For this reason, with the exception of changing + * to check the index_scan_restart stat instead of + * hash bucket restarts, I'm leaving the test + * alone. If and when it starts to fail due to + * other changes, we can re-work it to test + * index list scan restarts explicitly. + * + * JRM -- 11/2/16 + * + * Verify that H5C_flush_invalidate_cache() can handle + * the removal from the cache of the next item in + * its scans of hash buckets. + * + * !!!!!!!!!!WARNING !!!!!!!!!! + * + * This test may fail to function correctly if the hash + * table size or hash function is altered. + * + * To setup the test, this function depends on the fact that + * H5C_flush_invalidate_cache() does alternating scans of the + * slist and the index. If this changes, the test will likely + * also cease to function correctly. + * + * The test relies on a known hash function and hash table + * size to select a set of test entries that will all hash + * to the same hash bucket -- call it the test hash bucket. + * It also relies on known behavior of the cache to place + * the entries in the test bucket in a known order. + * + * To avoid pre-mature flushes of the entries in the + * test hash bucket, all entries are initially clean, + * with the exception of the first entry which is dirty. + * It avoids premature flushing by being the parent in + * a flush dependency. The first entry in the test bucket + * also has a flush op which expunges the second entry -- + * setting up the failure. + * + * An additional dirty entry is added (which must hash + * to a different bucket, and must have a higher address + * than at least the first entry in the test hash bucket. + * This entry is the child in a flush dependency with the + * first entry in the above hash bucket, and contains + * a flush op to destroy this flush dependency. + * + * Since the first entry in the test hash bucket has a lower + * address that the other dirty entry, the scan of the + * slist encounters it first, and passes over it because + * it has a flush dependency height of 1. + * + * The scan then encounters the second dirty entry and flushes + * it -- causing it to destroy the flush dependency and thus + * reducing the flush dependency height of the first entry in + * the test hash bucket to zero. + * + * After completing a scan of the slist, + * H5C_flush_invalidate_cache() then scans the index, + * flushing all entries of flush dependency height zero. + * + * This sets up the potential error when the first entry + * in the test hash bucket is flushed -- expunging the + * second entry as a side effect. If + * H5C_flush_invalidate_cache() fails to detect this, + * it will attempt to continue its scan of the bucket with + * an entry that has been deleted from the cache. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/9/15 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -35615,9 +35615,9 @@ static void cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - int i; - int expected_hash_bucket = 0; - herr_t result; + int i; + int expected_hash_bucket = 0; + herr_t result; haddr_t entry_addr; test_entry_t * entry_ptr; test_entry_t * base_addr = NULL; @@ -35629,13 +35629,13 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) * array only processes as much of it as it is told to, we don't have to * worry about maintaining the status of entries that we haven't used yet. */ - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ - { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 1, 1, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, - { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {MONSTER_ENTRY_TYPE,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 1, 0, 0, -1, FALSE}, + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 1, 1, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, + { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {MONSTER_ENTRY_TYPE,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 1, 0, 0, -1, FALSE}, }; if(pass) { @@ -35654,15 +35654,15 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) || (cache_ptr->min_clean_size != (1 * 1024 * 1024))) { - pass = FALSE; - failure_mssg = - "unexpected cache config at start of cedds cedds__H5C_flush_invalidate_cache__bucket_scan() test."; + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds cedds__H5C_flush_invalidate_cache__bucket_scan() test."; } else { /* set min clean size to zero for this test as it simplifies - * computing the expected cache size after each operation. - */ + * computing the expected cache size after each operation. + */ cache_ptr->min_clean_size = 0; } @@ -35671,25 +35671,25 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { - /* reset the stats before we start. If stats are enabled, we will - * check to see if they are as expected at the end. - */ + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ - H5C_stats__reset(cache_ptr); + H5C_stats__reset(cache_ptr); - /* load one dirty and three clean entries that should hash to the - * same hash bucket. + /* load one dirty and three clean entries that should hash to the + * same hash bucket. */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); - for (i = 8; i <= 24; i += 8) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 8; i <= 24; i += 8) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); - } + } } if(pass) { @@ -35704,7 +35704,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) expected_hash_bucket = H5C__HASH_FCN(entry_addr); for (i = 8; i <= 24; i += 8) { - + entry_ptr = &(base_addr[i]); entry_addr = entry_ptr->header.addr; @@ -35719,10 +35719,10 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { /* setup the expunge flush operation: - * - * (MET, 0) expunges (MET, 8) - * - */ + * + * (MET, 0) expunges (MET, 8) + * + */ add_flush_op(MONSTER_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, MONSTER_ENTRY_TYPE, 8, FALSE, (size_t)0, NULL); } @@ -35731,16 +35731,16 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) /* load the entry that will have a flush dependencey with (MET, 0), * thus preventing it from being flushed on the first pass through - * the skip list. + * the skip list. */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG); } if(pass) { - /* verify that the dirty entry doesn't map to the same + /* verify that the dirty entry doesn't map to the same * hash bucket as the clean entries. */ @@ -35756,9 +35756,9 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { - /* Next, create the flush dependency requiring (MET, 31) to + /* Next, create the flush dependency requiring (MET, 31) to * be flushed prior to (MET, 0). - */ + */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); create_flush_dependency(MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_TYPE, 31); @@ -35768,11 +35768,11 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { - /* Then, setup the flush operation to take down the flush + /* Then, setup the flush operation to take down the flush * dependency when (MET, 31) is flushed. - * - * (MET, 31) destroys flush dependency with (MET, 8) - * + * + * (MET, 31) destroys flush dependency with (MET, 8) + * */ add_flush_op(MONSTER_ENTRY_TYPE, 31, FLUSH_OP__DEST_FLUSH_DEP, MONSTER_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); @@ -35781,23 +35781,23 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { - /* verify the expected status of all entries we have loaded to date: */ + /* verify the expected status of all entries we have loaded to date: */ verify_entry_status(cache_ptr, 0, 5, expected); } if(pass) { - /* now do some protect / unprotect cycles to force the + /* now do some protect / unprotect cycles to force the * entries into the desired order in the hash bucket. - * Recall that entries are moved to the head of the + * Recall that entries are moved to the head of the * hash bucket list on lookup. */ - for (i = 24; i >= 0; i -= 8) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + for (i = 24; i >= 0; i -= 8) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); - } + } } if(pass) { @@ -35810,7 +35810,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) i = 0; while(pass && (i <= 24)) - { + { entry_ptr = &(base_addr[i]); if(scan_ptr == NULL) { @@ -35830,7 +35830,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) scan_ptr = scan_ptr->ht_next; i += 8; } - } + } } @@ -35860,7 +35860,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) */ if(pass) - if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || + if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) || (cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 2) || @@ -35885,10 +35885,10 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) /* as this test is now checking for index list scan restarts, - * the following has been modified to check this instead of + * the following has been modified to check this instead of * hash bucket scan restarts. */ - if((cache_ptr->slist_scan_restarts != 0) || + if((cache_ptr->slist_scan_restarts != 0) || (cache_ptr->LRU_scan_restarts != 0) || (cache_ptr->index_scan_restarts != 1)) { pass = FALSE; @@ -35908,21 +35908,21 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) } /* cedds__H5C_flush_invalidate_cache__bucket_scan() */ - + /*------------------------------------------------------------------------- - * Function: check_stats() + * Function: check_stats() * - * Purpose: If stats are enabled, conduct tests to verify correct - * functioning of the cache statistics collection code. + * Purpose: If stats are enabled, conduct tests to verify correct + * functioning of the cache statistics collection code. * - * Skip the test if stats are not enabled. + * Skip the test if stats are not enabled. * - * At present this test is a shell -- fill it out at time - * permits. + * At present this test is a shell -- fill it out at time + * permits. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/12/15 * * Modifications: @@ -35977,7 +35977,7 @@ check_stats(unsigned paged) SKIPPED(); - HDfprintf(stdout, " Statistics collection disabled.\n"); + HDfprintf(stdout, " Statistics collection disabled.\n"); #endif /* H5C_COLLECT_CACHE_STATS */ @@ -35985,30 +35985,30 @@ check_stats(unsigned paged) } /* check_stats() */ - + /*------------------------------------------------------------------------- - * Function: check_stats__smoke_check_1() + * Function: check_stats__smoke_check_1() * - * Purpose: Test to see if the statistics collection code is working - * more or less as expected. Do this by performing a number - * of operations in the cache, and checking to verify that - * they result in the expected statistics. + * Purpose: Test to see if the statistics collection code is working + * more or less as expected. Do this by performing a number + * of operations in the cache, and checking to verify that + * they result in the expected statistics. * - * Note that this function is not intended to be a full test - * of the statistics collection facility -- only a cursory - * check that will serve as a place holder until more complete - * tests are implemented. + * Note that this function is not intended to be a full test + * of the statistics collection facility -- only a cursory + * check that will serve as a place holder until more complete + * tests are implemented. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/22/15 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -36017,8 +36017,8 @@ static void check_stats__smoke_check_1(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - int i; - herr_t result; + int i; + herr_t result; if(pass) { if(cache_ptr == NULL) { @@ -36035,15 +36035,15 @@ check_stats__smoke_check_1(H5F_t * file_ptr) else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) || (cache_ptr->min_clean_size != (1 * 1024 * 1024))) { - pass = FALSE; - failure_mssg = "unexpected cache config at start of check_stats__smoke_check_1()."; + pass = FALSE; + failure_mssg = "unexpected cache config at start of check_stats__smoke_check_1()."; } /* end else-if */ - else { + else { /* set min clean size to zero for this test as it simplifies - * computing the expected cache size after each operation. - */ + * computing the expected cache size after each operation. + */ cache_ptr->min_clean_size = 0; } /* end else */ } /* end if */ @@ -36129,13 +36129,13 @@ check_stats__smoke_check_1(H5F_t * file_ptr) #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ if(pass) - /* protect and unprotect each entry once. Note + /* protect and unprotect each entry once. Note * that all entries are already dirty, as they * entered the cache via insertion */ for(i = 0; i < 32; i++) { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } /* end for */ if(pass) @@ -36216,7 +36216,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr) if(pass) { /* protect and unprotect an entry that is not currently * in the cache. Since the cache is full and all entries - * are dirty, this will force a flush of each entry, and + * are dirty, this will force a flush of each entry, and * the eviction of (MET, 0). */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 32); @@ -36416,7 +36416,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ - + /*------------------------------------------------------------------------- * Function: main * @@ -36439,14 +36439,14 @@ main(void) express_test = GetTestExpress(); - printf("=========================================\n"); - printf("Internal cache tests\n"); - printf(" express_test = %d\n", express_test); - printf("=========================================\n"); + HDprintf("=========================================\n"); + HDprintf("Internal cache tests\n"); + HDprintf(" express_test = %d\n", express_test); + HDprintf("=========================================\n"); if(create_entry_arrays() < 0) { - printf("ERROR: Unable to create entries arrays. Aborting.\n"); + HDprintf("ERROR: Unable to create entries arrays. Aborting.\n"); return EXIT_FAILURE; } /* end if */ diff --git a/test/cache_api.c b/test/cache_api.c index 4f29009..87b9567 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -14,8 +14,8 @@ /* Programmer: John Mainzer * 11/10/05 * - * This file contains tests for the API calls associated - * with the cache implemented in H5C.c + * This file contains tests for the API calls associated + * with the cache implemented in H5C.c */ #include "cache_common.h" @@ -36,7 +36,7 @@ static hbool_t check_fapl_mdc_api_errs(void); static hbool_t check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id); - + /**************************************************************************/ /**************************************************************************/ /********************************* tests: *********************************/ @@ -104,8 +104,8 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; H5AC_cache_config_t scratch; H5C_auto_size_ctl_t default_auto_size_ctl; @@ -495,7 +495,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) } /* check_fapl_mdc_api_calls() */ - + /*------------------------------------------------------------------------- * Function: check_file_mdc_api_calls() * @@ -560,8 +560,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; H5AC_cache_config_t mod_config_2 = { @@ -595,8 +595,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; H5AC_cache_config_t mod_config_3 = { @@ -630,8 +630,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ FALSE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; H5AC_cache_config_t mod_config_4 = { @@ -666,8 +666,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.1f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; if(paged) @@ -813,9 +813,9 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) else { HDfprintf(stdout, "H5Fget_mdc_size() reports:\n"); - HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n", + HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n", (long)max_size, (long)min_clean_size); - HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n", + HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n", (long)cur_size, cur_num_entries); } #endif @@ -846,7 +846,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) } if ( ! pass ) { - + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); } @@ -854,14 +854,14 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) } /* check_file_mdc_api_calls() */ - + /*------------------------------------------------------------------------- - * Function: mdc_api_call_smoke_check() + * Function: mdc_api_call_smoke_check() * * Purpose: Initial basic functional test to see if there are problems * with the cache API calls. * - * NOTE: This test takes some time to run and checks the + * NOTE: This test takes some time to run and checks the * HDF5TestExpress environment variable. * * Return: Test pass status (TRUE/FALSE) @@ -933,8 +933,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; H5AC_cache_config_t mod_config_2 = { @@ -968,8 +968,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; H5AC_cache_config_t mod_config_3 = { @@ -1003,8 +1003,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05f, /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY }; if(paged) @@ -1117,9 +1117,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* create the dataset */ if ( pass ) { - sprintf(dset_name, "/dset%03d", i); + HDsprintf(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 ) { @@ -1327,7 +1327,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) pass = FALSE; failure_mssg = "slab validation failed."; #else /* as above */ - fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", + HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); #endif } @@ -1448,7 +1448,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) pass = FALSE; failure_mssg = "slab validation failed."; #if 0 /* as above */ - fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", + HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); #endif } @@ -1523,9 +1523,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) } if ( pass ) { - + PASSED(); - + } else { H5_FAILED(); @@ -1561,7 +1561,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) *------------------------------------------------------------------------- */ -#define NUM_INVALID_CONFIGS 36 +#define NUM_INVALID_CONFIGS 36 static H5AC_cache_config_t * invalid_configs = NULL; static H5AC_cache_config_t * @@ -1737,7 +1737,7 @@ init_invalid_configs(void) { } /* initialize_invalid_configs() */ - + /*------------------------------------------------------------------------- * Function: check_fapl_mdc_api_errs() * @@ -1913,7 +1913,7 @@ check_fapl_mdc_api_errs(void) } /* check_fapl_mdc_api_errs() */ - + /*------------------------------------------------------------------------- * Function: check_file_mdc_api_errs() * @@ -2259,7 +2259,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) } /* check_file_mdc_api_errs() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -2285,10 +2285,10 @@ main(void) express_test = GetTestExpress(); - printf("===================================\n"); - printf("Cache API tests\n"); - printf(" express_test = %d\n", express_test); - printf("===================================\n"); + HDprintf("===================================\n"); + HDprintf("Cache API tests\n"); + HDprintf(" express_test = %d\n", express_test); + HDprintf("===================================\n"); /* Initialize invalid configurations. diff --git a/test/cache_common.c b/test/cache_common.c index 94d3f59..24962bc 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -14,8 +14,8 @@ /* Programmer: John Mainzer * 10/27/05 * - * This file contains common code for tests of the cache - * implemented in H5C.c + * This file contains common code for tests of the cache + * implemented in H5C.c */ #include "H5CXprivate.h" /* API Contexts */ #include "H5MFprivate.h" @@ -33,27 +33,27 @@ const char *FILENAME[] = { }; hid_t saved_fapl_id = H5P_DEFAULT; /* store the fapl id here between - * cache setup and takedown. Note - * that if saved_fapl_id == H5P_DEFAULT, - * we assume that there is no fapl to - * close. - */ + * cache setup and takedown. Note + * that if saved_fapl_id == H5P_DEFAULT, + * we assume that there is no fapl to + * close. + */ hid_t saved_fcpl_id = H5P_DEFAULT; /* store the fcpl id here between - * cache setup and takedown. Note - * that if saved_fcpl_id == H5P_DEFAULT, - * we assume that there is no fcpl to - * close. - */ + * cache setup and takedown. Note + * that if saved_fcpl_id == H5P_DEFAULT, + * we assume that there is no fcpl to + * close. + */ hid_t saved_fid = -1; /* store the file id here between cache setup - * and takedown. - */ + * and takedown. + */ H5C_t * saved_cache = NULL; /* store the pointer to the instance of - * of H5C_t created by H5Fcreate() - * here between test cache setup and - * shutdown. - */ + * of H5C_t created by H5Fcreate() + * here between test cache setup and + * shutdown. + */ haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the space allocated for cache items in the file between @@ -132,37 +132,37 @@ static herr_t variable_image_len(const void *thing, size_t *image_len_ptr); static herr_t notify_image_len(const void *thing, size_t *image_len_ptr); static herr_t pico_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t nano_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t micro_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t tiny_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t small_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t medium_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t large_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t huge_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t monster_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t variable_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t notify_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t pico_serialize(const H5F_t *f, void *image_ptr, @@ -215,11 +215,11 @@ static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr, int32_t entry_type); static herr_t image_len(const void *thing, size_t *image_len_ptr, int32_t entry_type); static herr_t pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len, +static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len, void *thing); -static herr_t notify(H5C_notify_action_t action, void *thing, int32_t +static herr_t notify(H5C_notify_action_t action, void *thing, int32_t entry_type); static herr_t free_icr(test_entry_t *entry, int32_t entry_type); @@ -291,7 +291,7 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = NOTIFY_ALT_BASE_ADDR }; - + /* Callback classes */ static const H5C_class_t pico_class[1] = {{ PICO_ENTRY_TYPE, @@ -498,16 +498,16 @@ const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES] = { /* address translation functions: */ - + /*------------------------------------------------------------------------- - * Function: addr_to_type_and_index + * Function: addr_to_type_and_index * - * Purpose: Given an address, compute the type and index of the - * associated entry. + * Purpose: Given an address, compute the type and index of the + * associated entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -577,7 +577,7 @@ addr_to_type_and_index(haddr_t addr, /* Call back functions: */ - + /*------------------------------------------------------------------------- * * Function: check_if_write_permitted @@ -607,16 +607,16 @@ check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_pt return(SUCCEED); } /* check_write_permitted() */ - + /*------------------------------------------------------------------------- - * Function: get_initial_load_size & friends + * Function: get_initial_load_size & friends * - * Purpose: Query the image size for loading an entry. The helper + * Purpose: Query the image size for loading an entry. The helper * functions funnel into get_initial_load_size proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 5/18/10 * *------------------------------------------------------------------------- @@ -716,16 +716,16 @@ notify_get_initial_load_size(void *udata, size_t *image_length) return get_initial_load_size(udata, image_length, NOTIFY_ENTRY_TYPE); } - + /*------------------------------------------------------------------------- - * Function: get_final_load_size & friends + * Function: get_final_load_size & friends * - * Purpose: Query the final image size for loading an entry. The helper + * Purpose: Query the final image size for loading an entry. The helper * functions funnel into get_final_load_size proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 11/18/16 * *------------------------------------------------------------------------- @@ -774,19 +774,19 @@ variable_get_final_load_size(const void *image, size_t image_len, return get_final_load_size(image, image_len, udata, actual_len, VARIABLE_ENTRY_TYPE); } - + /*------------------------------------------------------------------------- - * Function: verify_chksum & friends - * (only done for VARIABLE_ENTRY_TYPE which has a speculative read) + * Function: verify_chksum & friends + * (only done for VARIABLE_ENTRY_TYPE which has a speculative read) * - * Purpose: Simulate checksum verification: - * --check is ok only after 'max_verify_ct' is reached - * --otherwise check is not ok + * Purpose: Simulate checksum verification: + * --check is ok only after 'max_verify_ct' is reached + * --otherwise check is not ok * - * Return: TRUE: checksum is ok - * FALSE: checksum is not ok + * Return: TRUE: checksum is ok + * FALSE: checksum is not ok * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -817,9 +817,9 @@ verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void HDassert(entry->addr == addr); if(++entry->verify_ct >= entry->max_verify_ct) - return(TRUE); - else - return(FALSE); + return(TRUE); + else + return(FALSE); } /* verify_chksum() */ @@ -829,17 +829,17 @@ variable_verify_chksum(const void *image, size_t len, void *udata) return verify_chksum(image, len, udata, VARIABLE_ENTRY_TYPE); } - + /*------------------------------------------------------------------------- - * Function: deserialize & friends + * Function: deserialize & friends * - * Purpose: deserialize the entry. The helper functions verify that the - * correct version of deserialize is being called, and then call - * deserialize proper. + * Purpose: deserialize the entry. The helper functions verify that the + * correct version of deserialize is being called, and then call + * deserialize proper. * - * Return: void * (pointer to the in core representation of the entry) + * Return: void * (pointer to the in core representation of the entry) * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/20/07 * *------------------------------------------------------------------------- @@ -891,7 +891,7 @@ deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, HDfprintf(stdout, "expected *image = 0x%x\n", (int)(idx & 0xFF)); } /* end if */ - HDassert((*((const char *)image)) == (char)(idx & 0xFF)); + HDassert((*((const char *)image)) == (char)(idx & 0xFF)); } /* end if */ else { if((*(((const char *)image) + 2)) != (char)(idx & 0xFF)) { @@ -905,9 +905,9 @@ deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, (int)(idx & 0xFF), (int)((idx & 0xFF00) >> 8)); } /* end if */ - HDassert((*((const char *)image)) == (char)(type & 0xFF)); - HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); - HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF)); + HDassert((*((const char *)image)) == (char)(type & 0xFF)); + HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); + HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF)); } /* end else */ } /* end if */ @@ -985,18 +985,18 @@ notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) return deserialize(image, len, udata, dirty, NOTIFY_ENTRY_TYPE); } - + /*------------------------------------------------------------------------- - * Function: image_len & friends + * Function: image_len & friends * - * Purpose: Return the real (and possibly reduced) length of the image. - * The helper functions verify that the correct version of - * deserialize is being called, and then call deserialize - * proper. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -1027,10 +1027,10 @@ image_len(const void *thing, size_t *image_length, int32_t entry_type) HDassert(entry == &(base_addr[idx])); if(type != VARIABLE_ENTRY_TYPE) - HDassert(entry->size == entry_sizes[type]); + HDassert(entry->size == entry_sizes[type]); else { - HDassert(entry->size <= entry_sizes[type]); - HDassert(entry->size > 0); + HDassert(entry->size <= entry_sizes[type]); + HDassert(entry->size > 0); } /* end else */ *image_length = entry->size; @@ -1104,21 +1104,21 @@ notify_image_len(const void *thing, size_t *image_length) return image_len(thing, image_length, NOTIFY_ENTRY_TYPE); } - + /*------------------------------------------------------------------------- - * Function: pre_serialize & friends + * Function: pre_serialize & friends * - * Purpose: Pre_serialize the supplied entry. For now this consistes of - * executing any flush operations and loading the appropriate - * values into *new_addr_ptr, *new_len_ptr, and *flags_ptr. + * Purpose: Pre_serialize the supplied entry. For now this consistes of + * executing any flush operations and loading the appropriate + * values into *new_addr_ptr, *new_len_ptr, and *flags_ptr. * - * The helper functions verify that the correct version of - * serialize is being called, and then call serialize - * proper. + * The helper functions verify that the correct version of + * serialize is being called, and then call serialize + * proper. * - * Return: SUCCEED if successful, FAIL otherwise. + * Return: SUCCEED if successful, FAIL otherwise. * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/07/14 * *------------------------------------------------------------------------- @@ -1216,7 +1216,7 @@ pico_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1229,7 +1229,7 @@ nano_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1242,7 +1242,7 @@ micro_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1255,7 +1255,7 @@ tiny_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1268,7 +1268,7 @@ small_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1281,7 +1281,7 @@ medium_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1294,7 +1294,7 @@ large_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1307,7 +1307,7 @@ huge_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1320,7 +1320,7 @@ monster_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1333,7 +1333,7 @@ variable_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -1346,28 +1346,28 @@ notify_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } - + /*------------------------------------------------------------------------- - * Function: serialize & friends + * Function: serialize & friends * - * Purpose: Serialize the supplied entry. For now this consistes of - * loading the type and index of the entry into the first - * three bytes of the image (if it is long enough -- if not - * just load the low order byte of the index into the first - * byte of the image). + * Purpose: Serialize the supplied entry. For now this consistes of + * loading the type and index of the entry into the first + * three bytes of the image (if it is long enough -- if not + * just load the low order byte of the index into the first + * byte of the image). * - * The helper functions verify that the correct version of - * serialize is being called, and then call serialize - * proper. + * The helper functions verify that the correct version of + * serialize is being called, and then call serialize + * proper. * - * Return: SUCCEED if successful, FAIL otherwise. + * Return: SUCCEED if successful, FAIL otherwise. * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -1408,14 +1408,14 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin if((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE) || (type == NOTIFY_ENTRY_TYPE )) { - HDassert(entry->size >= PICO_ENTRY_SIZE); - *((char *)image_ptr) = (char)((entry->index) & 0xFF); + HDassert(entry->size >= PICO_ENTRY_SIZE); + *((char *)image_ptr) = (char)((entry->index) & 0xFF); } /* end if */ else { - HDassert(entry->size >= NANO_ENTRY_SIZE); - *((char *)image_ptr) = (char)((entry->type) & 0xFF); - *(((char *)image_ptr) + 1) = (char)(((entry->index) & 0xFF00) >> 8); - *(((char *)image_ptr) + 2) = (char)((entry->index) & 0xFF); + HDassert(entry->size >= NANO_ENTRY_SIZE); + *((char *)image_ptr) = (char)((entry->type) & 0xFF); + *(((char *)image_ptr) + 1) = (char)(((entry->index) & 0xFF00) >> 8); + *(((char *)image_ptr) + 2) = (char)((entry->index) & 0xFF); } /* end else */ /* We no longer do the actual write through an callback -- this is @@ -1425,7 +1425,7 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin entry->is_dirty = FALSE; if(entry->flush_dep_npar > 0) { - HDassert(entry->flush_dep_ndirty_chd == 0); + HDassert(entry->flush_dep_ndirty_chd == 0); mark_flush_dep_clean(entry); } /* end if */ @@ -1433,9 +1433,9 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin * as initialized. */ if(entry->at_main_addr) - entry->written_to_main_addr = TRUE; + entry->written_to_main_addr = TRUE; else - entry->written_to_alt_addr = TRUE; + entry->written_to_alt_addr = TRUE; /* do book keeping */ (entry->serializes)++; @@ -1475,7 +1475,7 @@ small_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void } herr_t -medium_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, +medium_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { return serialize(f, image_ptr, len, thing); @@ -1494,37 +1494,37 @@ huge_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void } herr_t -monster_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, +monster_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { return serialize(f, image_ptr, len, thing); } herr_t -variable_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, +variable_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { return serialize(f, image_ptr, len, thing); } herr_t -notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, +notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { return serialize(f, image_ptr, len, thing); } - + /*------------------------------------------------------------------------- - * Function: notify & friends + * Function: notify & friends * - * Purpose: Record notifications of cache events for the entry. + * Purpose: Record notifications of cache events for the entry. * The helper functions verify that the correct version of notify * is being called, and then call notify proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 4/28/09 * *------------------------------------------------------------------------- @@ -1553,8 +1553,8 @@ notify(H5C_notify_action_t action, void *thing, int32_t entry_type) /* Increment count for appropriate action */ switch(action) { - case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added */ - case H5C_NOTIFY_ACTION_AFTER_LOAD: /* to the cache. */ + case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added */ + case H5C_NOTIFY_ACTION_AFTER_LOAD: /* to the cache. */ entry->notify_after_insert_count++; break; @@ -1565,8 +1565,8 @@ notify(H5C_notify_action_t action, void *thing, int32_t entry_type) case H5C_NOTIFY_ACTION_CHILD_CLEANED: case H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED: case H5C_NOTIFY_ACTION_CHILD_SERIALIZED: - /* do nothing */ - break; + /* do nothing */ + break; case H5C_NOTIFY_ACTION_BEFORE_EVICT: /* Entry is about to be evicted from cache */ entry->notify_before_evict_count++; @@ -1585,25 +1585,25 @@ notify_notify(H5C_notify_action_t action, void *thing) return(notify(action, thing, NOTIFY_ENTRY_TYPE)); } - + /*------------------------------------------------------------------------- - * Function: free_icr & friends + * Function: free_icr & friends * - * Purpose: Nominally, this callback is supposed to free the - * in core representation of the entry. + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. * - * In the context of this test bed, we use it to do - * do all the processing we used to do on a destroy. - * In particular, we use it to release all the pins - * that this entry may have on other entries. + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. + * In particular, we use it to release all the pins + * that this entry may have on other entries. * - * The helper functions verify that the correct version of - * serialize is being called, and then call free_icr - * proper. + * The helper functions verify that the correct version of + * serialize is being called, and then call free_icr + * proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -1629,43 +1629,43 @@ free_icr(test_entry_t *entry, int32_t entry_type) HDassert(entry->header.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); HDassert(entry->header.size == entry->size); HDassert((entry->type == VARIABLE_ENTRY_TYPE) || - (entry->size == entry_sizes[entry->type])); + (entry->size == entry_sizes[entry->type])); HDassert(entry->header.tl_next == NULL); HDassert(entry->header.tl_prev == NULL); if(entry->num_pins > 0) { int i; - for(i = 0; i < entry->num_pins; i++) { + for(i = 0; i < entry->num_pins; i++) { test_entry_t *pinned_entry; test_entry_t *pinned_base_addr; - pinned_base_addr = entries[entry->pin_type[i]]; - pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]); + pinned_base_addr = entries[entry->pin_type[i]]; + pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]); - HDassert(0 <= pinned_entry->type); + HDassert(0 <= pinned_entry->type); HDassert(pinned_entry->type < NUMBER_OF_ENTRY_TYPES); - HDassert(pinned_entry->type == entry->pin_type[i]); - HDassert(pinned_entry->index >= 0); - HDassert(pinned_entry->index <= max_indices[pinned_entry->type]); - HDassert(pinned_entry->index == entry->pin_idx[i]); - HDassert(pinned_entry == pinned_entry->self); - HDassert(pinned_entry->header.is_pinned); - HDassert(pinned_entry->is_pinned); - HDassert(pinned_entry->pinning_ref_count > 0); - - pinned_entry->pinning_ref_count--; - - if(pinned_entry->pinning_ref_count <= 0) { + HDassert(pinned_entry->type == entry->pin_type[i]); + HDassert(pinned_entry->index >= 0); + HDassert(pinned_entry->index <= max_indices[pinned_entry->type]); + HDassert(pinned_entry->index == entry->pin_idx[i]); + HDassert(pinned_entry == pinned_entry->self); + HDassert(pinned_entry->header.is_pinned); + HDassert(pinned_entry->is_pinned); + HDassert(pinned_entry->pinning_ref_count > 0); + + pinned_entry->pinning_ref_count--; + + if(pinned_entry->pinning_ref_count <= 0) { HDassert(pinned_entry->file_ptr); - unpin_entry(pinned_entry->type, pinned_entry->index); - } /* end if */ + unpin_entry(pinned_entry->type, pinned_entry->index); + } /* end if */ - entry->pin_type[i] = -1; - entry->pin_idx[i] = -1; - } /* end if */ - entry->num_pins = 0; + entry->pin_type[i] = -1; + entry->pin_idx[i] = -1; + } /* end if */ + entry->num_pins = 0; } /* end if */ entry->destroyed = TRUE; @@ -1740,7 +1740,7 @@ notify_free_icr(void *thing) return free_icr((test_entry_t *)thing, NOTIFY_ENTRY_TYPE); } - + /**************************************************************************/ /**************************************************************************/ /************************** test utility functions: ***********************/ @@ -1748,16 +1748,16 @@ notify_free_icr(void *thing) /**************************************************************************/ /*------------------------------------------------------------------------- - * Function: add_flush_op + * Function: add_flush_op * - * Purpose: Do nothing if pass is FALSE on entry. + * Purpose: Do nothing if pass is FALSE on entry. * * Otherwise, add the specified flush operation to the * target instance of test_entry_t. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/1/06 * *------------------------------------------------------------------------- @@ -1765,12 +1765,12 @@ notify_free_icr(void *thing) void add_flush_op(int target_type, - int target_idx, - int op_code, - int type, - int idx, - hbool_t flag, - size_t new_size, + int target_idx, + int op_code, + int type, + int idx, + hbool_t flag, + size_t new_size, unsigned * order_ptr) { int i; @@ -1779,10 +1779,10 @@ add_flush_op(int target_type, HDassert( ( 0 <= target_type ) && ( target_type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= target_idx ) && - ( target_idx <= max_indices[target_type] ) ); + ( target_idx <= max_indices[target_type] ) ); HDassert( ( 0 <= op_code ) && ( op_code <= FLUSH_OP__MAX_OP ) ); HDassert( ( op_code != FLUSH_OP__RESIZE ) || - ( type == VARIABLE_ENTRY_TYPE ) ); + ( type == VARIABLE_ENTRY_TYPE ) ); HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); HDassert( new_size <= VARIABLE_ENTRY_SIZE ); @@ -1801,15 +1801,15 @@ add_flush_op(int target_type, HDassert( target_entry_ptr->index == target_idx ); HDassert( target_entry_ptr->type == target_type ); HDassert( target_entry_ptr == target_entry_ptr->self ); - HDassert( target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS ); + HDassert( target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS ); - i = (target_entry_ptr->num_flush_ops)++; - (target_entry_ptr->flush_ops)[i].op_code = op_code; - (target_entry_ptr->flush_ops)[i].type = type; - (target_entry_ptr->flush_ops)[i].idx = idx; - (target_entry_ptr->flush_ops)[i].flag = flag; - (target_entry_ptr->flush_ops)[i].size = new_size; - (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr; + i = (target_entry_ptr->num_flush_ops)++; + (target_entry_ptr->flush_ops)[i].op_code = op_code; + (target_entry_ptr->flush_ops)[i].type = type; + (target_entry_ptr->flush_ops)[i].idx = idx; + (target_entry_ptr->flush_ops)[i].flag = flag; + (target_entry_ptr->flush_ops)[i].size = new_size; + (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr; } @@ -1817,24 +1817,24 @@ add_flush_op(int target_type, } /* add_flush_op() */ - + /*------------------------------------------------------------------------- - * Function: create_pinned_entry_dependency + * Function: create_pinned_entry_dependency * - * Purpose: Do nothing if pass is FALSE on entry. + * Purpose: Do nothing if pass is FALSE on entry. * * Otherwise, set up a pinned entry dependency so we can * test the pinned entry modifications to the flush routine. * - * Given the types and indicies of the pinned and pinning - * entries, add the pinned entry to the list of pinned - * entries in the pinning entry, increment the - * pinning reference count of the pinned entry, and - * if that count was zero initially, pin the entry. + * Given the types and indicies of the pinned and pinning + * entries, add the pinned entry to the list of pinned + * entries in the pinning entry, increment the + * pinning reference count of the pinned entry, and + * if that count was zero initially, pin the entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -1842,10 +1842,10 @@ add_flush_op(int target_type, void create_pinned_entry_dependency(H5F_t * file_ptr, - int pinning_type, + int pinning_type, int pinning_idx, - int pinned_type, - int pinned_idx) + int pinned_type, + int pinned_idx) { test_entry_t * pinning_base_addr; test_entry_t * pinning_entry_ptr; @@ -1855,13 +1855,13 @@ create_pinned_entry_dependency(H5F_t * file_ptr, if ( pass ) { HDassert( ( 0 <= pinning_type ) && - ( pinning_type < NUMBER_OF_ENTRY_TYPES ) ); + ( pinning_type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= pinning_idx ) && - ( pinning_idx <= max_indices[pinning_type] ) ); + ( pinning_idx <= max_indices[pinning_type] ) ); HDassert( ( 0 <= pinned_type ) && - ( pinned_type < NUMBER_OF_ENTRY_TYPES ) ); + ( pinned_type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= pinned_idx ) && - ( pinned_idx <= max_indices[pinned_type] ) ); + ( pinned_idx <= max_indices[pinned_type] ) ); pinning_base_addr = entries[pinning_type]; pinning_entry_ptr = &(pinning_base_addr[pinning_idx]); @@ -1872,47 +1872,47 @@ create_pinned_entry_dependency(H5F_t * file_ptr, HDassert( pinning_entry_ptr->index == pinning_idx ); HDassert( pinning_entry_ptr->type == pinning_type ); HDassert( pinning_entry_ptr == pinning_entry_ptr->self ); - HDassert( pinning_entry_ptr->num_pins < MAX_PINS ); + HDassert( pinning_entry_ptr->num_pins < MAX_PINS ); HDassert( pinning_entry_ptr->index == pinning_idx ); HDassert( pinning_entry_ptr->type == pinning_type ); HDassert( pinning_entry_ptr == pinning_entry_ptr->self ); - HDassert( ! ( pinning_entry_ptr->is_protected ) ); + HDassert( ! ( pinning_entry_ptr->is_protected ) ); - pinning_entry_ptr->pin_type[pinning_entry_ptr->num_pins] = pinned_type; - pinning_entry_ptr->pin_idx[pinning_entry_ptr->num_pins] = pinned_idx; - (pinning_entry_ptr->num_pins)++; + pinning_entry_ptr->pin_type[pinning_entry_ptr->num_pins] = pinned_type; + pinning_entry_ptr->pin_idx[pinning_entry_ptr->num_pins] = pinned_idx; + (pinning_entry_ptr->num_pins)++; if ( pinned_entry_ptr->pinning_ref_count == 0 ) { - protect_entry(file_ptr, pinned_type, pinned_idx); - unprotect_entry(file_ptr, pinned_type, pinned_idx, H5C__PIN_ENTRY_FLAG); - } + protect_entry(file_ptr, pinned_type, pinned_idx); + unprotect_entry(file_ptr, pinned_type, pinned_idx, H5C__PIN_ENTRY_FLAG); + } - (pinned_entry_ptr->pinning_ref_count)++; + (pinned_entry_ptr->pinning_ref_count)++; } return; } /* create_pinned_entry_dependency() */ - + /*------------------------------------------------------------------------- - * Function: dirty_entry + * Function: dirty_entry * - * Purpose: Given a pointer to a cache, an entry type, and an index, - * dirty the target entry. + * Purpose: Given a pointer to a cache, an entry type, and an index, + * dirty the target entry. * - * If the dirty_pin parameter is true, verify that the - * target entry is in the cache and is pinned. If it - * isn't, scream and die. If it is, use the - * H5C_mark_entry_dirty() call to dirty it. + * If the dirty_pin parameter is true, verify that the + * target entry is in the cache and is pinned. If it + * isn't, scream and die. If it is, use the + * H5C_mark_entry_dirty() call to dirty it. * - * Do nothing if pass is false on entry. + * Do nothing if pass is false on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -1922,7 +1922,7 @@ void dirty_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - hbool_t dirty_pin) + hbool_t dirty_pin) { test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -1938,54 +1938,54 @@ dirty_entry(H5F_t * file_ptr, HDassert(cache_ptr); - if ( ! entry_in_cache(cache_ptr, type, idx) ) { + if ( ! entry_in_cache(cache_ptr, type, idx) ) { - pass = FALSE; + pass = FALSE; failure_mssg = "entry to be dirty pinned is not in cache."; - } else { + } else { base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); + HDassert( entry_ptr->index == idx ); + HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); - if ( ! ( (entry_ptr->header).is_pinned ) ) { + if ( ! ( (entry_ptr->header).is_pinned ) ) { pass = FALSE; failure_mssg = "entry to be dirty pinned is not pinned."; } else { - mark_entry_dirty(type, idx); + mark_entry_dirty(type, idx); - } - } + } + } } else { - protect_entry(file_ptr, type, idx); + protect_entry(file_ptr, type, idx); unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG); - } + } } return; } /* dirty_entry() */ - + /*------------------------------------------------------------------------- - * Function: execute_flush_op + * Function: execute_flush_op * - * Purpose: Given a pointer to an instance of struct flush_op, execute - * it. + * Purpose: Given a pointer to an instance of struct flush_op, execute + * it. * - * Do nothing if pass is false on entry. + * Do nothing if pass is false on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/1/06 * *------------------------------------------------------------------------- @@ -1993,9 +1993,9 @@ dirty_entry(H5F_t * file_ptr, void execute_flush_op(H5F_t * file_ptr, - struct test_entry_t * entry_ptr, - struct flush_op * op_ptr, - unsigned * flags_ptr) + struct test_entry_t * entry_ptr, + struct flush_op * op_ptr, + unsigned * flags_ptr) { H5C_t * cache_ptr; @@ -2027,56 +2027,56 @@ execute_flush_op(H5F_t * file_ptr, if ( pass ) { - switch ( op_ptr->op_code ) - { - case FLUSH_OP__NO_OP: - break; + switch ( op_ptr->op_code ) + { + case FLUSH_OP__NO_OP: + break; - case FLUSH_OP__DIRTY: - HDassert( ( entry_ptr->type != op_ptr->type ) || - ( entry_ptr->index != op_ptr->idx ) ); + case FLUSH_OP__DIRTY: + HDassert( ( entry_ptr->type != op_ptr->type ) || + ( entry_ptr->index != op_ptr->idx ) ); - dirty_entry(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); - break; + dirty_entry(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); + break; case FLUSH_OP__RESIZE: - if ( ( entry_ptr->type == op_ptr->type ) && + if ( ( entry_ptr->type == op_ptr->type ) && ( entry_ptr->index == op_ptr->idx ) ) { /* the flush operation is acting on the entry to - * which it is attached. Handle this here: - */ + * which it is attached. Handle this here: + */ HDassert( entry_ptr->type == VARIABLE_ENTRY_TYPE ); - HDassert( op_ptr->size > 0 ); - HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE ); + HDassert( op_ptr->size > 0 ); + HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE ); entry_ptr->size = op_ptr->size; - (*flags_ptr) |= H5C__SERIALIZE_RESIZED_FLAG; + (*flags_ptr) |= H5C__SERIALIZE_RESIZED_FLAG; - entry_ptr->flush_op_self_resize_in_progress = TRUE; + entry_ptr->flush_op_self_resize_in_progress = TRUE; - } else { + } else { - /* change the size of some other entry */ + /* change the size of some other entry */ - resize_entry(file_ptr, op_ptr->type, op_ptr->idx, + resize_entry(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->size, op_ptr->flag); - } - break; + } + break; - case FLUSH_OP__MOVE: - if((entry_ptr->type == op_ptr->type) && + case FLUSH_OP__MOVE: + if((entry_ptr->type == op_ptr->type) && (entry_ptr->index == op_ptr->idx)) { /* the flush operation is acting on the entry to - * which it is attached. Handle this here: - */ + * which it is attached. Handle this here: + */ - HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0); + HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0); (*flags_ptr) |= H5C__SERIALIZE_MOVED_FLAG; - if(op_ptr->flag) { + if(op_ptr->flag) { HDassert(entry_ptr->addr == entry_ptr->alt_addr); entry_ptr->addr = entry_ptr->main_addr; entry_ptr->at_main_addr = TRUE; @@ -2086,65 +2086,65 @@ execute_flush_op(H5F_t * file_ptr, entry_ptr->addr = entry_ptr->alt_addr; entry_ptr->at_main_addr = FALSE; } /* end else */ - } /* end if */ + } /* end if */ else - move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); - break; + move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); + break; - case FLUSH_OP__ORDER: + case FLUSH_OP__ORDER: HDassert( op_ptr->order_ptr ); entry_ptr->flush_order = *op_ptr->order_ptr; (*op_ptr->order_ptr)++; - break; - - case FLUSH_OP__EXPUNGE: - /* the expunge flush op exists to allow us to simulate the - * case in which an entry is removed from the cashe as the - * the result of the flush of a second entry. At present, - * this can only happen via the take ownership flag, but - * we will make this test feature more general to as to make - * tests easier to write. - * - * When this operation is executed, the target entry is - * removed from the cache without being flushed if dirty - * via the expunge_entry() test function (which calls - * H5C_expunge_entry()). Note that this flush operation - * must always be executed on an entry other than the - * entry being flushed. - */ - HDassert( ( entry_ptr->type != op_ptr->type ) || + break; + + case FLUSH_OP__EXPUNGE: + /* the expunge flush op exists to allow us to simulate the + * case in which an entry is removed from the cashe as the + * the result of the flush of a second entry. At present, + * this can only happen via the take ownership flag, but + * we will make this test feature more general to as to make + * tests easier to write. + * + * When this operation is executed, the target entry is + * removed from the cache without being flushed if dirty + * via the expunge_entry() test function (which calls + * H5C_expunge_entry()). Note that this flush operation + * must always be executed on an entry other than the + * entry being flushed. + */ + HDassert( ( entry_ptr->type != op_ptr->type ) || ( entry_ptr->index != op_ptr->idx ) ); - expunge_entry(file_ptr, op_ptr->type, op_ptr->idx); - break; + expunge_entry(file_ptr, op_ptr->type, op_ptr->idx); + break; - case FLUSH_OP__DEST_FLUSH_DEP: - HDassert( ( entry_ptr->type != op_ptr->type ) || + case FLUSH_OP__DEST_FLUSH_DEP: + HDassert( ( entry_ptr->type != op_ptr->type ) || ( entry_ptr->index != op_ptr->idx ) ); - destroy_flush_dependency(op_ptr->type, op_ptr->idx, + destroy_flush_dependency(op_ptr->type, op_ptr->idx, entry_ptr->type, entry_ptr->index); break; - default: + default: pass = FALSE; failure_mssg = "Undefined flush op code."; - break; - } + break; + } } return; } /* execute_flush_op() */ - + /*------------------------------------------------------------------------- - * Function: entry_in_cache + * Function: entry_in_cache * - * Purpose: Given a pointer to a cache, an entry type, and an index, - * determine if the entry is currently in the cache. + * Purpose: Given a pointer to a cache, an entry type, and an index, + * determine if the entry is currently in the cache. * - * Return: TRUE if the entry is in the cache, and FALSE otherwise. + * Return: TRUE if the entry is in the cache, and FALSE otherwise. * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -2184,7 +2184,7 @@ entry_in_cache(H5C_t * cache_ptr, } /* entry_in_cache() */ - + /*------------------------------------------------------------------------- * Function: create_entry_arrays * @@ -2192,7 +2192,7 @@ entry_in_cache(H5C_t * cache_ptr, * * Return: SUCCEED/FAIL * - * Programmer: Dana Robinson + * Programmer: Dana Robinson * Spring 2016 * *------------------------------------------------------------------------- @@ -2300,7 +2300,7 @@ error: } /* create_entry_arrays() */ - + /*------------------------------------------------------------------------- * Function: free_entry_arrays * @@ -2308,7 +2308,7 @@ error: * * Return: void * - * Programmer: Dana Robinson + * Programmer: Dana Robinson * Spring 2016 * *------------------------------------------------------------------------- @@ -2366,15 +2366,15 @@ free_entry_arrays(void) } /* free_entry_arrays() */ - + /*------------------------------------------------------------------------- - * Function: reset_entries + * Function: reset_entries * - * Purpose: reset the contents of the entries arrays to known values. + * Purpose: reset the contents of the entries arrays to known values. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -2518,15 +2518,15 @@ reset_entries(void) } /* reset_entries() */ - + /*------------------------------------------------------------------------- * Function: resize_entry * * Purpose: Given a pointer to a cache, an entry type, an index, and - * a new size, set the size of the target entry to the new size. + * a new size, set the size of the target entry to the new size. * - * Note that at present, the type of the entry must be - * VARIABLE_ENTRY_TYPE. + * Note that at present, the type of the entry must be + * VARIABLE_ENTRY_TYPE. * * Do nothing if pass is false on entry. * @@ -2543,7 +2543,7 @@ resize_entry(H5F_t * file_ptr, int32_t type, int32_t idx, size_t new_size, - hbool_t in_cache) + hbool_t in_cache) { test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -2606,28 +2606,28 @@ resize_entry(H5F_t * file_ptr, } } else { - protect_entry(file_ptr, type, idx); + protect_entry(file_ptr, type, idx); resize_entry(file_ptr, type, idx, new_size, TRUE); - unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG); - } + unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG); + } } return; } /* resize_entry() */ - + /*------------------------------------------------------------------------- - * Function: verify_clean + * Function: verify_clean * - * Purpose: Verify that all cache entries are marked as clean. If any - * are not, set pass to FALSE. + * Purpose: Verify that all cache entries are marked as clean. If any + * are not, set pass to FALSE. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -2655,7 +2655,7 @@ verify_clean(void) for ( j = 0; j <= max_index; j++ ) { if ( ( base_addr[j].header.is_dirty ) || - ( base_addr[j].is_dirty ) ) { + ( base_addr[j].is_dirty ) ) { dirty_count++; } @@ -2673,19 +2673,19 @@ verify_clean(void) } /* verify_clean() */ - + /*------------------------------------------------------------------------- - * Function: verify_entry_status + * Function: verify_entry_status * - * Purpose: Verify that a list of entries have the expected status. - * If any discrepencies are found, set the failure message - * and set pass to FALSE. + * Purpose: Verify that a list of entries have the expected status. + * If any discrepencies are found, set the failure message + * and set pass to FALSE. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/8/04 * *------------------------------------------------------------------------- @@ -2693,9 +2693,9 @@ verify_clean(void) void verify_entry_status(H5C_t * cache_ptr, - int tag, - int num_entries, - struct expected_entry_status expected[]) + int tag, + int num_entries, + struct expected_entry_status expected[]) { static char msg[256]; int i; @@ -2708,222 +2708,222 @@ verify_entry_status(H5C_t * cache_ptr, hbool_t in_cache = FALSE; /* will set to TRUE if necessary */ unsigned u; /* Local index variable */ - if ( ( ! expected[i].in_cache ) && + if ( ( ! expected[i].in_cache ) && ( ( expected[i].is_protected ) || ( expected[i].is_pinned ) ) ) { - pass = FALSE; - sprintf(msg, "%d: Contradictory data in expected[%d].\n", tag, i); - failure_mssg = msg; - } + pass = FALSE; + HDsprintf(msg, "%d: Contradictory data in expected[%d].\n", tag, i); + failure_mssg = msg; + } if ( ( ! expected[i].in_cache ) && ( expected[i].is_dirty ) && ( ! entry_ptr->expunged ) ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d: expected[%d] specs non-expunged, dirty, non-resident.\n", tag, i); - failure_mssg = msg; + failure_mssg = msg; } if ( pass ) { - in_cache = entry_in_cache(cache_ptr, expected[i].entry_type, - expected[i].entry_index); + in_cache = entry_in_cache(cache_ptr, expected[i].entry_type, + expected[i].entry_index); - if ( in_cache != expected[i].in_cache ) { + if ( in_cache != expected[i].in_cache ) { - pass = FALSE; - sprintf(msg, - "%d entry (%d, %d) in cache actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)in_cache, - (int)expected[i].in_cache); - failure_mssg = msg; - } - } + pass = FALSE; + HDsprintf(msg, + "%d entry (%d, %d) in cache actual/expected = %d/%d.\n", + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)in_cache, + (int)expected[i].in_cache); + failure_mssg = msg; + } + } if ( pass ) { - if ( entry_ptr->size != expected[i].size ) { + if ( entry_ptr->size != expected[i].size ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) size actual/expected = %ld/%ld.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (long)(entry_ptr->size), - (long)expected[i].size); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (long)(entry_ptr->size), + (long)expected[i].size); + failure_mssg = msg; + } + } if ( ( pass ) && ( in_cache ) ) { - if ( entry_ptr->header.size != expected[i].size ) { + if ( entry_ptr->header.size != expected[i].size ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) header size actual/expected = %ld/%ld.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (long)(entry_ptr->header.size), - (long)expected[i].size); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (long)(entry_ptr->header.size), + (long)expected[i].size); + failure_mssg = msg; + } + } - if ( pass ) { + if ( pass ) { - if ( entry_ptr->at_main_addr != expected[i].at_main_addr ) { + if ( entry_ptr->at_main_addr != expected[i].at_main_addr ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) at main addr actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->at_main_addr), - (int)expected[i].at_main_addr); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->at_main_addr), + (int)expected[i].at_main_addr); + failure_mssg = msg; + } + } - if ( pass ) { + if ( pass ) { - if ( entry_ptr->is_dirty != expected[i].is_dirty ) { + if ( entry_ptr->is_dirty != expected[i].is_dirty ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) is_dirty actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->is_dirty), - (int)expected[i].is_dirty); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->is_dirty), + (int)expected[i].is_dirty); + failure_mssg = msg; + } + } - if ( ( pass ) && ( in_cache ) ) { + if ( ( pass ) && ( in_cache ) ) { - if ( entry_ptr->header.is_dirty != expected[i].is_dirty ) { + if ( entry_ptr->header.is_dirty != expected[i].is_dirty ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) header is_dirty actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->header.is_dirty), - (int)expected[i].is_dirty); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->header.is_dirty), + (int)expected[i].is_dirty); + failure_mssg = msg; + } + } - if ( pass ) { + if ( pass ) { - if ( entry_ptr->is_protected != expected[i].is_protected ) { + if ( entry_ptr->is_protected != expected[i].is_protected ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) is_protected actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->is_protected), - (int)expected[i].is_protected); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->is_protected), + (int)expected[i].is_protected); + failure_mssg = msg; + } + } - if ( ( pass ) && ( in_cache ) ) { + if ( ( pass ) && ( in_cache ) ) { - if ( entry_ptr->header.is_protected != expected[i].is_protected ) { + if ( entry_ptr->header.is_protected != expected[i].is_protected ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) header is_protected actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->header.is_protected), - (int)expected[i].is_protected); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->header.is_protected), + (int)expected[i].is_protected); + failure_mssg = msg; + } + } - if ( pass ) { + if ( pass ) { - if ( entry_ptr->is_pinned != expected[i].is_pinned ) { + if ( entry_ptr->is_pinned != expected[i].is_pinned ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) is_pinned actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->is_pinned), - (int)expected[i].is_pinned); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->is_pinned), + (int)expected[i].is_pinned); + failure_mssg = msg; + } + } - if ( pass ) { + if ( pass ) { - if ( entry_ptr->is_corked != expected[i].is_corked) { + if ( entry_ptr->is_corked != expected[i].is_corked) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) is_corked actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->is_corked), - (int)expected[i].is_corked); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->is_corked), + (int)expected[i].is_corked); + failure_mssg = msg; + } + } - if ( ( pass ) && ( in_cache ) ) { + if ( ( pass ) && ( in_cache ) ) { - if ( entry_ptr->header.is_pinned != expected[i].is_pinned ) { + if ( entry_ptr->header.is_pinned != expected[i].is_pinned ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d, %d) header is_pinned actual/expected = %d/%d.\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->header.is_pinned), - (int)expected[i].is_pinned); - failure_mssg = msg; - } - } + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->header.is_pinned), + (int)expected[i].is_pinned); + failure_mssg = msg; + } + } - if ( pass ) { + if ( pass ) { if ( ( entry_ptr->deserialized != expected[i].deserialized ) || - ( entry_ptr->serialized != expected[i].serialized ) || - ( entry_ptr->destroyed != expected[i].destroyed ) ) { + ( entry_ptr->serialized != expected[i].serialized ) || + ( entry_ptr->destroyed != expected[i].destroyed ) ) { - pass = FALSE; - sprintf(msg, + pass = FALSE; + HDsprintf(msg, "%d entry (%d,%d) deserialized = %d(%d), serialized = %d(%d), dest = %d(%d)\n", - tag, - (int)expected[i].entry_type, - (int)expected[i].entry_index, - (int)(entry_ptr->deserialized), - (int)(expected[i].deserialized), - (int)(entry_ptr->serialized), - (int)(expected[i].serialized), - (int)(entry_ptr->destroyed), - (int)(expected[i].destroyed)); + tag, + (int)expected[i].entry_type, + (int)expected[i].entry_index, + (int)(entry_ptr->deserialized), + (int)(expected[i].deserialized), + (int)(entry_ptr->serialized), + (int)(expected[i].serialized), + (int)(entry_ptr->destroyed), + (int)(expected[i].destroyed)); failure_mssg = msg; } } @@ -2934,7 +2934,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( pass ) { if ( entry_ptr->flush_dep_npar != expected[i].flush_dep_npar ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) flush_dep_npar actual/expected = %u/%u.\n", tag, expected[i].entry_type, @@ -2947,7 +2947,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( ( pass ) && ( in_cache ) ) { if ( entry_ptr->header.flush_dep_nparents != expected[i].flush_dep_npar ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) header flush_dep_nparents actual/expected = %u/%u.\n", tag, expected[i].entry_type, @@ -2964,7 +2964,7 @@ verify_entry_status(H5C_t * cache_ptr, for ( u = 0; u < entry_ptr->flush_dep_npar; u++ ) { if ( entry_ptr->flush_dep_par_type[u] != expected[i].flush_dep_par_type[u] ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) flush_dep_par_type[%u] actual/expected = %d/%d.\n", tag, expected[i].entry_type, @@ -2980,7 +2980,7 @@ verify_entry_status(H5C_t * cache_ptr, for ( u = 0; u < entry_ptr->flush_dep_npar; u++ ) { if ( entry_ptr->flush_dep_par_idx[u] != expected[i].flush_dep_par_idx[u] ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) flush_dep_par_idx[%u] actual/expected = %d/%d.\n", tag, expected[i].entry_type, @@ -2997,7 +2997,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( pass ) { if ( entry_ptr->flush_dep_nchd != expected[i].flush_dep_nchd ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) flush_dep_nchd actual/expected = %u/%u.\n", tag, expected[i].entry_type, @@ -3010,7 +3010,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( ( pass ) && ( in_cache ) ) { if ( entry_ptr->header.flush_dep_nchildren != expected[i].flush_dep_nchd ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) header flush_dep_nchildren actual/expected = %u/%u.\n", tag, expected[i].entry_type, @@ -3023,7 +3023,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( pass ) { if ( entry_ptr->flush_dep_ndirty_chd != expected[i].flush_dep_ndirty_chd ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) flush_dep_ndirty_chd actual/expected = %u/%u.\n", tag, expected[i].entry_type, @@ -3036,7 +3036,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( ( pass ) && ( in_cache ) ) { if ( entry_ptr->header.flush_dep_ndirty_children != expected[i].flush_dep_ndirty_chd ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) header flush_dep_ndirty_children actual/expected = %u/%u.\n", tag, expected[i].entry_type, @@ -3051,7 +3051,7 @@ verify_entry_status(H5C_t * cache_ptr, if ( pass ) { if ( expected[i].flush_order >= 0 && entry_ptr->flush_order != (unsigned)expected[i].flush_order ) { pass = FALSE; - sprintf(msg, + HDsprintf(msg, "%d entry (%d, %d) flush_order actual/expected = %u/%d.\n", tag, expected[i].entry_type, @@ -3069,18 +3069,18 @@ verify_entry_status(H5C_t * cache_ptr, } /* verify_entry_status() */ - + /*------------------------------------------------------------------------- - * Function: verify_unprotected + * Function: verify_unprotected * - * Purpose: Verify that no cache entries are marked as protected. If - * any are, set pass to FALSE. + * Purpose: Verify that no cache entries are marked as protected. If + * any are, set pass to FALSE. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/10/04 * *------------------------------------------------------------------------- @@ -3129,30 +3129,30 @@ verify_unprotected(void) } /* verify_unprotected() */ - + /***************************************************************************** * * Function: setup_cache() * * Purpose: Open an HDF file. This will allocate an instance and - * initialize an associated instance of H5C_t. However, - * we want to test an instance of H5C_t, so allocate and - * initialize one with the file ID returned by the call to - * H5Fcreate(). Return a pointer to this instance of H5C_t. + * initialize an associated instance of H5C_t. However, + * we want to test an instance of H5C_t, so allocate and + * initialize one with the file ID returned by the call to + * H5Fcreate(). Return a pointer to this instance of H5C_t. * - * Observe that we open a HDF file because the cache now - * writes directly to file, and we need the file I/O facilities - * associated with the file. + * Observe that we open a HDF file because the cache now + * writes directly to file, and we need the file I/O facilities + * associated with the file. * - * To avoid tripping on error check code, must allocate enough - * space in the file to hold all the test entries and their - * alternates. This is a little sticky, as the addresses of - * all the test entries are determined at compile time. + * To avoid tripping on error check code, must allocate enough + * space in the file to hold all the test entries and their + * alternates. This is a little sticky, as the addresses of + * all the test entries are determined at compile time. * - * Deal with this by choosing BASE_ADDR large enough that - * the base address of the allocate space will be less than - * or equal to BASE_ADDR, and then requesting an extra BASE_ADDR - * bytes, so we don't have to wory about exceeding the allocation. + * Deal with this by choosing BASE_ADDR large enough that + * the base address of the allocate space will be less than + * or equal to BASE_ADDR, and then requesting an extra BASE_ADDR + * bytes, so we don't have to wory about exceeding the allocation. * * Return: Success: Ptr to H5C_t * @@ -3198,7 +3198,7 @@ setup_cache(size_t max_cache_size, pass = FALSE; failure_mssg = "H5Pset_file_space_strategy() failed.\n"; H5Pclose(fcpl_id); - fcpl_id = H5P_DEFAULT; + fcpl_id = H5P_DEFAULT; } } @@ -3208,11 +3208,11 @@ setup_cache(size_t max_cache_size, pass = FALSE; failure_mssg = "H5Pset_file_space_page_size() failed.\n"; H5Pclose(fcpl_id); - fcpl_id = H5P_DEFAULT; + fcpl_id = H5P_DEFAULT; } } - if(pass) + if(pass) saved_fcpl_id = fcpl_id; /* setup the file name */ @@ -3228,24 +3228,24 @@ setup_cache(size_t max_cache_size, FUNC, mile_stone++, (int)pass); if(pass && try_core_file_driver) { - if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) { - pass = FALSE; - failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) { + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; } - else if(H5Pset_fapl_core(fapl_id, MAX_ADDR, FALSE) < 0) { - H5Pclose(fapl_id); - fapl_id = H5P_DEFAULT; - pass = FALSE; - failure_mssg = "H5P_set_fapl_core() failed.\n"; + else if(H5Pset_fapl_core(fapl_id, MAX_ADDR, FALSE) < 0) { + H5Pclose(fapl_id); + fapl_id = H5P_DEFAULT; + pass = FALSE; + failure_mssg = "H5P_set_fapl_core() failed.\n"; } - else if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) { - core_file_driver_failed = TRUE; + else if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) { + core_file_driver_failed = TRUE; if(verbose) HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC); } else { - saved_fapl_id = fapl_id; - } + saved_fapl_id = fapl_id; + } } if(show_progress) /* 3 */ @@ -3376,21 +3376,21 @@ setup_cache(size_t max_cache_size, if(pass) { /* allocate space for test entries */ actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); - if(actual_base_addr == HADDR_UNDEF) { + if(actual_base_addr == HADDR_UNDEF) { pass = FALSE; - failure_mssg = "H5MF_alloc() failed."; + failure_mssg = "H5MF_alloc() failed."; - if(verbose) + if(verbose) HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC); - } else if(actual_base_addr > BASE_ADDR) { - /* If this happens, must increase BASE_ADDR so that the - * actual_base_addr is <= BASE_ADDR. This should only happen - * if the size of the superblock is increase. - */ + } else if(actual_base_addr > BASE_ADDR) { + /* If this happens, must increase BASE_ADDR so that the + * actual_base_addr is <= BASE_ADDR. This should only happen + * if the size of the superblock is increase. + */ pass = FALSE; - failure_mssg = "actual_base_addr > BASE_ADDR"; + failure_mssg = "actual_base_addr > BASE_ADDR"; - if(verbose) + if(verbose) HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC); } @@ -3416,19 +3416,19 @@ setup_cache(size_t max_cache_size, return(ret_val); } /* setup_cache() */ - + /*------------------------------------------------------------------------- - * Function: takedown_cache() + * Function: takedown_cache() * - * Purpose: Flush the specified cache and destroy it. If requested, - * dump stats first. Then close and delete the associate - * file. + * Purpose: Flush the specified cache and destroy it. If requested, + * dump stats first. Then close and delete the associate + * file. * - * If pass is FALSE, do nothing. + * If pass is FALSE, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/14/07 * *------------------------------------------------------------------------- @@ -3528,22 +3528,22 @@ takedown_cache(H5F_t * file_ptr, } /* takedown_cache() */ - + /*------------------------------------------------------------------------- - * Function: expunge_entry() + * Function: expunge_entry() * - * Purpose: Expunge the entry indicated by the type and index. + * Purpose: Expunge the entry indicated by the type and index. * * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/6/06 * - * Changes: Added code to set entry_ptr->expunged to TRUE if - * H5C_expunge_entry() returns without error. + * Changes: Added code to set entry_ptr->expunged to TRUE if + * H5C_expunge_entry() returns without error. * - * JRM -- 8/21/14 + * JRM -- 8/21/14 * *------------------------------------------------------------------------- */ @@ -3573,11 +3573,11 @@ expunge_entry(H5F_t * file_ptr, HDassert( entry_ptr->index == idx ); HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr == cache_ptr ); + HDassert( entry_ptr->cache_ptr == cache_ptr ); HDassert( ! ( entry_ptr->header.is_protected ) ); HDassert( ! ( entry_ptr->is_protected ) ); HDassert( ! ( entry_ptr->header.is_pinned ) ); - HDassert( ! ( entry_ptr->is_pinned ) ); + HDassert( ! ( entry_ptr->is_pinned ) ); result = H5C_expunge_entry(file_ptr, types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -3588,7 +3588,7 @@ expunge_entry(H5F_t * file_ptr, } else { - entry_ptr->expunged = TRUE; + entry_ptr->expunged = TRUE; } } @@ -3596,16 +3596,16 @@ expunge_entry(H5F_t * file_ptr, } /* expunge_entry() */ - + /*------------------------------------------------------------------------- - * Function: flush_cache() + * Function: flush_cache() * - * Purpose: Flush the specified cache, destroying all entries if + * Purpose: Flush the specified cache, destroying all entries if requested. If requested, dump stats first. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/23/04 * *------------------------------------------------------------------------- @@ -3665,18 +3665,18 @@ flush_cache(H5F_t * file_ptr, } /* flush_cache() */ - + /*------------------------------------------------------------------------- - * Function: cork_entry_type() + * Function: cork_entry_type() * - * Purpose: To "cork" an object: - * --insert the base address of an entry type into - * the cache's list of corked object addresses + * Purpose: To "cork" an object: + * --insert the base address of an entry type into + * the cache's list of corked object addresses * - * Return: void + * Return: void * - * Programmer: Vailin Choi - * Jan 2014 + * Programmer: Vailin Choi + * Jan 2014 * *------------------------------------------------------------------------- */ @@ -3701,18 +3701,18 @@ cork_entry_type(H5F_t *file_ptr, int32_t type) } /* cork_entry_type() */ - + /*------------------------------------------------------------------------- - * Function: uncork_entry_type() + * Function: uncork_entry_type() * - * Purpose: To "uncork" an object: - * --insert the base address of an entry type into - * the cache's list of corked object addresses + * Purpose: To "uncork" an object: + * --insert the base address of an entry type into + * the cache's list of corked object addresses * - * Return: void + * Return: void * - * Programmer: Vailin Choi - * Jan 2014 + * Programmer: Vailin Choi + * Jan 2014 * *------------------------------------------------------------------------- */ @@ -3737,17 +3737,17 @@ uncork_entry_type(H5F_t *file_ptr, int32_t type) } /* uncork_entry_type() */ - + /*------------------------------------------------------------------------- - * Function: insert_entry() + * Function: insert_entry() * - * Purpose: Insert the entry indicated by the type and index. + * Purpose: Insert the entry indicated by the type and index. * - * Do nothing if pass is false. + * Do nothing if pass is false. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/16/04 * *------------------------------------------------------------------------- @@ -3810,7 +3810,7 @@ insert_entry(H5F_t * file_ptr, HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n", (int)(entry_ptr->header.is_protected)); HDfprintf(stdout, - "entry_ptr->header.type != types[type] = %d\n", + "entry_ptr->header.type != types[type] = %d\n", (int)(entry_ptr->header.type != types[type])); HDfprintf(stdout, "entry_ptr->size != entry_ptr->header.size = %d\n", @@ -3843,17 +3843,17 @@ insert_entry(H5F_t * file_ptr, } /* insert_entry() */ - + /*------------------------------------------------------------------------- - * Function: mark_entry_dirty() + * Function: mark_entry_dirty() * - * Purpose: Mark the specified entry as dirty. + * Purpose: Mark the specified entry as dirty. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 3/28/06 * *------------------------------------------------------------------------- @@ -3880,10 +3880,10 @@ mark_entry_dirty(int32_t type, HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); HDassert( entry_ptr->header.is_protected || - entry_ptr->header.is_pinned ); + entry_ptr->header.is_pinned ); was_dirty = entry_ptr->is_dirty; - entry_ptr->is_dirty = TRUE; + entry_ptr->is_dirty = TRUE; if(entry_ptr->flush_dep_npar > 0 && !was_dirty) mark_flush_dep_dirty(entry_ptr); @@ -3911,17 +3911,17 @@ mark_entry_dirty(int32_t type, } /* mark_entry_dirty() */ - + /*------------------------------------------------------------------------- - * Function: move_entry() + * Function: move_entry() * - * Purpose: Move the entry indicated by the type and index to its - * main or alternate address as indicated. If the entry is - * already at the desired entry, do nothing. + * Purpose: Move the entry indicated by the type and index to its + * main or alternate address as indicated. If the entry is + * already at the desired entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/21/04 * *------------------------------------------------------------------------- @@ -3934,7 +3934,7 @@ move_entry(H5C_t * cache_ptr, hbool_t main_addr) { herr_t result; - hbool_t done = TRUE; /* will set to FALSE if we have work to do */ + hbool_t done = TRUE; /* will set to FALSE if we have work to do */ haddr_t old_addr = HADDR_UNDEF; haddr_t new_addr = HADDR_UNDEF; test_entry_t * base_addr; @@ -3994,8 +3994,8 @@ move_entry(H5C_t * cache_ptr, if ( ! done ) { if ( ( result < 0 ) || - ( ( ! ( entry_ptr->header.destroy_in_progress ) ) && - ( entry_ptr->header.addr != new_addr ) ) ) { + ( ( ! ( entry_ptr->header.destroy_in_progress ) ) && + ( entry_ptr->header.addr != new_addr ) ) ) { pass = FALSE; failure_mssg = "error in H5C_move_entry()."; @@ -4017,17 +4017,17 @@ move_entry(H5C_t * cache_ptr, } /* move_entry() */ - + /*------------------------------------------------------------------------- - * Function: protect_entry() + * Function: protect_entry() * - * Purpose: Protect the entry indicated by the type and index. + * Purpose: Protect the entry indicated by the type and index. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/11/04 * *------------------------------------------------------------------------- @@ -4061,8 +4061,8 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) /* Use to cork entries for the object */ H5AC_tag(baddrs, NULL); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, - types[type], entry_ptr->addr, &entry_ptr->addr, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, + types[type], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)entry_ptr ) || @@ -4092,7 +4092,7 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) HDfprintf(stdout, "entry_ptr->addr = %d, entry_ptr->header.addr = %d\n", (int)(entry_ptr->addr), (int)(entry_ptr->header.addr)); - HDfprintf(stdout, + HDfprintf(stdout, "entry_ptr->verify_ct = %d, entry_ptr->max_verify_ct = %d\n", entry_ptr->verify_ct, entry_ptr->max_verify_ct); H5Eprint2(H5E_DEFAULT, stdout); @@ -4103,35 +4103,35 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) } /* end if */ else { - HDassert( ( entry_ptr->cache_ptr == NULL ) || - ( entry_ptr->cache_ptr == cache_ptr ) ); + HDassert( ( entry_ptr->cache_ptr == NULL ) || + ( entry_ptr->cache_ptr == cache_ptr ) ); - entry_ptr->cache_ptr = cache_ptr; - entry_ptr->file_ptr = file_ptr; + entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; } /* end else */ if(entry_ptr->header.tag_info && entry_ptr->header.tag_info->corked) - entry_ptr->is_corked = TRUE; + entry_ptr->is_corked = TRUE; HDassert(((entry_ptr->header).type)->id == type); } /* end if */ } /* protect_entry() */ - + /*------------------------------------------------------------------------- - * Function: protect_entry_ro() + * Function: protect_entry_ro() * - * Purpose: Do a read only protect the entry indicated by the type - * and index. + * Purpose: Do a read only protect the entry indicated by the type + * and index. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/1/07 * *------------------------------------------------------------------------- @@ -4162,8 +4162,8 @@ protect_entry_ro(H5F_t * file_ptr, HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); HDassert( ( ! ( entry_ptr->is_protected ) ) || - ( ( entry_ptr->is_read_only ) && - ( entry_ptr->ro_ref_count > 0 ) ) ); + ( ( entry_ptr->is_read_only ) && + ( entry_ptr->ro_ref_count > 0 ) ) ); cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); @@ -4181,14 +4181,14 @@ protect_entry_ro(H5F_t * file_ptr, } else { - HDassert( ( entry_ptr->cache_ptr == NULL ) || - ( entry_ptr->cache_ptr == cache_ptr ) ); + HDassert( ( entry_ptr->cache_ptr == NULL ) || + ( entry_ptr->cache_ptr == cache_ptr ) ); - entry_ptr->cache_ptr = cache_ptr; - entry_ptr->file_ptr = file_ptr; + entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; - entry_ptr->is_read_only = TRUE; - entry_ptr->ro_ref_count++; + entry_ptr->is_read_only = TRUE; + entry_ptr->ro_ref_count++; } HDassert( ((entry_ptr->header).type)->id == type ); @@ -4198,17 +4198,17 @@ protect_entry_ro(H5F_t * file_ptr, } /* protect_entry_ro() */ - + /*------------------------------------------------------------------------- - * Function: pin_entry() + * Function: pin_entry() * - * Purpose: Pin the entry indicated by the type and index. + * Purpose: Pin the entry indicated by the type and index. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 3/17/09 * *------------------------------------------------------------------------- @@ -4235,41 +4235,41 @@ pin_entry(int32_t type, HDassert( entry_ptr->is_protected ); HDassert( !(entry_ptr->pinned_from_client) ); - result = H5C_pin_protected_entry((void *)entry_ptr); + result = H5C_pin_protected_entry((void *)entry_ptr); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; failure_mssg = "H5C_pin_protected_entry() reports failure."; - } else if ( ! ( entry_ptr->header.is_pinned ) ) { + } else if ( ! ( entry_ptr->header.is_pinned ) ) { pass = FALSE; failure_mssg = "entry not pinned when it should be."; - } else { + } else { entry_ptr->pinned_from_client = TRUE; - entry_ptr->is_pinned = TRUE; + entry_ptr->is_pinned = TRUE; - } + } } /* end if */ return; } /* pin_entry() */ - + /*------------------------------------------------------------------------- - * Function: unpin_entry() + * Function: unpin_entry() * - * Purpose: Unpin the entry indicated by the type and index. + * Purpose: Unpin the entry indicated by the type and index. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 3/28/06 * *------------------------------------------------------------------------- @@ -4295,8 +4295,8 @@ unpin_entry(int32_t type, HDassert( entry_ptr == entry_ptr->self ); HDassert( entry_ptr->header.is_pinned ); HDassert( entry_ptr->header.pinned_from_client ); - HDassert( entry_ptr->is_pinned ); - HDassert( entry_ptr->pinned_from_client ); + HDassert( entry_ptr->is_pinned ); + HDassert( entry_ptr->pinned_from_client ); result = H5C_unpin_entry(entry_ptr); @@ -4314,7 +4314,7 @@ unpin_entry(int32_t type, entry_ptr->pinned_from_client = FALSE; - entry_ptr->is_pinned = entry_ptr->pinned_from_cache; + entry_ptr->is_pinned = entry_ptr->pinned_from_cache; HDassert( ((entry_ptr->header).type)->id == type ); @@ -4324,17 +4324,17 @@ unpin_entry(int32_t type, } /* unpin_entry() */ - + /*------------------------------------------------------------------------- - * Function: unprotect_entry() + * Function: unprotect_entry() * - * Purpose: Unprotect the entry indicated by the type and index. + * Purpose: Unprotect the entry indicated by the type and index. * - * Do nothing if pass is FALSE on entry. + * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/12/04 * *------------------------------------------------------------------------- @@ -4365,12 +4365,12 @@ unprotect_entry(H5F_t * file_ptr, HDassert( entry_ptr->header.is_protected ); HDassert( entry_ptr->is_protected ); - pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0); - unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0); + pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0); + unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0); - HDassert ( ! ( pin_flag_set && unpin_flag_set ) ); - HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) ); - HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) ); + HDassert ( ! ( pin_flag_set && unpin_flag_set ) ); + HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) ); + HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) ); if(flags & H5C__DIRTIED_FLAG) { hbool_t was_dirty = entry_ptr->is_dirty; @@ -4385,8 +4385,8 @@ unprotect_entry(H5F_t * file_ptr, if ( ( result < 0 ) || ( ( entry_ptr->header.is_protected ) && - ( ( ! ( entry_ptr->is_read_only ) ) || - ( entry_ptr->ro_ref_count <= 0 ) ) ) || + ( ( ! ( entry_ptr->is_read_only ) ) || + ( entry_ptr->ro_ref_count <= 0 ) ) ) || ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4397,33 +4397,33 @@ unprotect_entry(H5F_t * file_ptr, } else { - if ( entry_ptr->ro_ref_count > 1 ) { + if ( entry_ptr->ro_ref_count > 1 ) { - entry_ptr->ro_ref_count--; + entry_ptr->ro_ref_count--; - } else if ( entry_ptr->ro_ref_count == 1 ) { + } else if ( entry_ptr->ro_ref_count == 1 ) { - entry_ptr->is_protected = FALSE; - entry_ptr->is_read_only = FALSE; - entry_ptr->ro_ref_count = 0; + entry_ptr->is_protected = FALSE; + entry_ptr->is_read_only = FALSE; + entry_ptr->ro_ref_count = 0; - } else { + } else { - entry_ptr->is_protected = FALSE; + entry_ptr->is_protected = FALSE; - } + } - if ( pin_flag_set ) { + if ( pin_flag_set ) { - HDassert(entry_ptr->header.is_pinned); - entry_ptr->pinned_from_client = TRUE; - entry_ptr->is_pinned = TRUE; + HDassert(entry_ptr->header.is_pinned); + entry_ptr->pinned_from_client = TRUE; + entry_ptr->is_pinned = TRUE; - } else if ( unpin_flag_set ) { + } else if ( unpin_flag_set ) { - HDassert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache); - entry_ptr->pinned_from_client = FALSE; - entry_ptr->is_pinned = entry_ptr->pinned_from_cache; + HDassert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache); + entry_ptr->pinned_from_client = FALSE; + entry_ptr->is_pinned = entry_ptr->pinned_from_cache; } } @@ -4437,26 +4437,26 @@ unprotect_entry(H5F_t * file_ptr, HDassert( entry_ptr->is_dirty ); } - HDassert( entry_ptr->header.is_protected == entry_ptr->is_protected ); - HDassert( entry_ptr->header.is_read_only == entry_ptr->is_read_only ); - HDassert( entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count ); + HDassert( entry_ptr->header.is_protected == entry_ptr->is_protected ); + HDassert( entry_ptr->header.is_read_only == entry_ptr->is_read_only ); + HDassert( entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count ); } return; } /* unprotect_entry() */ - + /*------------------------------------------------------------------------- - * Function: row_major_scan_forward() + * Function: row_major_scan_forward() * - * Purpose: Do a sequence of inserts, protects, unprotects, moves, - * destroys while scanning through the set of entries. If - * pass is false on entry, do nothing. + * Purpose: Do a sequence of inserts, protects, unprotects, moves, + * destroys while scanning through the set of entries. If + * pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/12/04 * *------------------------------------------------------------------------- @@ -4473,7 +4473,7 @@ row_major_scan_forward(H5F_t * file_ptr, hbool_t do_moves, hbool_t move_to_main_addr, hbool_t do_destroys, - hbool_t do_mult_ro_protects, + hbool_t do_mult_ro_protects, int dirty_destroys, int dirty_unprotects) { @@ -4501,7 +4501,7 @@ row_major_scan_forward(H5F_t * file_ptr, while(pass && idx <= (local_max_index + lag)) { int32_t tmp_idx; - if(verbose) + if(verbose) HDfprintf(stdout, "%d:%d: ", type, idx); tmp_idx = idx + lag; @@ -4512,7 +4512,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "1(i, %d, %d) ", type, tmp_idx); insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ tmp_idx--; @@ -4523,7 +4523,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "2(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ tmp_idx--; @@ -4534,7 +4534,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "3(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ /* (don't decrement tmp_idx) */ @@ -4545,7 +4545,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "4(r, %d, %d, %d) ", type, tmp_idx, (int)move_to_main_addr); move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ tmp_idx--; @@ -4556,7 +4556,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "5(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ tmp_idx -= 2; @@ -4567,83 +4567,83 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "6(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ - if(do_mult_ro_protects) { + if(do_mult_ro_protects) { /* (don't decrement tmp_idx) */ - if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && + if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && (tmp_idx % 9) == 0) { if(verbose) HDfprintf(stdout, "7(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); - } /* end if */ + protect_entry_ro(file_ptr, type, tmp_idx); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } /* end if */ tmp_idx--; - if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && + if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && (tmp_idx % 11) == 0) { if(verbose) HDfprintf(stdout, "8(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); - } /* end if */ + protect_entry_ro(file_ptr, type, tmp_idx); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } /* end if */ tmp_idx--; - if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && + if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && (tmp_idx % 13) == 0) { if(verbose) HDfprintf(stdout, "9(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); - } /* end if */ + protect_entry_ro(file_ptr, type, tmp_idx); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } /* end if */ /* (don't decrement tmp_idx) */ - if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && + if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && (tmp_idx % 9) == 0) { if(verbose) HDfprintf(stdout, "10(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); - } /* end if */ + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } /* end if */ tmp_idx--; - if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && + if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && (tmp_idx % 11) == 0) { if(verbose) HDfprintf(stdout, "11(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); - } /* end if */ + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } /* end if */ tmp_idx--; - if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && + if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) && (tmp_idx % 13) == 0) { if(verbose) HDfprintf(stdout, "12(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); - } /* end if */ - } /* if ( do_mult_ro_protects ) */ + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } /* end if */ + } /* if ( do_mult_ro_protects ) */ if(pass && (idx >= 0) && (idx <= local_max_index)) { if(verbose) HDfprintf(stdout, "13(p, %d, %d) ", type, idx); protect_entry(file_ptr, type, idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ tmp_idx = idx - lag + 2; @@ -4654,7 +4654,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "14(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ tmp_idx--; @@ -4665,7 +4665,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "15(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ if(do_destroys) { @@ -4677,7 +4677,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); break; case 1: @@ -4686,14 +4686,14 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ else { if(verbose) HDfprintf(stdout, "18(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end else */ break; @@ -4702,7 +4702,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); break; case 3: @@ -4711,14 +4711,14 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ else { if(verbose) HDfprintf(stdout, "21(u-del, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end else */ break; @@ -4735,7 +4735,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "22(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } /* end if */ } /* end elsef */ @@ -4753,17 +4753,17 @@ row_major_scan_forward(H5F_t * file_ptr, } /* row_major_scan_forward() */ - + /*------------------------------------------------------------------------- - * Function: hl_row_major_scan_forward() + * Function: hl_row_major_scan_forward() * - * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning through the set of entries. - * If pass is false on entry, do nothing. + * Purpose: Do a high locality sequence of inserts, protects, and + * unprotects while scanning through the set of entries. + * If pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/21/04 * *------------------------------------------------------------------------- @@ -4858,17 +4858,17 @@ hl_row_major_scan_forward(H5F_t * file_ptr, } /* hl_row_major_scan_forward() */ - + /*------------------------------------------------------------------------- - * Function: row_major_scan_backward() + * Function: row_major_scan_backward() * - * Purpose: Do a sequence of inserts, protects, unprotects, moves, - * destroys while scanning backwards through the set of - * entries. If pass is false on entry, do nothing. + * Purpose: Do a sequence of inserts, protects, unprotects, moves, + * destroys while scanning backwards through the set of + * entries. If pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/12/04 * *------------------------------------------------------------------------- @@ -4886,7 +4886,7 @@ row_major_scan_backward(H5F_t * file_ptr, hbool_t do_moves, hbool_t move_to_main_addr, hbool_t do_destroys, - hbool_t do_mult_ro_protects, + hbool_t do_mult_ro_protects, int dirty_destroys, int dirty_unprotects) { @@ -4962,7 +4962,7 @@ row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(r, %d, %d, %d) ", - type, tmp_idx, (int)move_to_main_addr); + type, tmp_idx, (int)move_to_main_addr); move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); } @@ -4990,73 +4990,73 @@ row_major_scan_backward(H5F_t * file_ptr, } /* (don't increment tmp_idx) */ - if ( do_mult_ro_protects ) - { - if ( ( pass ) && ( tmp_idx >= 0 ) && - ( tmp_idx < local_max_index ) && - ( tmp_idx % 9 == 0 ) ) { + if ( do_mult_ro_protects ) + { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, tmp_idx); - } + protect_entry_ro(file_ptr, type, tmp_idx); + } tmp_idx++; - if ( ( pass ) && ( tmp_idx >= 0 ) && - ( tmp_idx < local_max_index ) && - ( tmp_idx % 11 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, tmp_idx); - } + protect_entry_ro(file_ptr, type, tmp_idx); + } tmp_idx++; - if ( ( pass ) && ( tmp_idx >= 0 ) && - ( tmp_idx < local_max_index ) && - ( tmp_idx % 13 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, tmp_idx); - } + protect_entry_ro(file_ptr, type, tmp_idx); + } /* (don't increment tmp_idx) */ - if ( ( pass ) && ( tmp_idx >= 0 ) && - ( tmp_idx < local_max_index ) && - ( tmp_idx % 9 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - } + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + } tmp_idx++; - if ( ( pass ) && ( tmp_idx >= 0 ) && - ( tmp_idx < local_max_index ) && - ( tmp_idx % 11 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - } + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + } tmp_idx++; - if ( ( pass ) && ( tmp_idx >= 0 ) && - ( tmp_idx < local_max_index ) && - ( tmp_idx % 13 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - } - } /* if ( do_mult_ro_protects ) */ + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + } + } /* if ( do_mult_ro_protects ) */ if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) { @@ -5162,17 +5162,17 @@ row_major_scan_backward(H5F_t * file_ptr, } /* row_major_scan_backward() */ - + /*------------------------------------------------------------------------- - * Function: hl_row_major_scan_backward() + * Function: hl_row_major_scan_backward() * - * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning through the set of entries. - * If pass is false on entry, do nothing. + * Purpose: Do a high locality sequence of inserts, protects, and + * unprotects while scanning through the set of entries. + * If pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/21/04 * *------------------------------------------------------------------------- @@ -5267,17 +5267,17 @@ hl_row_major_scan_backward(H5F_t * file_ptr, } /* hl_row_major_scan_backward() */ - + /*------------------------------------------------------------------------- - * Function: col_major_scan_forward() + * Function: col_major_scan_forward() * - * Purpose: Do a sequence of inserts, protects, and unprotects - * while scanning through the set of entries. If - * pass is false on entry, do nothing. + * Purpose: Do a sequence of inserts, protects, and unprotects + * while scanning through the set of entries. If + * pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/23/04 * *------------------------------------------------------------------------- @@ -5285,7 +5285,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, void col_major_scan_forward(H5F_t * file_ptr, - int32_t max_index, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -5375,17 +5375,17 @@ col_major_scan_forward(H5F_t * file_ptr, } /* col_major_scan_forward() */ - + /*------------------------------------------------------------------------- - * Function: hl_col_major_scan_forward() + * Function: hl_col_major_scan_forward() * - * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning through the set of entries. If - * pass is false on entry, do nothing. + * Purpose: Do a high locality sequence of inserts, protects, and + * unprotects while scanning through the set of entries. If + * pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 19/25/04 * *------------------------------------------------------------------------- @@ -5491,17 +5491,17 @@ hl_col_major_scan_forward(H5F_t * file_ptr, } /* hl_col_major_scan_forward() */ - + /*------------------------------------------------------------------------- - * Function: col_major_scan_backward() + * Function: col_major_scan_backward() * - * Purpose: Do a sequence of inserts, protects, and unprotects - * while scanning backwards through the set of - * entries. If pass is false on entry, do nothing. + * Purpose: Do a sequence of inserts, protects, and unprotects + * while scanning backwards through the set of + * entries. If pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/23/04 * *------------------------------------------------------------------------- @@ -5509,7 +5509,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, void col_major_scan_backward(H5F_t * file_ptr, - int32_t max_index, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -5569,8 +5569,8 @@ col_major_scan_backward(H5F_t * file_ptr, } if ( ( pass ) && - ( idx >= 0 ) && - ( idx <= local_max_index[type] ) ) { + ( idx >= 0 ) && + ( idx <= local_max_index[type] ) ) { if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -5612,17 +5612,17 @@ col_major_scan_backward(H5F_t * file_ptr, } /* col_major_scan_backward() */ - + /*------------------------------------------------------------------------- - * Function: hl_col_major_scan_backward() + * Function: hl_col_major_scan_backward() * - * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning backwards through the set of - * entries. If pass is false on entry, do nothing. + * Purpose: Do a high locality sequence of inserts, protects, and + * unprotects while scanning backwards through the set of + * entries. If pass is false on entry, do nothing. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/25/04 * *------------------------------------------------------------------------- @@ -5727,17 +5727,17 @@ hl_col_major_scan_backward(H5F_t * file_ptr, } /* hl_col_major_scan_backward() */ - + /*------------------------------------------------------------------------- - * Function: create_flush_dependency() + * Function: create_flush_dependency() * - * Purpose: Create a 'flush dependency' between two entries. + * Purpose: Create a 'flush dependency' between two entries. * - * Do nothing if pass is false. + * Do nothing if pass is false. * - * Return: void + * Return: void * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 3/16/09 * *------------------------------------------------------------------------- @@ -5808,17 +5808,17 @@ create_flush_dependency(int32_t par_type, } /* end if */ } /* create_flush_dependency() */ - + /*------------------------------------------------------------------------- - * Function: destroy_flush_dependency() + * Function: destroy_flush_dependency() * - * Purpose: Destroy a 'flush dependency' between two entries. + * Purpose: Destroy a 'flush dependency' between two entries. * - * Do nothing if pass is false. + * Do nothing if pass is false. * - * Return: void + * Return: void * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 3/16/09 * *------------------------------------------------------------------------- @@ -5899,7 +5899,7 @@ destroy_flush_dependency(int32_t par_type, } /* end if */ } /* destroy_flush_dependency() */ - + /*------------------------------------------------------------------------- * Function: mark_flush_dep_dirty() * @@ -5942,7 +5942,7 @@ mark_flush_dep_dirty(test_entry_t * entry_ptr) } /* end if */ } /* end mark_flush_dep_dirty() */ - + /*------------------------------------------------------------------------- * Function: mark_flush_dep_clean() * @@ -5985,31 +5985,31 @@ mark_flush_dep_clean(test_entry_t * entry_ptr) } /* end if */ } /* end mark_flush_dep_clean() */ - + /*** H5AC level utility functions ***/ - + /*------------------------------------------------------------------------- - * Function: check_and_validate_cache_hit_rate() + * Function: check_and_validate_cache_hit_rate() * - * Purpose: Use the API functions to get and reset the cache hit rate. - * Verify that the value returned by the API call agrees with - * the cache internal data structures. + * Purpose: Use the API functions to get and reset the cache hit rate. + * Verify that the value returned by the API call agrees with + * the cache internal data structures. * - * If the number of cache accesses exceeds the value provided - * in the min_accesses parameter, and the hit rate is less than - * min_hit_rate, set pass to FALSE, and set failure_mssg to - * a string indicating that hit rate was unexpectedly low. + * If the number of cache accesses exceeds the value provided + * in the min_accesses parameter, and the hit rate is less than + * min_hit_rate, set pass to FALSE, and set failure_mssg to + * a string indicating that hit rate was unexpectedly low. * - * Return hit rate in *hit_rate_ptr, and print the data to - * stdout if requested. + * Return hit rate in *hit_rate_ptr, and print the data to + * stdout if requested. * - * If an error is detected, set pass to FALSE, and set - * failure_mssg to an appropriate value. + * If an error is detected, set pass to FALSE, and set + * failure_mssg to an appropriate value. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/18/04 * *------------------------------------------------------------------------- @@ -6124,24 +6124,24 @@ check_and_validate_cache_hit_rate(hid_t file_id, } /* check_and_validate_cache_hit_rate() */ - + /*------------------------------------------------------------------------- - * Function: check_and_validate_cache_size() + * Function: check_and_validate_cache_size() * - * Purpose: Use the API function to get the cache size data. Verify - * that the values returned by the API call agree with - * the cache internal data structures. + * Purpose: Use the API function to get the cache size data. Verify + * that the values returned by the API call agree with + * the cache internal data structures. * - * Return size data in the locations specified by the pointer - * parameters if these parameters are not NULL. Print the - * data to stdout if requested. + * Return size data in the locations specified by the pointer + * parameters if these parameters are not NULL. Print the + * data to stdout if requested. * - * If an error is detected, set pass to FALSE, and set - * failure_mssg to an appropriate value. + * If an error is detected, set pass to FALSE, and set + * failure_mssg to an appropriate value. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/18/04 * *------------------------------------------------------------------------- @@ -6315,21 +6315,21 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a, return(TRUE); } - + /*------------------------------------------------------------------------- - * Function: validate_mdc_config() + * Function: validate_mdc_config() * - * Purpose: Verify that the file indicated by the file_id parameter - * has both internal and external configuration matching - * *config_ptr. + * Purpose: Verify that the file indicated by the file_id parameter + * has both internal and external configuration matching + * *config_ptr. * - * Do nothin on success. On failure, set pass to FALSE, and - * load an error message into failue_mssg. Note that - * failure_msg is assumed to be at least 128 bytes in length. + * Do nothin on success. On failure, set pass to FALSE, and + * load an error message into failue_mssg. Note that + * failure_msg is assumed to be at least 128 bytes in length. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/14/04 * *------------------------------------------------------------------------- @@ -6383,7 +6383,7 @@ validate_mdc_config(hid_t file_id, /* compare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! resize_configs_are_equal(&int_config, &cache_ptr->resize_ctl, + if ( ! resize_configs_are_equal(&int_config, &cache_ptr->resize_ctl, compare_init) ) { pass = FALSE; @@ -6434,12 +6434,12 @@ validate_mdc_config(hid_t file_id, } /* validate_mdc_config() */ - + #if 0 /* debugging functions -- normally commented out */ /*------------------------------------------------------------------------- * Function: dump_LRU * - * Purpose: Display a summarize list of the contents of the LRU + * Purpose: Display a summarize list of the contents of the LRU * from head to tail. * * Return: void @@ -6467,7 +6467,7 @@ dump_LRU(H5F_t * file_ptr) entry_ptr = cache_ptr->LRU_head_ptr; - HDfprintf(stdout, + HDfprintf(stdout, "\n\nIndex len/size/clean size/dirty size = %u/%lld/%lld/%lld\n", cache_ptr->index_len, (long long)(cache_ptr->index_size), (long long)(cache_ptr->clean_index_size), @@ -6482,17 +6482,17 @@ dump_LRU(H5F_t * file_ptr) while ( entry_ptr != NULL ) { - HDfprintf(stdout, + HDfprintf(stdout, " %3d %d %10lld 0x%010llx %s(%d)\n", - i, - (int)(entry_ptr->is_dirty), + i, + (int)(entry_ptr->is_dirty), (long long)(entry_ptr->size), (long long)(entry_ptr->addr), entry_ptr->type->name, entry_ptr->type->id); i++; entry_ptr = entry_ptr->next; - } + } if ( cache_ptr->LRU_list_len > 0 ) { diff --git a/test/cache_image.c b/test/cache_image.c index f8252ac..59689a9 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -14,8 +14,8 @@ /* Programmer: John Mainzer * 7/13/15 * - * This file contains tests specific to the cache image - * feature implemented in H5C.c + * This file contains tests specific to the cache image + * feature implemented in H5C.c */ #include "cache_common.h" #include "genall5.h" @@ -33,7 +33,7 @@ static void create_datasets(hid_t file_id, int min_dset, int max_dset); static void delete_datasets(hid_t file_id, int min_dset, int max_dset); static void open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_only, hbool_t set_mdci_fapl, hbool_t config_fsm, - hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags, + hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags, hid_t *file_id_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr); static void attempt_swmr_open_hdf5_file(hbool_t create_file, hbool_t set_mdci_fapl, const char *hdf_file_name); @@ -62,7 +62,7 @@ static unsigned cache_image_api_error_check_4(hbool_t single_file_vfd); static unsigned get_free_sections_test(hbool_t single_file_vfd); static unsigned evict_on_close_test(hbool_t single_file_vfd); - + /****************************************************************************/ /***************************** Utility Functions ****************************/ /****************************************************************************/ @@ -71,10 +71,10 @@ static unsigned evict_on_close_test(hbool_t single_file_vfd); * Function: create_datasets() * * Purpose: If pass is TRUE on entry, create the specified datasets - * in the indicated file. + * in the indicated file. * - * Datasets and their contents must be well known, as we - * will verify that they contain the expected data later. + * Datasets and their contents must be well known, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -93,8 +93,7 @@ static unsigned evict_on_close_test(hbool_t single_file_vfd); #define DSET_SIZE (40 * CHUNK_SIZE) #define MAX_NUM_DSETS 256 - -static void +static void create_datasets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "create_datasets()"; @@ -170,7 +169,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) /* create the dataset */ if ( pass ) { - sprintf(dset_name, "/dset%03d", i); + HDsprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); @@ -316,8 +315,8 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -342,7 +341,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", @@ -352,7 +351,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -362,12 +361,12 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { - fprintf(stdout, + HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -418,16 +417,16 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) } /* create_datasets() */ - + /*------------------------------------------------------------------------- * Function: delete_datasets() * - * Purpose: If pass is TRUE on entry, verify and then delete the - * dataset(s) indicated by min_dset and max_dset in the - * indicated file. + * Purpose: If pass is TRUE on entry, verify and then delete the + * dataset(s) indicated by min_dset and max_dset in the + * indicated file. * - * Datasets and their contents must be well know, as we - * will verify that they contain the expected data later. + * Datasets and their contents must be well know, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -442,7 +441,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) *------------------------------------------------------------------------- */ -static void +static void delete_datasets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "delete_datasets()"; @@ -471,13 +470,13 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) while ( ( pass ) && ( i <= max_dset ) ) { - sprintf(dset_name, "/dset%03d", i); + HDsprintf(dset_name, "/dset%03d", i); - if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { + if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { pass = FALSE; failure_mssg = "H5Ldelete() failed."; - } + } i++; } @@ -489,32 +488,32 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) } /* delete_datasets() */ - + /*------------------------------------------------------------------------- * Function: open_hdf5_file() * - * Purpose: If pass is true on entry, create or open the specified HDF5 - * and test to see if it has a metadata cache image superblock - * extension message. + * Purpose: If pass is true on entry, create or open the specified HDF5 + * and test to see if it has a metadata cache image superblock + * extension message. * - * Set pass to FALSE and issue a suitable failure - * message if either the file contains a metadata cache image - * superblock extension and mdci_sbem_expected is TRUE, or - * vise versa. + * Set pass to FALSE and issue a suitable failure + * message if either the file contains a metadata cache image + * superblock extension and mdci_sbem_expected is TRUE, or + * vise versa. * - * If mdci_sbem_expected is TRUE, also verify that the metadata - * cache has been advised of this. + * If mdci_sbem_expected is TRUE, also verify that the metadata + * cache has been advised of this. * - * If read_only is TRUE, open the file read only. Otherwise - * open the file read/write. + * If read_only is TRUE, open the file read only. Otherwise + * open the file read/write. * - * If set_mdci_fapl is TRUE, set the metadata cache image - * FAPL entry when opening the file, and verify that the - * metadata cache is notified. + * If set_mdci_fapl is TRUE, set the metadata cache image + * FAPL entry when opening the file, and verify that the + * metadata cache is notified. * - * If config_fsm is TRUE, setup the persistent free space - * manager. Note that this flag may only be set if - * create_file is also TRUE. + * If config_fsm is TRUE, setup the persistent free space + * manager. Note that this flag may only be set if + * create_file is also TRUE. * * Return pointers to the cache data structure and file data * structures. @@ -557,8 +556,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( pass ) { - /* opening the file both read only and with a cache image - * requested is a contradiction. We resolve it by ignoring + /* opening the file both read only and with a cache image + * requested is a contradiction. We resolve it by ignoring * the cache image request silently. */ if ( ( create_file && mdci_sbem_expected ) || @@ -601,7 +600,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; @@ -626,7 +625,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( cache_image_config.generate_image != FALSE ) || ( cache_image_config.save_resize_status != FALSE ) || - ( cache_image_config.entry_ageout != + ( cache_image_config.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ) { pass = FALSE; @@ -658,17 +657,17 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, /* setup the persistent free space manager if indicated */ if ( ( pass ) && ( config_fsm ) ) { - fcpl_id = H5Pcreate(H5P_FILE_CREATE); + fcpl_id = H5Pcreate(H5P_FILE_CREATE); - if ( fcpl_id <= 0 ) { + if ( fcpl_id <= 0 ) { - pass = FALSE; - failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; - } + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; + } } if ( ( pass ) && ( config_fsm ) ) { - if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, + if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) { pass = FALSE; failure_mssg = "H5Pset_file_space_strategy() failed."; @@ -694,13 +693,13 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( create_file ) { - if ( fcpl_id != -1 ) + if ( fcpl_id != -1 ) - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, fcpl_id, fapl_id); - else + else - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); } else { @@ -780,26 +779,26 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( set_mdci_fapl ) { - if ( read_only ) { + if ( read_only ) { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { pass = FALSE; failure_mssg = "Unexpected image_ctl values(1).\n"; } - } else { + } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != TRUE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -809,11 +808,11 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, } } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -864,15 +863,15 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, pass = FALSE; failure_mssg = "mdci sb extension message not present?\n"; } - } + } } else { - if ( ( cache_ptr->load_image == TRUE ) || + if ( ( cache_ptr->load_image == TRUE ) || ( cache_ptr->delete_image == TRUE ) ) { pass = FALSE; failure_mssg = "mdci sb extension message present?\n"; - } + } } } @@ -892,12 +891,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, } /* open_hdf5_file() */ - + /*------------------------------------------------------------------------- * Function: attempt_swmr_open_hdf5_file() * - * Purpose: If pass is true on entry, attempt to create or open the - * specified HDF5 file with SWMR, and also with cache image + * Purpose: If pass is true on entry, attempt to create or open the + * specified HDF5 file with SWMR, and also with cache image * creation if requested. * * In all cases, the attempted open or create should fail. @@ -914,8 +913,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, static void attempt_swmr_open_hdf5_file(const hbool_t create_file, - const hbool_t set_mdci_fapl, - const char * hdf_file_name) + const hbool_t set_mdci_fapl, + const char * hdf_file_name) { const char * fcn_name = "attempt_swmr_open_hdf5_file()"; hbool_t show_progress = FALSE; @@ -946,7 +945,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; @@ -981,8 +980,8 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, if ( create_file ) { H5E_BEGIN_TRY { - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, - H5P_DEFAULT, fapl_id); + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, + H5P_DEFAULT, fapl_id); } H5E_END_TRY; } else { @@ -996,7 +995,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, pass = FALSE; failure_mssg = "SWMR H5Fcreate() or H5Fopen() succeeded.\n"; - } + } } if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); @@ -1005,17 +1004,17 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, } /* attempt_swmr_open_hdf5_file() */ - + /*------------------------------------------------------------------------- * Function: verify_datasets() * - * Purpose: If pass is TRUE on entry, verify that the datasets in the - * file exist and contain the expected data. + * Purpose: If pass is TRUE on entry, verify that the datasets in the + * file exist and contain the expected data. * - * Note that these datasets were created by - * create_datasets() above. Thus any changes in that - * function must be reflected in this function, and - * vise-versa. + * Note that these datasets were created by + * create_datasets() above. Thus any changes in that + * function must be reflected in this function, and + * vise-versa. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -1030,7 +1029,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, *------------------------------------------------------------------------- */ -static void +static void verify_datasets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "verify_datasets()"; @@ -1066,7 +1065,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) /* open the dataset */ if ( pass ) { - sprintf(dset_name, "/dset%03d", i); + HDsprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dopen2(file_id, dset_name, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { @@ -1158,8 +1157,8 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -1184,8 +1183,8 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { - + if ( verbose ) { + HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", k, l, data_chunk[k][l], @@ -1194,7 +1193,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -1204,12 +1203,12 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { - fprintf(stdout, + HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -1260,7 +1259,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) } /* verify_datasets() */ - + /****************************************************************************/ /******************************* Test Functions *****************************/ /****************************************************************************/ @@ -1269,60 +1268,60 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) * Function: check_cache_image_ctl_flow_1() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with cache image FAPL entry set - * and insertion of metadata cache image superblock - * message on file close. + * i) Creation of file with cache image FAPL entry set + * and insertion of metadata cache image superblock + * message on file close. * - * ii) Open of file with metadata cache image superblock - * message, transmission of message to metadata cache, - * and deletion of superblock message prior to close. + * ii) Open of file with metadata cache image superblock + * message, transmission of message to metadata cache, + * and deletion of superblock message prior to close. * - * Note that in all cases we are performing operations on the - * file. While this is the typical case, we must repeat this - * test without operations on the file. + * Note that in all cases we are performing operations on the + * file. While this is the typical case, we must repeat this + * test without operations on the file. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that the metadata cache image superblock - * extension message has been deleted. + * Verify that the metadata cache image superblock + * extension message has been deleted. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 8) Close the file. + * 8) Close the file. * - * 9) Delete the file. + * 9) Delete the file. * * Return: void * @@ -1354,7 +1353,7 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1369,16 +1368,16 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block - * extension message only. + * Set flags forcing creation of metadata cache image super block + * extension message only. */ if ( pass ) { @@ -1387,8 +1386,8 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1396,10 +1395,10 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -1407,10 +1406,10 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) create_datasets(file_id, 0, 5); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -1423,26 +1422,26 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 4) Open the file. + + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the - * metadata cache image, and that the supplied address and length - * are HADDR_UNDEF and zero respectively. Note that these values + * Verify that the metadata cache is instructed to load the + * metadata cache image, and that the supplied address and length + * are HADDR_UNDEF and zero respectively. Note that these values * indicate that the metadata image block doesn't exist. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1450,13 +1449,13 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -1472,9 +1471,9 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) */ } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -1487,24 +1486,24 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1512,9 +1511,9 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 8) Close the file. */ @@ -1527,9 +1526,9 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Delete the file */ @@ -1552,63 +1551,63 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } /* check_cache_image_ctl_flow_1() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_2() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with cache image FAPL entry set - * and insertion of metadata cache image superblock - * message on file close. + * i) Creation of file with cache image FAPL entry set + * and insertion of metadata cache image superblock + * message on file close. * - * ii) Open of file with metadata cache image superblock - * message, transmission of message to metadata cache, - * and deletion of superblock message prior to close. + * ii) Open of file with metadata cache image superblock + * message, transmission of message to metadata cache, + * and deletion of superblock message prior to close. * - * Note that unlike the previous test, no operations are performed - * on the file. As a result of this, the metadata cache image - * message is not processed until the metadata cache receives - * the file close warning. (Under normal circumstances, it is - * processed as part of the first protect operation after the - * superblock is loaded.) + * Note that unlike the previous test, no operations are performed + * on the file. As a result of this, the metadata cache image + * message is not processed until the metadata cache receives + * the file close warning. (Under normal circumstances, it is + * processed as part of the first protect operation after the + * superblock is loaded.) * - * In this particular test, we preform the following operations: + * In this particular test, we preform the following operations: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file. + * 3) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 8) Close the file. + * 8) Close the file. * - * 9) Delete the file. + * 9) Delete the file. * * Return: void * @@ -1640,7 +1639,7 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the file name */ @@ -1654,16 +1653,16 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block - * extension message only. + * Set flags forcing creation of metadata cache image super block + * extension message only. */ if ( pass ) { @@ -1672,8 +1671,8 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1681,10 +1680,10 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ if ( pass ) { @@ -1697,26 +1696,26 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 3) Open the file. + + + /* 3) Open the file. * - * Verify that the metadata cache is instructed to load the - * metadata cache image, and that the supplied address and length - * are HADDR_UNDEF and zero respectively. Note that these values + * Verify that the metadata cache is instructed to load the + * metadata cache image, and that the supplied address and length + * are HADDR_UNDEF and zero respectively. Note that these values * indicate that the metadata image block doesn't exist. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1724,10 +1723,10 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Close the file. */ if ( pass ) { @@ -1739,24 +1738,24 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 5) Open the file. + + + /* 5) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1764,9 +1763,9 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -1779,9 +1778,9 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Delete the file */ @@ -1804,81 +1803,81 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } /* check_cache_image_ctl_flow_2() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_3() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objectives of this test are to: + * The objectives of this test are to: * - * i) Test operation of the metadata cache image FAPL - * entry set on open of an existing file. This - * should result in the insertion of a metadata - * cache image superblock message on file close. + * i) Test operation of the metadata cache image FAPL + * entry set on open of an existing file. This + * should result in the insertion of a metadata + * cache image superblock message on file close. * - * ii) Test operation of the metadata cache image super - * block extension message when it appears in a file - * that is opened READ ONLY. + * ii) Test operation of the metadata cache image super + * block extension message when it appears in a file + * that is opened READ ONLY. * - * Note that in all cases we are performing operations on the - * file between file open and close. While this is the - * typical case, we must repeat this test without operations - * on the file. + * Note that in all cases we are performing operations on the + * file between file open and close. While this is the + * typical case, we must repeat this test without operations + * on the file. * - * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image - * FAPL entry. + * Verify that the cache is NOT informed of the cache image + * FAPL entry. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file WITH the cache image FAPL entry. + * 3) Open the file WITH the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 4) Create some datasets. + * 4) Create some datasets. * - * 5) Close the file. + * 5) Close the file. * - * 6) Open the file READ ONLY. + * 6) Open the file READ ONLY. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 7) Verify the contents of the datasets. + * 7) Verify the contents of the datasets. * - * 8) Close the file. + * 8) Close the file. * - * 9) Open the file READ/WRITE. + * 9) Open the file READ/WRITE. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 10) Verify the contents of the datasets. + * 10) Verify the contents of the datasets. * - * 11) Close the file. + * 11) Close the file. * - * 12) Open the file + * 12) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 13) Close the file. + * 13) Close the file. * - * 14) Delete the file. + * 14) Delete the file. * * Return: void * @@ -1926,10 +1925,10 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + + /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image + * Verify that the cache is NOT informed of the cache image * FAPL entry. */ @@ -1939,8 +1938,8 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1951,7 +1950,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ if ( pass ) { @@ -1965,13 +1964,13 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 3) Open the file WITH the cache image FAPL entry. + + + /* 3) Open the file WITH the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block + * Set flags forcing creation of metadata cache image super block * extension message only. */ @@ -1981,8 +1980,8 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2018,13 +2017,13 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Open the file READ ONLY. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2032,11 +2031,11 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2046,7 +2045,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Verify the contents of the datasets. */ @@ -2072,13 +2071,13 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Open the file READ/WRITE. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2086,11 +2085,11 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2112,7 +2111,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Close the file. */ if ( pass ) { @@ -2127,21 +2126,21 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 12 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2167,7 +2166,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) if ( show_progress ) /* 14 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Delete the file. */ if ( pass ) { @@ -2190,73 +2189,73 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) } /* check_cache_image_ctl_flow_3() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_4() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objectives of this test are to: + * The objectives of this test are to: * - * i) Test operation of the metadata cache image FAPL - * entry set on open of an existing file. This - * should result in the insertion of a metadata - * cache image superblock message on file close. + * i) Test operation of the metadata cache image FAPL + * entry set on open of an existing file. This + * should result in the insertion of a metadata + * cache image superblock message on file close. * - * ii) Test operation of the metadata cache image super - * block extension message when it appears in a file - * that is opened READ ONLY. + * ii) Test operation of the metadata cache image super + * block extension message when it appears in a file + * that is opened READ ONLY. * - * In this test we avoid all file access beyond file open - * and close. + * In this test we avoid all file access beyond file open + * and close. * - * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image - * FAPL entry. + * Verify that the cache is NOT informed of the cache image + * FAPL entry. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file WITH the cache image FAPL entry. + * 3) Open the file WITH the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file READ ONLY. + * 5) Open the file READ ONLY. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file READ/WRITE. + * 7) Open the file READ/WRITE. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 8) Close the file. + * 8) Close the file. * - * 9) Open the file + * 9) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 10) Close the file. + * 10) Close the file. * - * 11) Delete the file. + * 11) Delete the file. * * Return: void * @@ -2304,10 +2303,10 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + + /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image + * Verify that the cache is NOT informed of the cache image * FAPL entry. */ @@ -2317,8 +2316,8 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2329,7 +2328,7 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ if ( pass ) { @@ -2343,13 +2342,13 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 3) Open the file WITH the cache image FAPL entry. + + + /* 3) Open the file WITH the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block + * Set flags forcing creation of metadata cache image super block * extension message only. */ @@ -2359,8 +2358,8 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2385,13 +2384,13 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 5) Open the file READ ONLY. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2399,11 +2398,11 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2413,7 +2412,7 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -2428,13 +2427,13 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Open the file READ/WRITE. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2442,11 +2441,11 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2472,21 +2471,21 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2512,7 +2511,7 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Delete the file. */ if ( pass ) { @@ -2535,66 +2534,66 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) } /* check_cache_image_ctl_flow_4() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_5() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objective of this test is verify correct control flow - * when a file with a metadata cache image superblock extension - * message is opened with the metadata cache image FAPL entry. + * The objective of this test is verify correct control flow + * when a file with a metadata cache image superblock extension + * message is opened with the metadata cache image FAPL entry. * - * Note that in all cases we are performing operations on the - * file between file open and close. While this is the - * typical case, we must repeat this test without operations - * on the file. + * Note that in all cases we are performing operations on the + * file between file open and close. While this is the + * typical case, we must repeat this test without operations + * on the file. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Create some datasets. + * 2) Create some datasets. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file WITH the cache image FAPL entry. + * 4) Open the file WITH the cache image FAPL entry. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 5) Verify the contents of the datasets. + * 5) Verify the contents of the datasets. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 8) Verify the contents of the datasets. + * 8) Verify the contents of the datasets. * - * 9) Close the file. + * 9) Close the file. * - * 10) Delete the file. + * 10) Delete the file. * * Return: void * @@ -2643,12 +2642,12 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file with the cache image FAPL entry. + + /* 1) Create a HDF5 file with the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ @@ -2658,8 +2657,8 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2669,7 +2668,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets. */ @@ -2681,7 +2680,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Close the file. */ if ( pass ) { @@ -2696,30 +2695,30 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 4) Open the file WITH the cache image FAPL entry. + + /* 4) Open the file WITH the cache image FAPL entry. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image + * Verify that the cache is informed of the cache image * FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2740,7 +2739,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -2755,12 +2754,12 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 7) Open the file. + + /* 7) Open the file. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2768,11 +2767,11 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2792,8 +2791,8 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 9) Close the file. */ if ( pass ) { @@ -2808,7 +2807,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Delete the file. */ if ( pass ) { @@ -2831,58 +2830,58 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) } /* check_cache_image_ctl_flow_5() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_6() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objective of this test is verify correct control flow - * when a file with a metadata cache image superblock extension - * message is opened with the metadata cache image FAPL entry. + * The objective of this test is verify correct control flow + * when a file with a metadata cache image superblock extension + * message is opened with the metadata cache image FAPL entry. * - * In this test we avoid all file activity other than open - * and close. + * In this test we avoid all file activity other than open + * and close. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file WITH the cache image FAPL entry. + * 3) Open the file WITH the cache image FAPL entry. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file. + * 5) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 6) Close the file. + * 6) Close the file. * - * 7) Delete the file. + * 7) Delete the file. * * Return: void * @@ -2931,12 +2930,12 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file with the cache image FAPL entry. + + /* 1) Create a HDF5 file with the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ @@ -2946,8 +2945,8 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2957,7 +2956,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ @@ -2973,30 +2972,30 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 4) Open the file WITH the cache image FAPL entry. + + /* 4) Open the file WITH the cache image FAPL entry. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image + * Verify that the cache is informed of the cache image * FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -3007,7 +3006,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 5) Close the file. */ if ( pass ) { @@ -3022,12 +3021,12 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 5) Open the file. + + /* 5) Open the file. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -3035,11 +3034,11 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3050,7 +3049,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -3065,7 +3064,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Delete the file. */ if ( pass ) { @@ -3088,93 +3087,93 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) } /* check_cache_image_ctl_flow_6() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_1() * * Purpose: This test is one of a sequence of tests intended - * to exercise the cache image feature verifying that it - * works more or less correctly in common cases. + * to exercise the cache image feature verifying that it + * works more or less correctly in common cases. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with metadata cache image - * superblock extension message and cache image - * block. + * i) Creation of file with metadata cache image + * superblock extension message and cache image + * block. * - * ii) Open of file with metadata cache image superblock - * extension message and cache image block. - * Deserialization and removal of both, insertion - * of prefetched cache entries, and deserialization - * of prefetched cache entries as they are protected. + * ii) Open of file with metadata cache image superblock + * extension message and cache image block. + * Deserialization and removal of both, insertion + * of prefetched cache entries, and deserialization + * of prefetched cache entries as they are protected. * - * iii) Subsequent write of file without metadata cache - * image. + * iii) Subsequent write of file without metadata cache + * image. * - * iv) Open and close of file with metadata cache image - * image requested, but with no operations on the - * file. + * iv) Open and close of file with metadata cache image + * image requested, but with no operations on the + * file. * - * To do this: + * To do this: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image. + * Verify that the metadata cache is instructed + * to load the metadata cache image. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that it contains the expected data + * Verify that it contains the expected data * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 8) Open a dataset. + * 8) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file with the cache image FAPL entry. + * 10) Open the file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 11) Close the file. Since there has been no access to - * any entries that would be included in the cache image, - * there should be no cache image. + * 11) Close the file. Since there has been no access to + * any entries that would be included in the cache image, + * there should be no cache image. * - * 12) Open the file. + * 12) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 13) Open a dataset. + * 13) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 14) Close the file. + * 14) Close the file. * - * 15) Delete the file. + * 15) Delete the file. * * Return: void * @@ -3206,7 +3205,7 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3221,13 +3220,13 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -3238,8 +3237,8 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3247,10 +3246,10 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -3271,10 +3270,10 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -3287,26 +3286,26 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 4) Open the file. + + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the - * metadata cache image, and that the supplied address and length - * are HADDR_UNDEF and zero respectively. Note that these values + * Verify that the metadata cache is instructed to load the + * metadata cache image, and that the supplied address and length + * are HADDR_UNDEF and zero respectively. Note that these values * indicate that the metadata image block doesn't exist. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3314,13 +3313,13 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -3340,9 +3339,9 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -3355,24 +3354,24 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3380,13 +3379,13 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -3407,7 +3406,7 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3422,24 +3421,24 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3447,13 +3446,13 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 11) Close the file. Since there has been no access to - * any entries that would be included in the cache image, - * there should be no cache image. + + /* 11) Close the file. Since there has been no access to + * any entries that would be included in the cache image, + * there should be no cache image. */ if ( pass ) { @@ -3465,24 +3464,24 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3490,13 +3489,13 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. */ if ( pass ) { @@ -3516,10 +3515,10 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Close the file. */ if ( pass ) { @@ -3531,9 +3530,9 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 15) Delete the file */ @@ -3556,55 +3555,55 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } /* cache_image_smoke_check_1() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_2() * * Purpose: This test is one of a sequence of tests intended - * to exercise the cache image feature verifying that it - * works more or less correctly in common cases. + * to exercise the cache image feature verifying that it + * works more or less correctly in common cases. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with metadata cache image - * superblock extension message and cache image - * block. + * i) Creation of file with metadata cache image + * superblock extension message and cache image + * block. * - * ii) Open of file with metadata cache image superblock - * extension message and cache image block. Write - * of prefetched entries to file on file close. + * ii) Open of file with metadata cache image superblock + * extension message and cache image block. Write + * of prefetched entries to file on file close. * - * To do this: + * To do this: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * 5) Close the file. + * 5) Close the file. * - * 6) Open the file. + * 6) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 7) Open a dataset. + * 7) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 8) Close the file. + * 8) Close the file. * - * 9) Delete the file. + * 9) Delete the file. * * Return: void * @@ -3636,7 +3635,7 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3651,13 +3650,13 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -3668,8 +3667,8 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3677,10 +3676,10 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -3700,10 +3699,10 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -3716,23 +3715,23 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 4) Open the file. + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3741,15 +3740,15 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } /* can't verify that metadata cache image has been loaded directly, - * as in this cache, the load will not happen until close, and thus - * the images_created stat will not be readily available as it is + * as in this cache, the load will not happen until close, and thus + * the images_created stat will not be readily available as it is * incremented just before the cache is shut down. */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Close the file. */ if ( pass ) { @@ -3761,24 +3760,24 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 6) Open the file. + + + /* 6) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3786,13 +3785,13 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 7) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -3801,7 +3800,7 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) verify_datasets(file_id, 0, 5); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3816,9 +3815,9 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Delete the file */ @@ -3841,77 +3840,77 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } /* cache_image_smoke_check_2() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_3() * * Purpose: This test is one of a sequence of tests intended - * to exercise the cache image feature verifying that it - * works more or less correctly in common cases. + * to exercise the cache image feature verifying that it + * works more or less correctly in common cases. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with metadata cache image - * superblock extension message and cache image - * block. + * i) Creation of file with metadata cache image + * superblock extension message and cache image + * block. * - * ii) Read only open and close of file with metadata - * cache image superblock extension message and - * cache image block. + * ii) Read only open and close of file with metadata + * cache image superblock extension message and + * cache image block. * - * iii) Subsequent R/W open and close of file with metadata - * cache image superblock extension message and + * iii) Subsequent R/W open and close of file with metadata + * cache image superblock extension message and * cache image block. * - * To do this: + * To do this: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file read only. + * 4) Open the file read only. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 5 Open a dataset. + * 5 Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 8 Open a dataset. + * 8 Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file. + * 10) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 11) Open a dataset. + * 11) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 12) Close the file. + * 12) Close the file. * - * 13) Delete the file. + * 13) Delete the file. * * Return: void * @@ -3943,7 +3942,7 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3958,13 +3957,13 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -3975,8 +3974,8 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3984,10 +3983,10 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -4006,10 +4005,10 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -4022,24 +4021,24 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 4) Open the file read only. + + + /* 4) Open the file read only. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4047,13 +4046,13 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4073,10 +4072,10 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -4088,24 +4087,24 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4113,13 +4112,13 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4140,7 +4139,7 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4154,22 +4153,22 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 10) Open the file. + + + /* 10) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4177,13 +4176,13 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 11) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4204,7 +4203,7 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4219,9 +4218,9 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Delete the file */ @@ -4244,66 +4243,66 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } /* cache_image_smoke_check_3() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_4() * - * Purpose: This test attempts to mimic the typical "poor man's - * parallel use case in which the file is passed between - * processes, each of which open the file, write some data, - * close the file, and then pass control on to the next - * process. + * Purpose: This test attempts to mimic the typical "poor man's + * parallel use case in which the file is passed between + * processes, each of which open the file, write some data, + * close the file, and then pass control on to the next + * process. * - * In this case, we only write one dataset per process. + * In this case, we only write one dataset per process. * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create and write a dataset in the file. + * 2) Create and write a dataset in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file with the cache image FAPL entry. + * 4) Open the file with the cache image FAPL entry. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 5 Create and write a new dataset + * 5 Create and write a new dataset * - * 6) Close the file. + * 6) Close the file. * - * If sufficient datasets have been created, continue to + * If sufficient datasets have been created, continue to * 7). Otherwise goto 4) * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 8) Open all datasets that have been created, and - * verify that they contain the expected data. + * 8) Open all datasets that have been created, and + * verify that they contain the expected data. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file. + * 10) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 11) Open all datasets that have been created, and + * 11) Open all datasets that have been created, and * verify that they contain the expected data. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 12) Close the file. + * 12) Close the file. * - * 13) Delete the file. + * 13) Delete the file. * * Return: void * @@ -4337,7 +4336,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4352,13 +4351,13 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -4369,8 +4368,8 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4378,10 +4377,10 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create a dataset in the file. */ if ( pass ) { @@ -4400,10 +4399,10 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -4416,26 +4415,26 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); while ( ( pass ) && ( max_dset < MAX_NUM_DSETS ) ) { - - /* 4) Open the file. + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4443,11 +4442,11 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) - HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp, max_dset, pass); - + /* 5) Create a dataset in the file. */ if ( pass ) { @@ -4466,11 +4465,11 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) - HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 1, max_dset, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -4483,28 +4482,27 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) - HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 2, max_dset, pass); - } /* end while */ cp += 3; - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4512,13 +4510,13 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close all datasets. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4539,7 +4537,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4553,22 +4551,22 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 10) Open the file. + + + /* 10) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4576,13 +4574,13 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 11) Open and close all datasets. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4603,7 +4601,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4618,7 +4616,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 13) Delete the file */ @@ -4641,79 +4639,79 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) return !pass; } /* cache_image_smoke_check_4() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_5() * - * Purpose: This test attempts to mimic the typical "poor man's - * parallel use case in which the file is passed between - * processes, each of which open the file, write some data, - * close the file, and then pass control on to the next - * process. + * Purpose: This test attempts to mimic the typical "poor man's + * parallel use case in which the file is passed between + * processes, each of which open the file, write some data, + * close the file, and then pass control on to the next + * process. * - * In this case, we create one group for each process, and - * populate it with a "zoo" of HDF5 objects selected to - * (ideally) exercise all HDF5 on disk data structures. + * In this case, we create one group for each process, and + * populate it with a "zoo" of HDF5 objects selected to + * (ideally) exercise all HDF5 on disk data structures. * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create a process specific group. + * 2) Create a process specific group. * - * 3) Construct a "zoo" in the above group, and validate it. + * 3) Construct a "zoo" in the above group, and validate it. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file with the cache image FAPL entry. + * 5) Open the file with the cache image FAPL entry. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 6) Validate the "zoo" created in the previous file open. + * 6) Validate the "zoo" created in the previous file open. * - * 7) Create a process specific group for this file open + * 7) Create a process specific group for this file open * - * 8) Construct a "zoo" in the above group, and validate it. - * - * 9) Close the file. + * 8) Construct a "zoo" in the above group, and validate it. * - * If sufficient zoos have been created, continue to + * 9) Close the file. + * + * If sufficient zoos have been created, continue to * 10). Otherwise goto 5) * - * 10) Open the file R/O. + * 10) Open the file R/O. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 11) Validate all the zoos. + * 11) Validate all the zoos. * - * 12) Close the file. + * 12) Close the file. * - * 13) Open the file. + * 13) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 14) Validate all the zoos. + * 14) Validate all the zoos. * - * 15) Close the file. + * 15) Close the file. * - * 16) Open the file. + * 16) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 17) Validate all the zoos. + * 17) Validate all the zoos. * - * 18) Close the file. + * 18) Close the file. * - * 19) Delete the file. + * 19) Delete the file. * * Return: void * @@ -4752,7 +4750,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4771,13 +4769,13 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) H5Pclose(fapl_id); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -4788,8 +4786,8 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4797,31 +4795,31 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 2) Create a process specific group. */ if ( pass ) { - sprintf(process_group_name, "/process_%d", min_group); + HDsprintf(process_group_name, "/process_%d", min_group); - proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, + proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( proc_gid < 0 ) { - pass = FALSE; - failure_mssg = "H5Gcreate2() failed (1).\n"; + pass = FALSE; + failure_mssg = "H5Gcreate2() failed (1).\n"; } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 3) Construct a "zoo" in the above group, and validate it. */ - if ( pass ) + if ( pass ) create_zoo(file_id, process_group_name, min_group); #if H5C_COLLECT_CACHE_STATS @@ -4835,16 +4833,16 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Close the file. */ if ( pass ) { - if ( H5Gclose(proc_gid) < 0 ) { - + if ( H5Gclose(proc_gid) < 0 ) { + pass = FALSE; failure_mssg = "H5Gclose(proc_gid) failed. (1)"; } @@ -4860,26 +4858,26 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); while ( ( pass ) && ( max_group < MAX_NUM_GROUPS ) ) { - - /* 5) Open the file. + + /* 5) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4887,13 +4885,13 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) - HDfprintf(stdout, "%s:L1 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L1 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp, max_group, pass); /* 6) Validate the "zoo" created in the previous file open. */ - if ( pass ) + if ( pass ) validate_zoo(file_id, process_group_name, max_group); #if H5C_COLLECT_CACHE_STATS @@ -4907,47 +4905,47 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) - HDfprintf(stdout, "%s:L2 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L2 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 1, max_group, pass); - /* 7) Create a process specific group for this file open */ + /* 7) Create a process specific group for this file open */ if ( pass ) { - max_group++; - sprintf(process_group_name, "/process_%d", max_group); + max_group++; + HDsprintf(process_group_name, "/process_%d", max_group); - proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, + proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( proc_gid < 0 ) { - pass = FALSE; - failure_mssg = "H5Gcreate2() failed (2).\n"; + pass = FALSE; + failure_mssg = "H5Gcreate2() failed (2).\n"; } } - if ( show_progress ) - HDfprintf(stdout, "%s:L3 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L3 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 2, max_group, pass); - - /* 8) Construct a "zoo" in the above group, and validate it. */ - if ( pass ) + + /* 8) Construct a "zoo" in the above group, and validate it. */ + if ( pass ) create_zoo(file_id, process_group_name, max_group); - if ( show_progress ) - HDfprintf(stdout, "%s:L4 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L4 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 3, max_group, pass); - + /* 9) Close the file. */ if ( pass ) { - if ( H5Gclose(proc_gid) < 0 ) { - + if ( H5Gclose(proc_gid) < 0 ) { + pass = FALSE; failure_mssg = "H5Gclose(process_gid) failed. (2)"; } @@ -4963,24 +4961,24 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } } - if ( show_progress ) - HDfprintf(stdout, "%s:L5 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L5 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 4, max_group, pass); } /* end while */ cp += 5; - - /* 10) Open the file read only. + + /* 10) Open the file read only. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if(pass) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4995,10 +4993,10 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* 11) Validate all the zoos. */ i = min_group; while(pass && i <= max_group) { - sprintf(process_group_name, "/process_%d", i); + HDsprintf(process_group_name, "/process_%d", i); validate_zoo(file_id, process_group_name, i++); } - + #if H5C_COLLECT_CACHE_STATS if( pass) { if(cache_ptr->images_loaded == 0) { @@ -5019,20 +5017,20 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } } - /* 13) Open the file R/W. + /* 13) Open the file R/W. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5040,7 +5038,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5048,10 +5046,10 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) i = min_group; while ( ( pass ) && ( i <= max_group ) ) { - sprintf(process_group_name, "/process_%d", i); + HDsprintf(process_group_name, "/process_%d", i); validate_zoo(file_id, process_group_name, i++); } - + #if H5C_COLLECT_CACHE_STATS if ( pass ) { @@ -5064,7 +5062,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5078,22 +5076,22 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 16) Open the file. + + + /* 16) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5101,21 +5099,21 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 17) Validate all the zoos. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ i = min_group; - while ( ( pass ) && ( i <= max_group ) ) { - sprintf(process_group_name, "/process_%d", i); + while ( ( pass ) && ( i <= max_group ) ) { + HDsprintf(process_group_name, "/process_%d", i); validate_zoo(file_id, process_group_name, i++); } - + #if H5C_COLLECT_CACHE_STATS if ( pass ) { @@ -5128,7 +5126,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5143,9 +5141,9 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 19) Delete the file */ @@ -5169,78 +5167,78 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } /* cache_image_smoke_check_5() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_6() * * Purpose: As the free space manager metadata is now included in the - * cache image, a smoke check to verify generally correct - * behaviour of the persistent free space managers seems - * prudent. + * cache image, a smoke check to verify generally correct + * behaviour of the persistent free space managers seems + * prudent. * - * The basic idea of this test is to construct a long - * sequence of dataset creations and deletions, all separated - * by file open/close cycles with cache image enabled. If the - * perisistant free space managers are performing as expected, - * the size of the file should stabilize. + * The basic idea of this test is to construct a long + * sequence of dataset creations and deletions, all separated + * by file open/close cycles with cache image enabled. If the + * perisistant free space managers are performing as expected, + * the size of the file should stabilize. * - * To implement this, proceed as outlined in the cycle of - * operation below: + * To implement this, proceed as outlined in the cycle of + * operation below: * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create and write a dataset in the file. + * 2) Create and write a dataset in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file with the cache image FAPL entry. + * 4) Open the file with the cache image FAPL entry. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 5) Create and write a new dataset. + * 5) Create and write a new dataset. * - * 6) Verify and delete the old dataset. + * 6) Verify and delete the old dataset. * - * 7) Close the file. + * 7) Close the file. * - * If sufficient datasets have been created, and then - * deleteded continue to 8). Otherwise goto 4) + * If sufficient datasets have been created, and then + * deleteded continue to 8). Otherwise goto 4) * - * 8) Open the file. + * 8) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 9) Verify the last dataset created. + * 9) Verify the last dataset created. * - * 10) Close the file. + * 10) Close the file. * - * 11) Open the file. + * 11) Open the file. * - * 12) Verify and delete the last dataset. + * 12) Verify and delete the last dataset. * - * Verify that a metadata cache image is not loaded. + * Verify that a metadata cache image is not loaded. * - * 13) Close the file. + * 13) Close the file. * - * 14) Get the size of the file. Verify that it is less - * than 20 KB. Without deletions and persistent free - * space managers, size size is about 167 MB, so this - * is sufficient to verify that the persistent free - * space managers are more or less doing their job. + * 14) Get the size of the file. Verify that it is less + * than 20 KB. Without deletions and persistent free + * space managers, size size is about 167 MB, so this + * is sufficient to verify that the persistent free + * space managers are more or less doing their job. * * Note that in the absence of paged allocation, file * size gets below 1 KB. * - * 15) Delete the file. + * 15) Delete the file. * * Return: void * @@ -5275,7 +5273,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5290,13 +5288,13 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -5307,8 +5305,8 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5316,10 +5314,10 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create a dataset in the file. */ if ( pass ) { @@ -5338,10 +5336,10 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -5354,26 +5352,26 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); while ( ( pass ) && ( max_dset < MAX_NUM_DSETS ) ) { - - /* 4) Open the file. + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5381,11 +5379,11 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) - HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp, max_dset, pass); - + /* 5) Create a dataset in the file. */ if ( pass ) { @@ -5404,22 +5402,22 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) - HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 1, max_dset, pass); - /* 6) Verify and delete the old dataset. */ - if ( pass ) { + /* 6) Verify and delete the old dataset. */ + if ( pass ) { - delete_datasets(file_id, min_dset - 2, max_dset - 2); - } + delete_datasets(file_id, min_dset - 2, max_dset - 2); + } - if ( show_progress ) - HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 2, max_dset, pass); - + /* 7) Close the file. */ if ( pass ) { @@ -5432,27 +5430,27 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } } - if ( show_progress ) - HDfprintf(stdout, "%s:L4 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L4 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 3, max_dset, pass); } /* end while */ cp += 4; - - - /* 8) Open the file. + + + /* 8) Open the file. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5460,10 +5458,10 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 9) Verify the last dataset created. */ if ( pass ) { @@ -5483,7 +5481,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5497,22 +5495,22 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 11) Open the file. + + + /* 11) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5520,13 +5518,13 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 12) Verify and delete the last dataset. * - * Verify that a metadata cache image is not loaded. + * Verify that a metadata cache image is not loaded. */ if ( pass ) { @@ -5545,7 +5543,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - + /* 13) Close the file. */ @@ -5558,7 +5556,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5569,7 +5567,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) * space managers are more or less doing their job. * * Note that in the absence of paged allocation, file - * size gets below 1 KB, but since this test is run both + * size gets below 1 KB, but since this test is run both * with and without paged allocation, we must leave some * extra space for the paged allocation case. */ @@ -5583,9 +5581,9 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 15) Delete the file */ if ( pass ) { @@ -5608,56 +5606,56 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } /* cache_image_smoke_check_6() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_1() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * The object of this test is to verify that a file without - * a pre-existing cache image that is opened both read only - * and with a cache image requested is handle correctly - * (the cache image request should be ignored silently). + * The object of this test is to verify that a file without + * a pre-existing cache image that is opened both read only + * and with a cache image requested is handle correctly + * (the cache image request should be ignored silently). * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file. + * 1) Create a HDF5 file. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file read only with a cache image FAPL entry - * requested. + * 4) Open the file read only with a cache image FAPL entry + * requested. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that it contains the expected data + * Verify that it contains the expected data * - * Verify that the cache image was not loaded. + * Verify that the cache image was not loaded. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file read only. + * 7) Open the file read only. * - * 8) Open a dataset. + * 8) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was not loaded. + * Verify that the cache image was not loaded. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file read write. + * 10) Open the file read write. * - * 11) Open a dataset. + * 11) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 12) Close the file. + * 12) Close the file. * - * 13) Delete the file. + * 13) Delete the file. * * Return: void * @@ -5689,7 +5687,7 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5704,7 +5702,7 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5716,8 +5714,8 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5725,10 +5723,10 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -5749,10 +5747,10 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -5765,20 +5763,20 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Open the file read only with a cache image FAPL entry requested. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ TRUE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5786,10 +5784,10 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * * Verify that it contains the expected data. @@ -5813,9 +5811,9 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -5828,20 +5826,20 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 7) Open the file read only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5849,10 +5847,10 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * * Verify that it contains the expected data. @@ -5877,7 +5875,7 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5892,20 +5890,20 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file read / write. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5913,9 +5911,9 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open and close a dataset. * * Verify that it contains the expected data. @@ -5939,9 +5937,9 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Close the file. */ @@ -5954,9 +5952,9 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Delete the file */ @@ -5979,68 +5977,68 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } /* cache_image_api_error_check_1() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_2() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * The object of this test is to verify that a file with - * a pre-existing cache image that is opened both read only - * and with a cache image requested is handled correctly - * (the cache image request should be ignored silently). + * The object of this test is to verify that a file with + * a pre-existing cache image that is opened both read only + * and with a cache image requested is handled correctly + * (the cache image request should be ignored silently). * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file with a cache image requested.. + * 1) Create a HDF5 file with a cache image requested.. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file read only with a cache image FAPL entry - * requested. + * 4) Open the file read only with a cache image FAPL entry + * requested. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that it contains the expected data + * Verify that it contains the expected data * - * Verify that the cache image was loaded. + * Verify that the cache image was loaded. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file read only. + * 7) Open the file read only. * - * 8) Open a dataset. + * 8) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was loaded. + * Verify that the cache image was loaded. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file read write. + * 10) Open the file read write. * - * 11) Open a dataset. + * 11) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was loaded. + * Verify that the cache image was loaded. * - * 12) Close the file. + * 12) Close the file. * - * 13) Open the file read write. + * 13) Open the file read write. * - * 14) Open a dataset. + * 14) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was NOT loaded. + * Verify that the cache image was NOT loaded. * - * 15) Close the file. + * 15) Close the file. * - * 16) Delete the file. + * 16) Delete the file. * * Return: void * @@ -6072,7 +6070,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6087,7 +6085,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6099,8 +6097,8 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6108,10 +6106,10 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -6132,10 +6130,10 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -6148,20 +6146,20 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Open the file read only with a cache image FAPL entry requested. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6169,10 +6167,10 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * * Verify that it contains the expected data. @@ -6196,9 +6194,9 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -6211,20 +6209,20 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 7) Open the file read only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -6232,10 +6230,10 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * * Verify that it contains the expected data. @@ -6260,7 +6258,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6275,20 +6273,20 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file read / write. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6296,9 +6294,9 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open and close a dataset. * * Verify that it contains the expected data. @@ -6322,9 +6320,9 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Close the file. */ @@ -6337,7 +6335,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6346,11 +6344,11 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6358,9 +6356,9 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Open and close a dataset. * * Verify that it contains the expected data. @@ -6384,9 +6382,9 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 15) Close the file. */ @@ -6399,9 +6397,9 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Delete the file */ @@ -6424,36 +6422,36 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } /* cache_image_api_error_check_2() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_3() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * At present, SWMR and cache image may not be active - * at the same time. The purpose of this test is to - * verify that attempts to run SWMR and cache image - * at the same time will fail. + * At present, SWMR and cache image may not be active + * at the same time. The purpose of this test is to + * verify that attempts to run SWMR and cache image + * at the same time will fail. * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file with a cache image requested.. + * 1) Create a HDF5 file with a cache image requested.. * - * 2) Try to start SWMR write -- should fail. + * 2) Try to start SWMR write -- should fail. * * 3) Discard the file if necessary * - * 4) Attempt to create a HDF5 file with SWMR write - * access and cache image requested -- should fail. + * 4) Attempt to create a HDF5 file with SWMR write + * access and cache image requested -- should fail. * * 5) Discard the file if necessary * * 6) Create a HDF5 file with a cache image requested. * - * 7) Create some datasets in the file. + * 7) Create some datasets in the file. * - * 8) Close the file. + * 8) Close the file. * * 9) Attempt to open the file with SWMR write access -- * should fail. @@ -6490,7 +6488,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6505,7 +6503,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6517,8 +6515,8 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6526,9 +6524,9 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Try to start SWMR write -- should fail. */ @@ -6543,9 +6541,9 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } H5E_END_TRY; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Discard the file if necessary */ @@ -6565,19 +6563,19 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 4) Attempt to create a HDF5 file with SWMR write + + /* 4) Attempt to create a HDF5 file with SWMR write * access and cache image requested -- should fail. */ - + attempt_swmr_open_hdf5_file(/* create_file */ TRUE, - /* set_mdci_fapl */ TRUE, + /* set_mdci_fapl */ TRUE, /* hdf_file_name */ filename); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6585,16 +6583,16 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) if ( pass ) { - /* file probably doesn't exist, so don't + /* file probably doesn't exist, so don't * error check the remove call. */ HDremove(filename); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Create a HDF5 file with a cache image requested. */ if ( pass ) { @@ -6603,8 +6601,8 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6612,10 +6610,10 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Create some datasets in the file. */ if ( pass ) { @@ -6634,9 +6632,9 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 8) Close the file. */ @@ -6650,20 +6648,20 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 9) Attempt to open the file with SWMR write access -- should fail. */ - + attempt_swmr_open_hdf5_file(/* create_file */ FALSE, - /* set_mdci_fapl */ TRUE, + /* set_mdci_fapl */ TRUE, /* hdf_file_name */ filename); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Discard the file if necessary. */ if ( pass ) { @@ -6675,7 +6673,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6689,67 +6687,67 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } /* cache_image_api_error_check_3() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_4() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * The object of this test is to verify that a request for - * a cache image when a version 2 superblock is not available/ - * not requested is handled correctly. - * (the cache image request should be ignored silently). + * The object of this test is to verify that a request for + * a cache image when a version 2 superblock is not available/ + * not requested is handled correctly. + * (the cache image request should be ignored silently). * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a FAPL requesting a cache image, but WITHOUT - * specifying the latest file format. + * 1) Create a FAPL requesting a cache image, but WITHOUT + * specifying the latest file format. * - * 2) Create a HDF5 file using the above FAPL. + * 2) Create a HDF5 file using the above FAPL. * - * 3) Create some datasets in the file. + * 3) Create some datasets in the file. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file read only. Verify that the file doesn't - * contain a cache image. + * 5) Open the file read only. Verify that the file doesn't + * contain a cache image. * - * 6) Verify that the datasets exist and contain the - * expected data + * 6) Verify that the datasets exist and contain the + * expected data * - * Verify that the cache image was not loaded. + * Verify that the cache image was not loaded. * - * 7) Close the file. + * 7) Close the file. * - * 8) Open the file R/W using the FAPL defined in 1) above. - * Verify that the file does not contain a cache image. + * 8) Open the file R/W using the FAPL defined in 1) above. + * Verify that the file does not contain a cache image. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file R/W using the FAPL defined in 1) above. - * Verify that the file does not contain a cache image. + * 10) Open the file R/W using the FAPL defined in 1) above. + * Verify that the file does not contain a cache image. * - * 11) Verify that the data sets contain the expected data + * 11) Verify that the data sets contain the expected data * - * Verify that a cache image was not loaded. + * Verify that a cache image was not loaded. * - * 12) Create several more data sets. + * 12) Create several more data sets. * - * 13) Close the file. + * 13) Close the file. * - * 14) Open the file read write. - * - * Verify that the file does not contain a cache image. + * 14) Open the file read write. * - * 15) Verify the data sets exist and contain the expected - * data. + * Verify that the file does not contain a cache image. * - * Verify that a cache image was not loaded. + * 15) Verify the data sets exist and contain the expected + * data. * - * 16) Close the file. + * Verify that a cache image was not loaded. * - * 17) Delete the file. + * 16) Close the file. + * + * 17) Delete the file. * * Return: void * @@ -6783,7 +6781,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6798,11 +6796,11 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a FAPL requesting a cache image, but WITHOUT - * specifying the latest file format. + /* 1) Create a FAPL requesting a cache image, but WITHOUT + * specifying the latest file format. */ if ( pass ) { @@ -6815,7 +6813,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -6833,7 +6831,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6861,7 +6859,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -6880,10 +6878,10 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Create some datasets in the file. */ if ( pass ) { @@ -6904,10 +6902,10 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Close the file. */ if ( pass ) { @@ -6920,20 +6918,20 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open the file read only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6941,11 +6939,11 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 6) Verify that the datasets exist and contain the + + + /* 6) Verify that the datasets exist and contain the * expected data */ @@ -6965,9 +6963,9 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Close the file. */ @@ -6980,11 +6978,11 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 8) Open the file R/W using the FAPL defined in 1) above. + + + /* 8) Open the file R/W using the FAPL defined in 1) above. * * Verify that the file does not contain a cache image. */ @@ -7011,7 +7009,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -7030,7 +7028,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7043,7 +7041,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7058,9 +7056,9 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file R/W using the FAPL defined in 1) above. @@ -7089,7 +7087,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -7108,7 +7106,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7121,7 +7119,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7146,7 +7144,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7157,7 +7155,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) create_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7172,23 +7170,23 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Open the file read write. - * + * * Verify that the file does not contain a cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7196,10 +7194,10 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 15) Verify the data sets exist and contain the expected data. * * Verify that a cache image was not loaded. @@ -7221,7 +7219,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7236,9 +7234,9 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 17) Delete the file */ @@ -7251,7 +7249,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7270,36 +7268,36 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } /* cache_image_api_error_check_4() */ - + /*------------------------------------------------------------------------- * Function: get_free_sections_test() * * Purpose: It is possible that H5Fget_free_sections() to be - * called before any activity on the metadata cache. - * This is a potential problem, as satisfying the - * H5Fget_free_sections() call requires access to all - * free space managers. When persistent free space + * called before any activity on the metadata cache. + * This is a potential problem, as satisfying the + * H5Fget_free_sections() call requires access to all + * free space managers. When persistent free space * managers are enabled, this will require calling - * H5MF_tidy_self_referential_fsm_hack(). This is a + * H5MF_tidy_self_referential_fsm_hack(). This is a * non issue in the absence of a cache image. However, - * this is a problem if a cache image exists, as - * the call to H5MF_tidy_self_referential_fsm_hack() - * will free the file space allocated to the cache - * image. - * - * The objective of this test is to create a test file - * with both non-empty self referential presistant - * free space managers, and a cache image, and then - * verify that this situation is handled correctly if + * this is a problem if a cache image exists, as + * the call to H5MF_tidy_self_referential_fsm_hack() + * will free the file space allocated to the cache + * image. + * + * The objective of this test is to create a test file + * with both non-empty self referential presistant + * free space managers, and a cache image, and then + * verify that this situation is handled correctly if * H5Fget_free_sections() is called before the metadata * cache image is loaded. * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file with a cache image requested - * and persistent free space managers enabled. + * 1) Create a HDF5 file with a cache image requested + * and persistent free space managers enabled. * - * 2) Create some data sets, and then delete some of + * 2) Create some data sets, and then delete some of * of those near the beginning of the file. * * 3) Close the file. @@ -7310,12 +7308,12 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) * been loaded. * * 6) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. * * 7) Call H5Fget_free_sections(). * - * 8) Verify that the cache image has been loaded and + * 8) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. * * 9) Verify that the remaining data sets contain the @@ -7329,12 +7327,12 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) * been loaded. * * 13) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. * * 14) Call H5Fget_free_sections(). * - * 15) Verify that the cache image has been loaded and + * 15) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. * * 16) Verify that the remaining data sets contain the @@ -7342,7 +7340,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) * * 17) Delete the remaining data sets. * - * 18) Close the file. + * 18) Close the file. * * 19) Verify that file space has been reclaimed. * @@ -7378,7 +7376,7 @@ get_free_sections_test(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7393,12 +7391,12 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 1) Create a HDF5 file with a cache image requested - * and persistent free space managers enabled. + * and persistent free space managers enabled. */ if ( pass ) { @@ -7407,8 +7405,8 @@ get_free_sections_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7416,11 +7414,11 @@ get_free_sections_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 2) Create some data sets, and then delete some of + /* 2) Create some data sets, and then delete some of * of those near the beginning of the file. */ @@ -7429,7 +7427,7 @@ get_free_sections_test(hbool_t single_file_vfd) create_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7437,7 +7435,7 @@ get_free_sections_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7445,10 +7443,10 @@ get_free_sections_test(hbool_t single_file_vfd) delete_datasets(file_id, 1, 5); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Close the file. */ if ( pass ) { @@ -7461,10 +7459,10 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 4) Open the file read only. */ if ( pass ) { @@ -7473,8 +7471,8 @@ get_free_sections_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7482,10 +7480,10 @@ get_free_sections_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 5) Verify that a cache image exists, and has not been loaded. */ if ( pass ) { @@ -7498,18 +7496,18 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. */ if ( pass ) { - /* file_ptr->shared->first_alloc_dealloc is set to FALSE if the + /* file_ptr->shared->first_alloc_dealloc is set to FALSE if the * file is opened R/O. */ if ( ( ! H5F_addr_defined(file_ptr->shared->eoa_fsm_fsalloc) ) || @@ -7522,15 +7520,15 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Call H5Fget_free_sections(). */ if ( pass ) { - if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) + if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) < 0 ){ pass = FALSE; @@ -7538,11 +7536,11 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 8) Verify that the cache image has been loaded and + + /* 8) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. */ if ( pass ) { @@ -7552,11 +7550,11 @@ get_free_sections_test(hbool_t single_file_vfd) pass = FALSE; failure_mssg = "cache image not loaded (1).\n"; - } + } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7567,10 +7565,10 @@ get_free_sections_test(hbool_t single_file_vfd) verify_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Close the file. */ if ( pass ) { @@ -7582,10 +7580,10 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open the file R/W. */ if ( pass ) { @@ -7594,8 +7592,8 @@ get_free_sections_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7603,10 +7601,10 @@ get_free_sections_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Verify that a cache image exists, and has not been loaded. */ if ( pass ) { @@ -7619,12 +7617,12 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. */ if ( pass ) { @@ -7639,15 +7637,15 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Call H5Fget_free_sections(). */ if ( pass ) { - if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) + if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) < 0 ){ pass = FALSE; @@ -7655,11 +7653,11 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 15) Verify that the cache image has been loaded and + + /* 15) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. */ if ( pass ) { @@ -7669,11 +7667,11 @@ get_free_sections_test(hbool_t single_file_vfd) pass = FALSE; failure_mssg = "cache image not loaded (2).\n"; - } + } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7684,10 +7682,10 @@ get_free_sections_test(hbool_t single_file_vfd) verify_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 17) Delete the remaining data sets. */ if ( pass ) { @@ -7695,10 +7693,10 @@ get_free_sections_test(hbool_t single_file_vfd) delete_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 18) Close the file. */ if ( pass ) { @@ -7710,7 +7708,7 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7730,10 +7728,10 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 20) Discard the file. */ if ( pass ) { @@ -7745,7 +7743,7 @@ get_free_sections_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { PASSED(); } else { H5_FAILED(); } @@ -7758,40 +7756,40 @@ get_free_sections_test(hbool_t single_file_vfd) } /* get_free_sections_test() */ - + /*------------------------------------------------------------------------- * Function: evict_on_close_test() * - * Purpose: If a file containing a cache image which in turn - * contains dirty entries is opened R/O, the metadata - * cache must refuse to evict the dirty entries, as + * Purpose: If a file containing a cache image which in turn + * contains dirty entries is opened R/O, the metadata + * cache must refuse to evict the dirty entries, as * it will not be able to reload them from file. This * is a bit tricky, as the dirty entries must marked as - * clean in the metadata cache so that the MDC will not + * clean in the metadata cache so that the MDC will not * attempt to flush then on file close. * - * The objective of this test is to verify that the + * The objective of this test is to verify that the * metadata will not evict dirty entries in the above * context when the file is opened with the evict on close * FAPL entry. * - * Do this by creating a HDF5 file with a cache image - * containing dirty metadata. + * Do this by creating a HDF5 file with a cache image + * containing dirty metadata. * - * Then close the file, re-open it R/O, and scan its + * Then close the file, re-open it R/O, and scan its * contents twice. If evict on close succeeds in evicting - * the dirty metadata, the second scan will fail, as valid + * the dirty metadata, the second scan will fail, as valid * versions of the dirty metadata will not be available. * - * To make the test more useful, enable persistent free + * To make the test more useful, enable persistent free * space managers. * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file without a cache image requested - * and persistent free space managers enabled. + * 1) Create a HDF5 file without a cache image requested + * and persistent free space managers enabled. * - * 2) Create some data sets and verify them. + * 2) Create some data sets and verify them. * * 3) Close the file. * @@ -7857,7 +7855,7 @@ evict_on_close_test(hbool_t single_file_vfd) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7872,12 +7870,12 @@ evict_on_close_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 1) Create a HDF5 file without a cache image requested - * and persistent free space managers enabled. + * and persistent free space managers enabled. */ if ( pass ) { @@ -7885,8 +7883,8 @@ evict_on_close_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7894,7 +7892,7 @@ evict_on_close_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7905,7 +7903,7 @@ evict_on_close_test(hbool_t single_file_vfd) create_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7913,10 +7911,10 @@ evict_on_close_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Close the file. */ if ( pass ) { @@ -7929,10 +7927,10 @@ evict_on_close_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 4) Open the file R/W, and with cache image requested. */ if ( pass ) { @@ -7941,8 +7939,8 @@ evict_on_close_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7950,7 +7948,7 @@ evict_on_close_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7964,10 +7962,10 @@ evict_on_close_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Create some more datasets and verify them */ if ( pass ) { @@ -7975,7 +7973,7 @@ evict_on_close_test(hbool_t single_file_vfd) create_datasets(file_id, 11, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7988,15 +7986,15 @@ evict_on_close_test(hbool_t single_file_vfd) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", + HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", (long long)(cache_ptr->index_size), (long long)(cache_ptr->dirty_index_size)); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Close the file. */ if ( pass ) { @@ -8008,10 +8006,10 @@ evict_on_close_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 8) Open the file R/O and with evict on close enabled. */ if ( pass ) { @@ -8020,8 +8018,8 @@ evict_on_close_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ TRUE, + /* config_fsm */ FALSE, + /* set_eoc */ TRUE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -8029,7 +8027,7 @@ evict_on_close_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -8040,7 +8038,7 @@ evict_on_close_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -8048,7 +8046,7 @@ evict_on_close_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -8063,10 +8061,10 @@ evict_on_close_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open the file R/w and with evict on close enabled. */ if ( pass ) { @@ -8075,8 +8073,8 @@ evict_on_close_test(hbool_t single_file_vfd) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ TRUE, + /* config_fsm */ FALSE, + /* set_eoc */ TRUE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -8084,7 +8082,7 @@ evict_on_close_test(hbool_t single_file_vfd) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -8095,7 +8093,7 @@ evict_on_close_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -8103,7 +8101,7 @@ evict_on_close_test(hbool_t single_file_vfd) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -8118,7 +8116,7 @@ evict_on_close_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -8133,7 +8131,7 @@ evict_on_close_test(hbool_t single_file_vfd) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { PASSED(); } else { H5_FAILED(); } @@ -8147,7 +8145,7 @@ evict_on_close_test(hbool_t single_file_vfd) } /* evict_on_close_test() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -8179,10 +8177,10 @@ main(void) express_test = GetTestExpress(); - printf("=========================================\n"); - printf("Cache image tests\n"); - printf(" express_test = %d\n", express_test); - printf("=========================================\n"); + HDprintf("=========================================\n"); + HDprintf("Cache image tests\n"); + HDprintf(" express_test = %d\n", express_test); + HDprintf("=========================================\n"); /* Check for VFD which stores data in multiple files */ single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")); diff --git a/test/cache_tagging.c b/test/cache_tagging.c index dd886eb..7ce4e88 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -15,7 +15,7 @@ * * This file contains tests for metadata tagging. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" @@ -47,7 +47,7 @@ #define TEST_DEFAULT 0 #define TEST_SHMESG 1 #define NUM_TEST_TYPES 2 - + /* ===================== */ /* Function Declarations */ /* ===================== */ @@ -98,7 +98,7 @@ static unsigned check_invalid_tag_application(void); #ifndef NDEBUG - + /*------------------------------------------------------------------------- * Function: dump_cache() * @@ -127,19 +127,19 @@ static int dump_cache(hid_t fid) TEST_ERROR; return 0; - + error: return -1; } /* dump_cache */ #endif /* NDEBUG */ /* end debugging functions */ - + /*------------------------------------------------------------------------- * Function: verify_no_unknown_tags() * * Purpose: Verifies that all tags in the provided cache have the - * 'dirtied' flag set. Other verification functions in this - * test file set this flag after checking them, so + * 'dirtied' flag set. Other verification functions in this + * test file set this flag after checking them, so * this is handy to verify that tests have checked all entries * in the cache. * @@ -181,7 +181,7 @@ error: return -1; } /* verify_no_unknown_tags */ - + /*------------------------------------------------------------------------- * Function: mark_all_entries_investigated() * @@ -229,7 +229,7 @@ error: return -1; } /* mark_all_entries_investigated */ - + /*------------------------------------------------------------------------- * Function: reset_all_entries_investigated() * @@ -275,15 +275,15 @@ error: return -1; } /* reset_all_entries_investigated */ - + /*------------------------------------------------------------------------- * Function: verify_tag() * * Purpose: Asserts that there is an entry in the specified cache with * the provided entry id and provided tag. The function will - * fail if this is not the case. If found, this function will - * set the entry's flush_marker flag, so future verification - * attempts can skip over this entry, knowing it has already been + * fail if this is not the case. If found, this function will + * set the entry's flush_marker flag, so future verification + * attempts can skip over this entry, knowing it has already been * checked. * * Return: 0 on Success, -1 on Failure @@ -327,7 +327,7 @@ verify_tag(hid_t fid, int id, haddr_t tag) /* Didn't find the tagged entry, throw an error */ TEST_ERROR; - + done: return 0; @@ -358,7 +358,7 @@ error: return -1; } /* evict entries */ - + /*------------------------------------------------------------------------- * Function: get_object_header_tag() * @@ -389,7 +389,7 @@ error: return -1; } /* get_object_header_tag */ - + /*------------------------------------------------------------------------- * Function: get_sbe_tag() * @@ -420,7 +420,7 @@ error: /* Test Functions */ /* ============== */ - + /*------------------------------------------------------------------------- * Function: check_file_creation_tags * @@ -434,7 +434,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_file_creation_tags(hid_t fcpl_id, int type) { /* Variable Declarations */ @@ -507,7 +507,7 @@ error: return 1; } /* check_file_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_file_open_tags * @@ -521,7 +521,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_file_open_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -551,12 +551,12 @@ check_file_open_tags(hid_t fcpl, int type) /* Retrieve various tags */ if ( type == TEST_SHMESG ) { - + /* determine tag value of superblock extension object header */ if ( get_sbe_tag(fid, &sbe_tag) < 0 ) TEST_ERROR; } /* end if */ - + /* Close the file */ if ( H5Fclose(fid) < 0 ) TEST_ERROR; @@ -619,7 +619,7 @@ error: return 1; } /* check_file_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_group_creation_tags * @@ -633,7 +633,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_group_creation_tags(void) { /* Variable Declarations */ @@ -646,7 +646,7 @@ check_group_creation_tags(void) /* Testing Macro */ TESTING("tag application during group creation"); - + /* ===== */ /* Setup */ /* ===== */ @@ -683,7 +683,7 @@ check_group_creation_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify root group's tagged metadata */ if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_SNODE_ID, root_tag) < 0 ) TEST_ERROR; @@ -720,7 +720,7 @@ error: return 1; } /* check_group_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_multi_group_creation_tags * @@ -734,7 +734,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_multi_group_creation_tags(void) { /* Variable Declarations */ @@ -774,7 +774,7 @@ check_multi_group_creation_tags(void) for (i = 0; i < MULTIGROUPS; i++) { - sprintf(gname, "%d", i); + HDsprintf(gname, "%d", i); if ( (gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( H5Gclose(gid) < 0 ) TEST_ERROR; @@ -793,7 +793,7 @@ check_multi_group_creation_tags(void) for (i = 0; i < MULTIGROUPS; i++) { /* Re-open the group */ - sprintf(gname, "%d", i); + HDsprintf(gname, "%d", i); if ( (gid = H5Gopen2(fid, gname, H5P_DEFAULT)) < 0 ) TEST_ERROR; /* Verify object header for root group */ @@ -848,7 +848,7 @@ error: return 1; } /* check_multi_group_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_link_iteration_tags * @@ -862,7 +862,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_link_iteration_tags(void) { /* Variable Declarations */ @@ -899,7 +899,7 @@ check_link_iteration_tags(void) /* Create many datasets in root group */ for (i=0;i<500;i++) { - sprintf(dsetname, "Dset %d", i); + HDsprintf(dsetname, "Dset %d", i); if ( (did = H5Dcreate2(fid, dsetname, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( H5Dclose(did) < 0 ) TEST_ERROR; } @@ -966,7 +966,7 @@ error: return 1; } /* check_link_iteration_tags */ - + /*------------------------------------------------------------------------- * Function: check_dense_attribute_tags * @@ -980,7 +980,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dense_attribute_tags(void) { /* Variable Declarations */ @@ -994,7 +994,7 @@ check_dense_attribute_tags(void) hid_t fapl = -1; /* File access property list */ haddr_t d_tag = 0; /* Dataset tag value */ haddr_t root_tag = 0; /* Root group tag value */ - char attrname[500]; /* Name of attribute */ + char attrname[500]; /* Name of attribute */ /* Testing Macro */ TESTING("tag application during dense attribute manipulation"); @@ -1022,10 +1022,10 @@ check_dense_attribute_tags(void) /* Create dataset */ if ( (did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; - + /* get dataset object header */ if ( get_object_header_tag(did, &d_tag) < 0 ) TEST_ERROR; - + /* Clear Metadata Tags (don't care about them for this test */ mark_all_entries_investigated(fid); @@ -1035,7 +1035,7 @@ check_dense_attribute_tags(void) for (i=0;i<50;i++) { - sprintf(attrname, "attr %d", i); + HDsprintf(attrname, "attr %d", i); if ( (aid = H5Acreate2(did, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0 ) TEST_ERROR; if ( H5Aclose(aid) < 0 ) TEST_ERROR; @@ -1151,7 +1151,7 @@ error: return 1; } /* check_dense_attribute_tags */ - + /*------------------------------------------------------------------------- * Function: check_group_open_tags * @@ -1165,7 +1165,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_group_open_tags(void) { /* Variable Declarations */ @@ -1178,7 +1178,7 @@ check_group_open_tags(void) /* Testing Macro */ TESTING("tag application during group open"); - + /* ===== */ /* Setup */ /* ===== */ @@ -1258,7 +1258,7 @@ error: return 1; } /* check_group_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_creation_tags * @@ -1272,7 +1272,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_creation_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1349,7 +1349,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) /* verify shared message index tagged with sohm */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - + /* verify fractal heap header belonging to group */ if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; @@ -1368,7 +1368,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) /* verify no other entries present */ if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR; - + /* Reset the changes we've made to the cache's data structures */ if(reset_all_entries_investigated(fid) < 0) TEST_ERROR; @@ -1392,7 +1392,7 @@ error: return 1; } /* check_attribute_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_open_tags * @@ -1406,7 +1406,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_open_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1483,7 +1483,7 @@ check_attribute_open_tags(hid_t fcpl, int type) /* verify object header chunk belonging to group */ if ( verify_tag(fid, H5AC_OHDR_CHK_ID, g_tag) < 0 ) TEST_ERROR; - + if ( type == TEST_SHMESG ) { /* verify (another) object header chunk belonging to group */ @@ -1529,7 +1529,7 @@ error: return 1; } /* check_attribute_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_rename_tags * @@ -1543,7 +1543,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_rename_tags(hid_t fcpl, int type) { /* Variable declarations */ @@ -1597,7 +1597,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* Create attribute */ if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; - + /* fill out data buffer */ for(i = 0; i < DIMS; i++) for(j = 0; j < DIMS; j++) @@ -1663,9 +1663,9 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* verify shared header message stored as a list */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - /* - * one freespace header tag for H5FD_MEM_DRAW manager, - * one freespace header tag for H5FD_MEM_SUPER manager + /* + * one freespace header tag for H5FD_MEM_DRAW manager, + * one freespace header tag for H5FD_MEM_SUPER manager */ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; @@ -1704,7 +1704,7 @@ error: return 1; } /* check_attribute_rename_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_delete_tags * @@ -1718,7 +1718,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_delete_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1772,7 +1772,7 @@ check_attribute_delete_tags(hid_t fcpl, int type) /* Create attribute */ if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; - + /* fill out data buffer */ for(i = 0;i < DIMS; i++) for(j = 0;j < DIMS; j++) @@ -1810,33 +1810,33 @@ check_attribute_delete_tags(hid_t fcpl, int type) /* verify object header belonging to group */ if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR; - + if ( type == TEST_SHMESG ) { /* verify shared header message master table */ if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - /* - * 2 calls to verify_tag() for verifying free space: + /* + * 2 calls to verify_tag() for verifying free space: * one freespace header tag for free-space header raw data * one freespace header tag for free-space section info raw data * one freespace header tag for free-space header metadata */ - if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) + if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; - if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 ) + if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; - if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) + if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; #if 0 - /* If the free space managers are persistent, the + /* If the free space managers are persistent, the * H5MF_tidy_self_referential_fsm_hack() must have been run. - * Since this function floats all self referential free space - * managers, the H5FD_MEM_SUPER FSM will not be in the metadata + * Since this function floats all self referential free space + * managers, the H5FD_MEM_SUPER FSM will not be in the metadata * cache. */ - if ( ( ! persistent_fsms ) && + if ( ( ! persistent_fsms ) && ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) ) TEST_ERROR; #endif @@ -1871,7 +1871,7 @@ error: return 1; } /* check_attribute_delete_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_creation_tags * @@ -1885,7 +1885,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_creation_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1929,10 +1929,10 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* ============================ */ /* Create Dataset in Root Group */ /* ============================ */ - + /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -1974,7 +1974,7 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* Verify dataset's tagged metadata */ if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - + /* Verify shared object header message tags */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; @@ -2004,7 +2004,7 @@ error: return 1; } /* check_dataset_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_creation_earlyalloc_tags * @@ -2018,7 +2018,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -2107,7 +2107,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) /* Verify dataset's tagged metadata */ if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - + /* Verify shared object header message tags */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; @@ -2141,7 +2141,7 @@ error: return 1; } /* check_dataset_creation_earlyalloc_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_open_tags * @@ -2155,7 +2155,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_open_tags(void) { /* Variable Declarations */ @@ -2192,7 +2192,7 @@ check_dataset_open_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2222,7 +2222,7 @@ check_dataset_open_tags(void) /* ========================== */ /* Open Dataset in Root Group */ /* ========================== */ - + if (( did = H5Dopen2(fid, DATASETNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR; /* =================================== */ @@ -2267,7 +2267,7 @@ error: return 1; } /* check_dataset_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_write_tags * @@ -2281,7 +2281,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_write_tags(void) { /* Variable Declarations */ @@ -2323,7 +2323,7 @@ check_dataset_write_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2372,7 +2372,7 @@ check_dataset_write_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify 10 b-tree nodes belonging to dataset */ for (i=0; i<10; i++) if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR; @@ -2408,7 +2408,7 @@ error: return 1; } /* check_dataset_write_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_write_tags * @@ -2422,7 +2422,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_write_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -2503,7 +2503,7 @@ check_attribute_write_tags(hid_t fcpl, int type) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify object header of group */ if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR; @@ -2562,7 +2562,7 @@ error: return 1; } /* check_attribute_write_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_read_tags * @@ -2576,7 +2576,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_read_tags(void) { /* Variable Declarations */ @@ -2618,7 +2618,7 @@ check_dataset_read_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2666,7 +2666,7 @@ check_dataset_read_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify 19 b-tree nodes belonging to dataset */ for (i=0; i<19; i++) if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR; @@ -2699,7 +2699,7 @@ error: return 1; } /* check_dataset_read_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_size_retrieval * @@ -2713,7 +2713,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_size_retrieval(void) { /* Variable Declarations */ @@ -2756,7 +2756,7 @@ check_dataset_size_retrieval(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2837,7 +2837,7 @@ error: return 1; } /* check_dataset_size_retrieval */ - + /*------------------------------------------------------------------------- * Function: check_dataset_extend_tags * @@ -2851,7 +2851,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_extend_tags(void) { @@ -2895,7 +2895,7 @@ check_dataset_extend_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2976,7 +2976,7 @@ error: return 1; } /* check_dataset_extend_tags */ - + /*------------------------------------------------------------------------- * Function: check_object_info_tags * @@ -2990,7 +2990,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_object_info_tags(void) { /* Variable Declarations */ @@ -3000,7 +3000,7 @@ check_object_info_tags(void) hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; - H5O_info_t oinfo; /* Object info struct */ + H5O_info_t oinfo; /* Object info struct */ /* Testing Macro */ TESTING("tag application during object info retrieval"); @@ -3085,7 +3085,7 @@ error: return 1; } /* check_object_info_tags */ - + /*------------------------------------------------------------------------- * Function: check_object_copy_tags * @@ -3099,7 +3099,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_object_copy_tags(void) { /* Variable Declarations */ @@ -3155,7 +3155,7 @@ check_object_copy_tags(void) if ( (gid = H5Gopen2(fid, GROUPNAMECOPY, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( get_object_header_tag(gid, ©_tag) < 0 ) TEST_ERROR; if (H5Gclose(gid) < 0) TEST_ERROR; - + /* =================================== */ /* Verification of Metadata Tag Values */ /* =================================== */ @@ -3204,7 +3204,7 @@ error: return 1; } /* check_object_copy_tags */ - + /*------------------------------------------------------------------------- * Function: check_link_removal_tags * @@ -3218,7 +3218,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_link_removal_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -3271,7 +3271,7 @@ check_link_removal_tags(hid_t fcpl, int type) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -3334,7 +3334,7 @@ check_link_removal_tags(hid_t fcpl, int type) if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; } /* end if */ - + /* verify no other entries present */ if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR; @@ -3362,7 +3362,7 @@ error: return 1; } /* check_link_removal_tags */ - + /*------------------------------------------------------------------------- * Function: check_link_getname_tags * @@ -3376,7 +3376,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_link_getname_tags(void) { /* Variable Declarations */ @@ -3430,7 +3430,7 @@ check_link_getname_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -3513,7 +3513,7 @@ error: return 1; } /* check_link_getname_tags */ - + /*------------------------------------------------------------------------- * Function: check_external_link_creation_tags * @@ -3527,7 +3527,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_external_link_creation_tags(void) { /* Variable Declarations */ @@ -3576,7 +3576,7 @@ check_external_link_creation_tags(void) /* ==================== */ /* Create External Link */ /* ==================== */ - + if (H5Lcreate_external(FILENAME2, GROUPNAMEPATH, fid, LINKNAME, H5P_DEFAULT, H5P_DEFAULT) < 0 ) TEST_ERROR; /* =================================== */ @@ -3587,7 +3587,7 @@ check_external_link_creation_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify root group metadata */ if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_OHDR_CHK_ID, root_tag) < 0 ) TEST_ERROR; @@ -3617,7 +3617,7 @@ error: return 1; } /* check_external_link_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_external_link_open_tags * @@ -3631,7 +3631,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_external_link_open_tags(void) { /* Variable Declarations */ @@ -3689,11 +3689,11 @@ check_external_link_open_tags(void) /* ================== */ /* Open External Link */ /* ================== */ - + if ( (xid = H5Gopen2(fid, LINKNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( (fid2 = H5Iget_file_id(xid)) < 0) TEST_ERROR; if ( get_object_header_tag(xid, &link_tag) < 0 ) TEST_ERROR; - + /* =================================== */ /* Verification of Metadata Tag Values */ /* =================================== */ @@ -3747,12 +3747,12 @@ error: return 1; } /* check_external_link_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_invalid_tag_application * * Purpose: This function verifies that an error occurs if a tag - * has not been set up during a protect or set of + * has not been set up during a protect or set of * a new piece of metadata. * * Return: 0 on Success, 1 on Failure @@ -3777,7 +3777,7 @@ check_invalid_tag_application(void) /* Testing Macro */ TESTING("failure on invalid tag application"); - + #if H5C_DO_TAGGING_SANITY_CHECKS /* Create Fapl */ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; @@ -3844,7 +3844,7 @@ error: return 1; } /* check_invalid_tag_application */ - + /*------------------------------------------------------------------------- * Function: main * @@ -3857,8 +3857,8 @@ error: * *------------------------------------------------------------------------- */ -int -main(void) +int +main(void) { /* Variable Declarations */ hid_t fcpl_default = -1; /* file creation prop list */ @@ -3866,13 +3866,13 @@ main(void) hid_t fcpl = -1; /* file creation prop list */ unsigned nerrs = 0; /* Error Encountered */ int test_type = 0; /* test type iterator */ - + /* Open the HDF5 Library */ H5open(); - - /* ========== */ + + /* ========== */ /* Test Setup */ - /* ========== */ + /* ========== */ /* Create a standard file creation property list */ fcpl_default = H5Pcreate(H5P_FILE_CREATE); @@ -3888,13 +3888,13 @@ main(void) /* ========= */ for (test_type=0; test_type<NUM_TEST_TYPES; test_type++) { - + /* Run tests on each fcpl set up above. */ if (test_type == TEST_DEFAULT) { if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n"); fcpl = fcpl_default; - + } else if (test_type == TEST_SHMESG) { if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n"); @@ -3931,7 +3931,7 @@ main(void) if (!nerrs) nerrs += check_link_getname_tags(); if (!nerrs) nerrs += check_external_link_creation_tags(); if (!nerrs) nerrs += check_external_link_open_tags(); - + if (!nerrs) nerrs += check_dense_attribute_tags(); if (!nerrs) nerrs += check_link_iteration_tags(); if (!nerrs) nerrs += check_invalid_tag_application(); diff --git a/test/chunk_info.c b/test/chunk_info.c new file mode 100644 index 0000000..d3e5751 --- /dev/null +++ b/test/chunk_info.c @@ -0,0 +1,1986 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 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 chunk query API functions + * + * Modification: + * Many tests were added for HDFFV-10677. -BMR, August 2019 + * + * Test structure: + * main() + * test_basic_query() + * test_get_chunk_info_highest_v18() + * test_get_chunk_info_v110() + * test_chunk_info_single_chunk() + * test_chunk_info_implicit() + * test_chunk_info_fixed_array() + * test_chunk_info_extensible_array() + * test_chunk_info_version2_btrees() + * test_failed_attempts() + * test_flt_msk_with_skip_compress() + * + * Helper functions: + * verify_idx_nchunks() + * verify_get_chunk_info() + * verify_get_chunk_info_by_coord() + * verify_empty_chunk_info() + * index_type_str() + * + */ +#define H5D_FRIEND +#define H5D_TESTING /* to use H5D__ functions */ +#include "H5Dpkg.h" + +#include "testhdf5.h" +#include "zlib.h" + +/* Test file names, using H5F_libver_t as indices */ +const char *FILENAME[] = { + "tchunk_info_earliest", + "tchunk_info_v18", + "tchunk_info_v110", + "tchunk_info_v112", + NULL +}; + +/* File to be used in test_failed_attempts */ +#define FILTERMASK_FILE "tflt_msk" +#define BASIC_FILE "basic_query" + +/* Parameters for testing chunk querying */ +#define SIMPLE_CHUNKED_DSET_NAME "Chunked Dataset" +#define CONTIGUOUS_DSET_NAME "Contiguous Dataset" +#define EMPTY_DSET_NAME "Empty Dataset" +#define EMPTY_EARLY_ALLOC_DSET_NAME "Empty Dataset with ALLOC_TIME_EARLY" +#define SINGLE_CHUNK_DSET_NAME "Single Chunk Index Dataset" +#define IMPLICIT_INDEX_DSET_NAME "Implicit Index Dataset" +#define FIXED_ARR_INDEX_DSET_NAME "Fixed Array Index Dataset" +#define EXT_ARR_INDEX_DSET_NAME "Extensible Array Index Dataset" +#define V2_BTREE_INDEX_DSET_NAME "Version 2 B-Tree Index Dataset" +#define SKIP_FILTER_DSET_NAME "Dataset with Skipping One Filter" +#define FILENAME_BUF_SIZE 256 /* Size for file names */ +#define RANK 2 /* Rank for datasets */ + +/* Dimension of the dataset */ +#define NX 24 +#define NY 16 + +/* Dimension of the chunk */ +#define CHUNK_NX 6 +#define CHUNK_NY 4 + +/* X/Y coords of first chunk written */ +#define START_CHK_X 0 +#define START_CHK_Y 2 + +/* X/Y coord of last chunk written */ +#define END_CHK_X 2 +#define END_CHK_Y 4 + +/* X and Y coords of an empty chunk */ +#define EMPTY_CHK_X 0 +#define EMPTY_CHK_Y 0 + +/* Size of a chunk when the entire dataset is a one single chunk */ +#define SINGLE_CHK_SIZE (NX*NY*sizeof(int)) + +/* Size of a chunk */ +#define CHK_SIZE (CHUNK_NX*CHUNK_NY*sizeof(int)) + +/* Size of an empty chunk */ +#define EMPTY_CHK_SIZE 0 + +/* Number of maximum chunks without extending */ +#define NUM_CHUNKS ((NX/CHUNK_NX)*(NY/CHUNK_NY)) + +/* Number of chunks that have been written */ +#define NUM_CHUNKS_WRITTEN 4 +#define ONE_CHUNK_WRITTEN 1 +#define TWO_CHUNKS_WRITTEN 2 +#define NO_CHUNK_WRITTEN 0 + +/* For testing invalid arguments */ +#define NONEXIST_CHK_INDEX 3 +#define OUTOFRANGE_CHK_INDEX 5 +#define INVALID_CHK_INDEX 5 + +/* For compressed data */ +#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) + +/* For use in error reporting */ +#define MSG_CHK_ADDR "Chunk address should not be HADDR_UNDEF because of H5D_ALLOC_TIME_EARLY." +#define MSG_CHK_SIZE "Chunk size should not be 0 because of H5D_ALLOC_TIME_EARLY." + +/* Utility function to initialize arguments */ +void reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size); + +/* Helper function containing common code that verifies indexing type + and number of chunks */ +static int verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsize_t exp_num_chunks); +static int verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, hsize_t *exp_offset, unsigned exp_flt_msk); +static int verify_get_chunk_info_by_coord(hid_t dset, hsize_t *offset, hsize_t exp_chk_size, unsigned exp_flt_msk); +static int verify_empty_chunk_info(hid_t dset, hsize_t *offset); +static const char* index_type_str(H5D_chunk_index_t idx_type); + +/*------------------------------------------------------------------------- + * Function: reinit_vars (helper function) + * + * Purpose: Wipes out variables for the next use, used in various tests. + * + * Return: Won't fail + * + * Date: September 2018 + * + *------------------------------------------------------------------------- + */ +void reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size) +{ + if(read_flt_msk) + *read_flt_msk = 0; + if(addr) + *addr = 0; + if(size) + *size = 0; +} + +/*------------------------------------------------------------------------- + * Function: verify_get_chunk_info (helper function) + * + * Purpose: Verifies that H5Dget_chunk_info returns correct + * values for a chunk. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static int +verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, hsize_t *exp_offset, unsigned exp_flt_msk) +{ + unsigned read_flt_msk = 0; /* Read filter mask */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + + if(H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size) < 0) + TEST_ERROR + CHECK(addr, HADDR_UNDEF, "H5Dget_chunk_info"); + VERIFY(size, exp_chk_size, "H5Dget_chunk_info, chunk size"); + VERIFY(read_flt_msk, exp_flt_msk, "H5Dget_chunk_info, filter mask"); + VERIFY(out_offset[0], exp_offset[0], "H5Dget_chunk_info, offset[0]"); + VERIFY(out_offset[1], exp_offset[1], "H5Dget_chunk_info, offset[1]"); + return SUCCEED; + +error: + return FAIL; +} + +/*------------------------------------------------------------------------- + * Function: verify_get_chunk_info_by_coord (helper function) + * + * Purpose: Verifies that H5Dget_chunk_info_by_coord returns correct + * values for a chunk. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static int +verify_get_chunk_info_by_coord(hid_t dset, hsize_t *offset, hsize_t exp_chk_size, unsigned exp_flt_msk) +{ + unsigned read_flt_msk = 0; /* Read filter mask */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + + /* Get info of the chunk at logical coordinates specified by offset */ + if(H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size) < 0) + TEST_ERROR + CHECK(addr, HADDR_UNDEF, "H5Dget_chunk_info_by_coord"); + VERIFY(size, exp_chk_size, "H5Dget_chunk_info_by_coord, chunk size"); + VERIFY(read_flt_msk, exp_flt_msk, "H5Dget_chunk_info_by_coord, filter mask"); + return SUCCEED; + +error: + return FAIL; +} + +/*------------------------------------------------------------------------- + * Function: verify_empty_chunk_info (helper function) + * + * Purpose: Verifies that H5Dget_chunk_info_by_coord returns correct + * values for an empty chunk. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2018 + * + *------------------------------------------------------------------------- + */ +static int +verify_empty_chunk_info(hid_t dset, hsize_t *offset) +{ + unsigned read_flt_msk = 0; /* Read filter mask */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + + /* Get info of the chunk at logical coordinates specified by offset */ + if(H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size) < 0) + TEST_ERROR + VERIFY(addr, HADDR_UNDEF, "H5Dget_chunk_info_by_coord, chunk address"); + VERIFY(size, EMPTY_CHK_SIZE, "H5Dget_chunk_info_by_coord, chunk size"); + return SUCCEED; + +error: + return FAIL; +} + +/*------------------------------------------------------------------------- + * Function: index_type_str (helper function) + * + * Purpose: Returns the string containing the text associated with the + * given indexing scheme. For use in error messages. + * + * Return: Success: a valid indexing scheme string + * Failure: a note indicating the indexing type is invalid + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static const char* +index_type_str(H5D_chunk_index_t idx_type) +{ + switch (idx_type) { + case H5D_CHUNK_IDX_SINGLE: + return("Single Chunk index type"); + case H5D_CHUNK_IDX_NONE: + return("Implicit index type"); + case H5D_CHUNK_IDX_FARRAY: + return("Fixed Array index type"); + case H5D_CHUNK_IDX_EARRAY: + return("Extensible Array index type"); + case H5D_CHUNK_IDX_BT2: + return("Version 2 B-tree index type"); + case H5D_CHUNK_IDX_BTREE: + return("Version 1 B-tree index type (default)"); + case H5D_CHUNK_IDX_NTYPES: + default: + return("invalid index type"); + } +} /* index_type_str */ + +/*------------------------------------------------------------------------- + * Function: verify_selected_chunks (helper function) + * + * Purpose: Reads the chunks within the boundery {start,end} and verify + * the values against the populated data. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static int +verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end) +{ + int read_buf[CHUNK_NX][CHUNK_NY]; + int expected_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY];/* Expected data */ + unsigned read_flt_msk = 0; /* Filter mask read back */ + hsize_t offset[2] = {0, 0}; /* Offset coordinates of a chunk */ + hsize_t chk_index; /* Chunk index */ + hsize_t ii, jj; /* Array indices */ + int n; + + HDmemset(&read_buf, 0, sizeof(read_buf)); + + /* Initialize the array of chunk data for all NUM_CHUNKS chunks, this is + the same as the written data and will be used to verify the read data */ + for(n = 0; n < NUM_CHUNKS; n++) + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + expected_buf[n][ii][jj] = (int)(ii*jj) + 1; + + /* Read each chunk within the boundery of {start,end} and verify the + values against the expected data */ + chk_index = 0; + for(ii = start[0]; ii < end[0]; ii++) + for(jj = start[1]; jj < end[1]; jj++, chk_index++) { + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + + /* Read the current chunk */ + if(H5Dread_chunk(dset, plist, offset, &read_flt_msk, read_buf) < 0) + TEST_ERROR + + /* Verify that read chunk is the same as the corresponding written one */ + if(HDmemcmp(expected_buf[chk_index], read_buf, CHUNK_NX*CHUNK_NY) != 0) + { + HDfprintf(stderr, "Read chunk differs from written chunk at offset (%d,%d)\n", offset[0], offset[1]); + return FAIL; + } + } + + return SUCCEED; + +error: + return FAIL; +} /* verify_selected_chunks */ + +/*------------------------------------------------------------------------- + * Function: write_selected_chunks (helper function) + * + * Purpose: Verifies that chunk indexing scheme and number of chunks of + * the dataset matches the expected values, then write data to + * a subset of chunks. This function opens the dataset then + * closes it after writing. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static int +write_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end, unsigned flt_msk) +{ + int direct_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY];/* Data in chunks */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t chk_index; /* Chunk index */ + hsize_t ii, jj; /* Array indices */ + int n; + + /* Initialize the array of chunk data for all NUM_CHUNKS chunks */ + for(n = 0; n < NUM_CHUNKS; n++) + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + direct_buf[n][ii][jj] = (int)(ii*jj) + 1; + + /* Write NUM_CHUNKS_WRITTEN chunks at the following logical coords: + (0,2) (0,3) (1,2) (1,3) */ + chk_index = 0; + for(ii = start[0]; ii < end[0]; ii++) + for(jj = start[1]; jj < end[1]; jj++, chk_index++) { + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + if(H5Dwrite_chunk(dset, plist, flt_msk, offset, CHK_SIZE, (void*)direct_buf[chk_index]) < 0) + TEST_ERROR + } + + return SUCCEED; + +error: + return FAIL; +} /* write_selected_chunks */ + +/*------------------------------------------------------------------------- + * Function: verify_idx_nchunks (helper function) + * + * Purpose: Verifies that chunk indexing scheme and number of chunks of + * the dataset match the expected values. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static int +verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsize_t exp_num_chunks) +{ + H5D_chunk_index_t idx_type; /* Dataset chunk index type */ + hsize_t nchunks = 0; /* Number of chunks */ + + /* Get the chunk indexing type of the dataset */ + if(H5Dget_chunk_index_type(dset, &idx_type) < 0) + TEST_ERROR + + /* Ensure the correct chunk indexing scheme is used */ + if(idx_type != exp_idx_type) + { + char msg[256]; + sprintf(msg, "Should be using %s.\n", index_type_str(idx_type)); + FAIL_PUTS_ERROR(msg); + } + + /* Get and verify the number of chunks */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, exp_num_chunks, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify the number of chunks again, passing in H5S_ALL */ + if(H5Dget_num_chunks(dset, H5S_ALL, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, exp_num_chunks, "H5Dget_num_chunks, number of chunks"); + + return SUCCEED; + +error: + return FAIL; +} /* verify_idx_nchunks */ + +/*------------------------------------------------------------------------- + * Function: test_get_chunk_info_highest_v18 + * + * Purpose: Test getting various chunk information + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Description: + * This function tests the new API functions added for EED-343: + * H5Dget_num_chunks, H5Dget_chunk_info, and + * H5Dget_chunk_info_by_coord for high bound up to 1.8. + * + * Date: September 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_get_chunk_info_highest_v18(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; /* File name */ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + int direct_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Data in chunks */ + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* 2 unlimited dims */ + hsize_t out_offset[2]; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t dims[2] = {NX, NY};/* Dataset dimensions */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + int fillvalue = -1; /* Fill value */ + int aggression = 9; /* Compression aggression setting */ + hsize_t offset[2] = {0, 0}; /* Offset coordinates of a chunk */ + const Bytef *z_src = (const Bytef*)(direct_buf); + Bytef *z_dst; /*destination buffer */ + uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(CHK_SIZE); + uLong z_src_nbytes = (uLong)CHK_SIZE; + void *outbuf = NULL; /* Pointer to new buffer */ + hsize_t chunk_size = CHK_SIZE; /* Size of a chunk, can be compressed or not */ + hsize_t ii, jj; /* Array indices */ + int n; /* Used as chunk index, but int to avoid conversion warning */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING("getting chunk information in file with version prior to 1.10"); + + /* Create the file */ + h5_fixname(FILENAME[H5F_LIBVER_V18], fapl, filename, sizeof filename); + + /* Set version bounds for creating the file. High bound to V18 to test + chunked dataset that use B-tree v1 structures to index chunks. */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) + TEST_ERROR + + chunkfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + if(chunkfile < 0) + TEST_ERROR + + /* Create the file and memory dataspace */ + if((dspace = H5Screate_simple(RANK, dims, maxdims)) < 0) + TEST_ERROR + + /* Set dset creation properties with chunking, compression, and fillvalue */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) TEST_ERROR + +#ifdef H5_HAVE_FILTER_DEFLATE + if(H5Pset_deflate(cparms, (unsigned)aggression) < 0) TEST_ERROR +#endif /* end H5_HAVE_FILTER_DEFLATE */ + + /* Set fill value */ + if(H5Pset_fill_value(cparms, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(chunkfile, SIMPLE_CHUNKED_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Initialize the array of chunk data for all NUM_CHUNKS chunks */ + for(n = 0; n < NUM_CHUNKS; n++) + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + direct_buf[n][ii][jj] = (int)(ii*jj) + 1; + +#ifdef H5_HAVE_FILTER_DEFLATE + /* Allocate output (compressed) buffer */ + outbuf = malloc(z_dst_nbytes); + z_dst = (Bytef *)outbuf; + + /* Perform compression from the source to the destination buffer */ + ret = compress2(z_dst, &z_dst_nbytes, z_src, z_src_nbytes, aggression); + + /* Check for various zlib errors */ + if(Z_BUF_ERROR == ret) { + fprintf(stderr, "overflow"); + TEST_ERROR + } else if(Z_MEM_ERROR == ret) { + fprintf(stderr, "deflate memory error"); + TEST_ERROR + } else if(Z_OK != ret) { + fprintf(stderr, "other deflate error"); + TEST_ERROR + } +#endif /* end H5_HAVE_FILTER_DEFLATE */ + + /* Write only NUM_CHUNKS_WRITTEN chunks at the following logical coords: + (0,2) (0,3) (1,2) (1,3) */ + n = 0; + for(ii = START_CHK_X; ii < END_CHK_X; ii++) + for(jj = START_CHK_Y; jj < END_CHK_Y; jj++, n++) { + +#ifdef H5_HAVE_FILTER_DEFLATE + /* Set chunk size to the compressed chunk size and the chunk point + to the compressed data chunk */ + chunk_size = (hsize_t)z_dst_nbytes; +#endif /* end H5_HAVE_FILTER_DEFLATE */ + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + ret = H5Dwrite_chunk(dset, H5P_DEFAULT, flt_msk, offset, chunk_size, (void*)outbuf); + if(ret < 0) TEST_ERROR + } + + /* Free the read buffer */ + if(outbuf) + HDfree(outbuf); + + if(H5Fflush(dset, H5F_SCOPE_LOCAL) < 0) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* ...open it again to test the chunk query functions */ + if((dset = H5Dopen2(chunkfile, SIMPLE_CHUNKED_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Get and verify the number of chunks written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NUM_CHUNKS_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify info of the last written chunk again, passing in H5S_ALL + this time */ + offset[0] = 6; + offset[1] = 12; + if(verify_get_chunk_info(dset, H5S_ALL, NUM_CHUNKS_WRITTEN-1, chunk_size, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + + /* Attempt to get info of a non-existing chunk, should fail */ + chk_index = OUTOFRANGE_CHK_INDEX; + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, H5S_ALL, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempt to get info of a non-existing chunk."); + + /* Attempt to get info of empty chunks, verify the returned addr and size */ + offset[0] = 0; + offset[1] = 0; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + offset[0] = 3 * CHUNK_NX; + offset[1] = 3 * CHUNK_NY; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + /* Go through all written chunks, get their info and verify the values */ + chk_index = 0; + for(ii = START_CHK_X; ii < END_CHK_X; ii++) + for(jj = START_CHK_Y; jj < END_CHK_Y; jj++, chk_index++) { + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + + if(verify_get_chunk_info(dset, dspace, chk_index, chunk_size, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + + /* Use the same offset to pass into the next ...by_coord function */ + if(verify_get_chunk_info_by_coord(dset, offset, chunk_size, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + } + + /* Close the first dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Create an empty dataset and close it */ + dset = H5Dcreate2(chunkfile, EMPTY_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Reopen the empty dataset to verify the chunk query functions on it */ + if((dset = H5Dopen2(chunkfile, EMPTY_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Verify that the number of chunks is 0 */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NO_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Attempt to get info of a chunk from an empty dataset, should fail */ + chk_index = OUTOFRANGE_CHK_INDEX; + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempt to get info of a non-existing chunk."); + + /* Attempt to get info of a chunk given its coords from an empty dataset, + should succeed with the returned address as HADDR_UNDEF and size as 0 */ + offset[0] = EMPTY_CHK_X; + offset[1] = EMPTY_CHK_Y; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + if(H5Dclose(dset) < 0) TEST_ERROR + + /************************************************************************ + * Test empty dataset with H5D_ALLOC_TIME_EARLY * + ************************************************************************/ + + /* Set space allocation to early so that chunk query functions will + retrieve chunk information even though the dataset is empty */ + if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY) < 0) + TEST_ERROR + + /* Create an empty dataset and close it */ + dset = H5Dcreate2(chunkfile, EMPTY_EARLY_ALLOC_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Reopen the empty dataset to verify the chunk query functions on it */ + if((dset = H5Dopen2(chunkfile, EMPTY_EARLY_ALLOC_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Verify that the number of chunks is NUM_CHUNKS */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NUM_CHUNKS, "H5Dget_num_chunks, number of chunks"); + + /* Attempt to get info of a chunk from an empty dataset, verify the + returned address and size in the case of H5D_ALLOC_TIME_EARLY */ + chk_index = NONEXIST_CHK_INDEX; + reinit_vars(&read_flt_msk, &addr, &size); + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + if(ret < 0) TEST_ERROR + /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ + if(addr == HADDR_UNDEF) + FAIL_PUTS_ERROR(MSG_CHK_ADDR); + if(size == EMPTY_CHK_SIZE) + FAIL_PUTS_ERROR(MSG_CHK_SIZE); + + chk_index = 10; + reinit_vars(&read_flt_msk, &addr, &size); + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + if(ret < 0) TEST_ERROR + /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ + if(addr == HADDR_UNDEF) + FAIL_PUTS_ERROR(MSG_CHK_ADDR); + if(size == EMPTY_CHK_SIZE) + FAIL_PUTS_ERROR(MSG_CHK_SIZE); + + /* Attempt to get info of a chunk given its coords from an empty dataset, + verify the returned address and size */ + offset[0] = 0; + offset[1] = 0; + if(H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size) < 0) + TEST_ERROR + /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ + if(addr == HADDR_UNDEF) + FAIL_PUTS_ERROR(MSG_CHK_ADDR); + if(size == 0) + FAIL_PUTS_ERROR(MSG_CHK_SIZE); + + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Close/release resources. */ + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Pclose(cparms) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_get_chunk_info_highest_v18() */ + +/*------------------------------------------------------------------------- + * Function: test_chunk_info_single_chunk + * + * Purpose: Test getting various chunk information when Single Chunk + * index type is used + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: November 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_chunk_info_single_chunk(const char *filename, hid_t fapl) +{ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */ + hsize_t chunk_dims[2] = {NX, NY}; /* Chunk dimensions */ + int data_buf[NX][NY]; /* Input buffer */ + H5D_chunk_index_t idx_type; /* Dataset chunk index type */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING(" Single Chunk index"); + + /* Open the file for reading/writing */ + if((chunkfile = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, NULL)) < 0) + TEST_ERROR + + /* Enable chunking */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) + TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(chunkfile, SINGLE_CHUNK_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* ...open it again to test the chunk query functions on a single empty + chunk */ + if((dset = H5Dopen2(chunkfile, SINGLE_CHUNK_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Ensure the correct chunk indexing scheme is used */ + if(H5Dget_chunk_index_type(dset, &idx_type) < 0) + TEST_ERROR + if(idx_type != H5D_CHUNK_IDX_SINGLE) + FAIL_PUTS_ERROR("Should be using Single Chunk index type"); + + /* Get the number of chunks and verify that no chunk has been written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NO_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Initialize the array of chunk data for the single chunk */ + for(ii = 0; ii < NX; ii++) + for(jj = 0; jj < NY; jj++) + data_buf[ii][jj] = (int)(ii*jj); + + /* Write the chunk */ + if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_buf) < 0) + TEST_ERROR + + /* Get and verify that one chunk had been written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, ONE_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Offset of the only chunk */ + offset[0] = 0; + offset[1] = 0; + + /* Get and verify info of the first and only chunk */ + if(verify_get_chunk_info(dset, H5S_ALL, 0, SINGLE_CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification H5Dget_chunk_info failed\n"); + + /* Get and verify info of the chunk at logical coordinates (0,0) */ + if(verify_get_chunk_info_by_coord(dset, offset, SINGLE_CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + + /* Attempt to get chunk info given an invalid chunk index and verify + * that failure occurs */ + chk_index = INVALID_CHK_INDEX; + reinit_vars(&read_flt_msk, &addr, &size); + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + TEST_ERROR + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_chunk_info_single_chunk() */ + +/*------------------------------------------------------------------------- + * Function: test_chunk_info_implicit + * + * Purpose: Test getting various chunk information when Implicit + * index type is used + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: November 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_chunk_info_implicit(char *filename, hid_t fapl) +{ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + unsigned flt_msk = 0; /* Filter mask */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + hsize_t start[2] = {START_CHK_X, START_CHK_Y}; /* Start position */ + hsize_t end[2] = {END_CHK_X, END_CHK_Y}; /* End position */ + + TESTING(" Implicit index"); + + /* Open the file for reading/writing */ + if((chunkfile = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, NULL)) < 0) + TEST_ERROR + + /* Enable chunking */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) + TEST_ERROR + + /* Set allocation time to early */ + if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY) < 0) + TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(chunkfile, IMPLICIT_INDEX_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Open the dataset again to test getting chunk info */ + if((dset = H5Dopen2(chunkfile, IMPLICIT_INDEX_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Verify chunk indexing scheme and number of chunks */ + if(verify_idx_nchunks(dset, dspace, H5D_CHUNK_IDX_NONE, NUM_CHUNKS) == FAIL) + FAIL_PUTS_ERROR("Verification and write failed\n"); + + /* Write NUM_CHUNKS_WRITTEN chunks at the following logical coords: + (0,2) (0,3) (1,2) (1,3) */ + if(write_selected_chunks(dset, H5P_DEFAULT, start, end, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Writing to selected chunks failed\n"); + + /* Go through all chunks, and get their info and verify the values */ + chk_index = 0; + for(ii = 0; ii < NX/CHUNK_NX; ii++) + for(jj = 0; jj < NY/CHUNK_NY; jj++, chk_index++) { + hsize_t offset[2] = {ii * CHUNK_NX, jj * CHUNK_NY}; + + if(verify_get_chunk_info(dset, H5S_ALL, chk_index, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + + /* Get info of a chunk and verify its information. Note that + all chunks in this dataset are allocated because of the property + H5D_ALLOC_TIME_EARLY */ + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + } + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Pclose(cparms) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_chunk_info_implicit() */ + +/*------------------------------------------------------------------------- + * Function: test_chunk_info_fixed_array + * + * Purpose: Test getting various chunk information when Fixed Array + * index type is used + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: November 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_chunk_info_fixed_array(const char *filename, hid_t fapl) +{ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t start[2] = {START_CHK_X, START_CHK_Y}; /* Start position */ + hsize_t end[2] = {END_CHK_X, END_CHK_Y}; /* End position */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING(" Fixed Array index"); + + /* Open the file for reading/writing */ + if((chunkfile = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, NULL)) < 0) + TEST_ERROR + + /* Enable chunking */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) + TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(chunkfile, FIXED_ARR_INDEX_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Open the dataset again to test getting chunk info */ + if((dset = H5Dopen2(chunkfile, FIXED_ARR_INDEX_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Verify chunk indexing scheme and number of chunks */ + if(verify_idx_nchunks(dset, dspace, H5D_CHUNK_IDX_FARRAY, NO_CHUNK_WRITTEN) == FAIL) + FAIL_PUTS_ERROR("Verification and write failed\n"); + + /* Write NUM_CHUNKS_WRITTEN chunks at the following logical coords: + (0,2) (0,3) (1,2) (1,3) */ + if(write_selected_chunks(dset, H5P_DEFAULT, start, end, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Writing to selected chunks failed\n"); + + /* Get and verify the number of chunks written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NUM_CHUNKS_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify info of each written chunk */ + chk_index = 0; + for(ii = START_CHK_X; ii < END_CHK_X; ii++) + for(jj = START_CHK_Y; jj < END_CHK_Y; jj++, chk_index++) { + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + if(verify_get_chunk_info(dset, dspace, chk_index, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + } + + /* Attempt to get info using an out-of-range index, chk_index is now > NUM_CHUNKS_WRITTEN. should fail */ + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempted to get info of a chunk using an out-of-range index."); + + /* Attempt to get info of empty chunks, verify the returned address and size */ + offset[0] = 0; + offset[1] = 0; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + offset[0] = 3 * CHUNK_NX; + offset[1] = 3 * CHUNK_NY; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + /* Read and verify values of selected chunks */ + if(verify_selected_chunks(dset, H5P_DEFAULT, start, end) < 0) + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_chunk_info_fixed_array() */ + +/*------------------------------------------------------------------------- + * Function: test_chunk_info_extensible_array + * + * Purpose: Test getting various chunk information when Extensible Array + * index type is used + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: November 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_chunk_info_extensible_array(const char *filename, hid_t fapl) +{ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + hsize_t maxdims[2] = {H5S_UNLIMITED, NY}; /* One unlimited dimension */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t start[2] = {START_CHK_X, START_CHK_Y}; /* Start position */ + hsize_t end[2] = {END_CHK_X, END_CHK_Y}; /* End position */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING(" Extensible Array index"); + + /* Open the file for reading/writing */ + if((chunkfile = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, maxdims)) < 0) + TEST_ERROR + + /* Enable chunking */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) + TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(chunkfile, EXT_ARR_INDEX_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Open the dataset again to test getting chunk info */ + if((dset = H5Dopen2(chunkfile, EXT_ARR_INDEX_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Verify chunk indexing scheme and number of chunks */ + if(verify_idx_nchunks(dset, dspace, H5D_CHUNK_IDX_EARRAY, NO_CHUNK_WRITTEN) == FAIL) + FAIL_PUTS_ERROR("Verification and write failed\n"); + + /* Write NUM_CHUNKS_WRITTEN chunks at the following logical coords: + (0,2) (0,3) (1,2) (1,3) */ + if(write_selected_chunks(dset, H5P_DEFAULT, start, end, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Writing to selected chunks failed\n"); + + /* Get and verify the number of chunks written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NUM_CHUNKS_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify info of each written chunk */ + chk_index = 0; + for(ii = START_CHK_X; ii < END_CHK_X; ii++) + for(jj = START_CHK_Y; jj < END_CHK_Y; jj++, chk_index++) { + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + + if(verify_get_chunk_info(dset, dspace, chk_index, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + } + + /* Attempt to get info using an out-of-range index, should fail */ + chk_index = OUTOFRANGE_CHK_INDEX; + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempted to get info of a chunk using an out-of-range index."); + + /* Attempt to get info of empty chunks, verify the returned address and size */ + offset[0] = 0; + offset[1] = 0; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + offset[0] = 3 * CHUNK_NX; + offset[1] = 3 * CHUNK_NY; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + /* Read and verify values of selected chunks */ + if(verify_selected_chunks(dset, H5P_DEFAULT, start, end) < 0) + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_chunk_info_extensible_array() */ + +/*------------------------------------------------------------------------- + * Function: test_chunk_info_version2_btrees + * + * Purpose: Test getting various chunk information when Version 2 B-trees + * index type is used + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: November 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_chunk_info_version2_btrees(const char *filename, hid_t fapl) +{ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t dims[2] = {NX, NY};/* Dataset dimensions */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Two unlimited dims */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t start[2] = {START_CHK_X, START_CHK_Y}; /* Start position */ + hsize_t end[2] = {END_CHK_X, END_CHK_Y}; /* End position */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING(" Version 2 B-trees index"); + + /* Open the file for reading/writing */ + if((chunkfile = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, maxdims)) < 0) + TEST_ERROR + + /* Enable chunking */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) + TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(chunkfile, V2_BTREE_INDEX_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Open the dataset again to test getting chunk info */ + if((dset = H5Dopen2(chunkfile, V2_BTREE_INDEX_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Verify chunk indexing scheme and number of chunks */ + if(verify_idx_nchunks(dset, dspace, H5D_CHUNK_IDX_BT2, NO_CHUNK_WRITTEN) == FAIL) + FAIL_PUTS_ERROR("Verification and write failed\n"); + + /* Write NUM_CHUNKS_WRITTEN chunks at the following logical coords: + (0,2) (0,3) (1,2) (1,3) */ + if(write_selected_chunks(dset, H5P_DEFAULT, start, end, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Writing to selected chunks failed\n"); + + /* Get and verify the number of chunks written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NUM_CHUNKS_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Go through all written chunks, get their info and verify the values */ + chk_index = 0; + for(ii = START_CHK_X; ii < END_CHK_X; ii++) + for(jj = START_CHK_Y; jj < END_CHK_Y; jj++, chk_index++) { + offset[0] = ii * CHUNK_NX; + offset[1] = jj * CHUNK_NY; + + if(verify_get_chunk_info(dset, dspace, chk_index, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + } + + /* Attempt to provide out-of-range offsets, should fail */ + chk_index = OUTOFRANGE_CHK_INDEX; + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempted to get info of a chunk using an out-of-range index."); + + /* Attempt to get info of empty chunks, verify the returned address and size */ + offset[0] = 0; + offset[1] = 0; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + offset[0] = 3 * CHUNK_NX; + offset[1] = 3 * CHUNK_NY; + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + /* Read and verify values of selected chunks */ + if(verify_selected_chunks(dset, H5P_DEFAULT, start, end) < 0) + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_chunk_info_version2_btrees() */ + +/*------------------------------------------------------------------------- + * Function: test_basic_query + * + * Purpose: Tests basic operations to ensure the chunk query functions + * work properly. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_basic_query(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; /* File name */ + hid_t basicfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + int direct_buf[CHUNK_NX][CHUNK_NY];/* Data in chunks */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING("basic operations"); + + /* Create the file */ + h5_fixname(BASIC_FILE, fapl, filename, sizeof filename); + + /* Create a new file. */ + if((basicfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, NULL)) < 0) + TEST_ERROR + + /* Enable chunking */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(cparms, RANK, chunk_dims) < 0) + TEST_ERROR + + /* Create a new dataset using cparms creation properties */ + dset = H5Dcreate2(basicfile, SIMPLE_CHUNKED_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Get the number of chunks and verify that no chunk has been written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, NO_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Initialize the array of chunk data for the single chunk */ + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + direct_buf[ii][jj] = (int)(ii*jj); + + /* Write the chunk of data */ + offset[0] = CHUNK_NX; + offset[1] = CHUNK_NY; + if(H5Dwrite_chunk(dset, H5P_DEFAULT, flt_msk, offset, CHK_SIZE, direct_buf) < 0) + TEST_ERROR; + + /* Get and verify that one chunk had been written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, ONE_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify info of the first and only chunk */ + if(verify_get_chunk_info(dset, H5S_ALL, 0, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification H5Dget_chunk_info failed\n"); + + /* Get and verify info of the chunk at the offset (CHUNK_NX,CHUNK_NY) */ + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + + /* Attempt to get chunk info given an invalid chunk index and verify + * that failure occurs */ + chk_index = INVALID_CHK_INDEX; + reinit_vars(&read_flt_msk, &addr, &size); + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + TEST_ERROR + + /* Write the chunk of data to another location */ + offset[0] = 0; + offset[1] = 0; + if(H5Dwrite_chunk(dset, H5P_DEFAULT, flt_msk, offset, CHK_SIZE, direct_buf) < 0) + TEST_ERROR; + + /* Get and verify that two chunks had been written */ + if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, TWO_CHUNKS_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify info of the first written chunk in the dataset, its + offset should be (0,0) */ + if(verify_get_chunk_info(dset, H5S_ALL, 0, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification H5Dget_chunk_info failed\n"); + + /* Get and verify info of the chunk at the offset (0,0) */ + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + + /* Get and verify info of the second written chunk in the dataset, its + offset should be (CHUNK_NX, CHUNK_NY) */ + offset[0] = CHUNK_NX; + offset[1] = CHUNK_NY; + if(verify_get_chunk_info(dset, H5S_ALL, 1, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification H5Dget_chunk_info failed\n"); + + /* Get and verify info of the chunk at the offset (CHUNK_NX, CHUNK_NY) */ + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + + /* Get and verify info of an empty chunk, at offset + (2*CHUNK_NX, 2*CHUNK_NY) */ + offset[0] = 2*CHUNK_NX; + offset[1] = 2*CHUNK_NY; + /* Get and verify info of the chunk at the offset (CHUNK_NX, CHUNK_NY) */ + if(verify_empty_chunk_info(dset, offset) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n"); + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Pclose(cparms) < 0) TEST_ERROR + if(H5Fclose(basicfile) < 0) TEST_ERROR + + /* Remove the test file */ + remove(filename); + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Pclose(cparms); + H5Fclose(basicfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_basic_query() */ + +/*------------------------------------------------------------------------- + * Function: test_failed_attempts + * + * Purpose: Test attempting to use chunk query functions incorrectly. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Date: August 2019 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_failed_attempts(const char *filename, hid_t fapl) +{ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dims[2] = {NX, NY};/* Dataset dimensions */ + int data_buf[NX][NY]; /* Input buffer */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2]; /* Offset coordinates of a chunk */ + hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ + hsize_t size = 0; /* Size of an allocated/written chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + haddr_t addr = 0; /* Address of an allocated/written chunk */ + hsize_t chk_index = 0; /* Index of a chunk */ + hsize_t ii, jj; /* Array indices */ + herr_t ret; /* Temporary returned value for verifying failure */ + + TESTING(" Invalid Operations"); + + /* Open the file for reading/writing */ + if((chunkfile = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + + /* Create dataspace */ + if((dspace = H5Screate_simple(RANK, dims, NULL)) < 0) + TEST_ERROR + + /* Create a contiguous dataset */ + dset = H5Dcreate2(chunkfile, CONTIGUOUS_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dset < 0) TEST_ERROR + + /* Initialize the array of data */ + for(ii = 0; ii < NX; ii++) + for(jj = 0; jj < NY; jj++) + data_buf[ii][jj] = (int)(ii*jj); + + /* Write the data */ + if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_buf) < 0) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(dset) < 0) TEST_ERROR + + /* Open it again to test the chunk query functions on contiguous dataset */ + if((dset = H5Dopen2(chunkfile, CONTIGUOUS_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Attempt to get the number of chunks on contiguous dataset, should fail */ + H5E_BEGIN_TRY { + ret = H5Dget_num_chunks(dset, dspace, &nchunks); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset.") + + /* Attempt to get chunk info on contiguous data, should fail */ + chk_index = 0; + reinit_vars(&read_flt_msk, &addr, &size); + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset.") + + /* Attempt to get chunk info at logical coordinates (0,0) on contiguous + * dataset, should fail */ + offset[0] = 0; + offset[1] = 0; + H5E_BEGIN_TRY { + ret = H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size); + } H5E_END_TRY; + if(ret != FAIL) + FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset.") + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(dspace); + H5Fclose(chunkfile); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_failed_attempts() */ + +/*------------------------------------------------------------------------- + * Function: test_get_chunk_info_v110 + * + * Purpose: Test getting various chunk information in version 1.10. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Note: Note that the dataspace argument in these new functions are + * currently not used. The functionality involved the dataspace + * will be implemented in the next version. + * + * Description: + * This function tests the new API functions added for HDFFV-10677: + * H5Dget_num_chunks, H5Dget_chunk_info, and + * H5Dget_chunk_info_by_coord for low bound beyond 1.8. + * + * Date: October 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_get_chunk_info_v110(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; /* File name */ + hid_t chunkfile = H5I_INVALID_HID; /* File ID */ + H5F_libver_t low, high; /* File format bounds */ + + TESTING("getting chunk information in file with versions 1.10 and later"); + HDprintf("\n"); /* to list sub-tests */ + + /* Set high bound to the current latest version */ + high = H5F_LIBVER_LATEST; + + /* Test getting info of chunked datasets in version combo up to 1.10 */ + for(low = H5F_LIBVER_V110; low <= H5F_LIBVER_LATEST; low++) { + /* Set version bounds for creating file */ + if(H5Pset_libver_bounds(fapl, low, high) < 0) + TEST_ERROR + + /* Create the file */ + h5_fixname(FILENAME[low], fapl, filename, sizeof filename); + chunkfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if(chunkfile < 0) TEST_ERROR + + /* Close the file, individual tests will re-open the file with different + libvers via the fapl */ + if(H5Fclose(chunkfile) < 0) TEST_ERROR + + /* Test getting chunk info when Single Chunk index type is used */ + if(test_chunk_info_single_chunk(filename, fapl) < 0) + TEST_ERROR + + /* Test getting chunk info when Implicit index type is used */ + if(test_chunk_info_implicit(filename, fapl) < 0) + TEST_ERROR + + /* Test getting chunk info when Fixed Array index type is used */ + if(test_chunk_info_fixed_array(filename, fapl) < 0) + TEST_ERROR + + /* Test getting chunk info when Extensible Array index type is used */ + if(test_chunk_info_extensible_array(filename, fapl) < 0) + TEST_ERROR + + /* Test getting chunk info when Version 2 B-trees index type is used */ + if(test_chunk_info_version2_btrees(filename, fapl) < 0) + TEST_ERROR + + /* Test various attempts to use the functions incorrectly */ + if(test_failed_attempts(filename, fapl) < 0) + TEST_ERROR + + } /* for low libver bound */ + + return SUCCEED; + +error: + H5_FAILED(); + return FAIL; +} /* test_get_chunk_info_v110() */ + +/*------------------------------------------------------------------------- + * Function: test_flt_msk_with_skip_compress + * + * Purpose: Test getting chunk info when compression filter is skipped. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Date: August 2019 (based on direct_chunk.c/test_skip_compress_write1) + * + *------------------------------------------------------------------------- + */ +static herr_t +test_flt_msk_with_skip_compress(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; /* File name */ + hid_t filter_file = H5I_INVALID_HID; /* File ID for filter mask */ + hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */ + hid_t mem_space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t cparms = H5I_INVALID_HID; /* Creation plist */ + hid_t dxpl = H5I_INVALID_HID; /* Transfer plist */ + hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */ + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* 2 unlimited dims */ + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */ + int direct_buf[CHUNK_NX][CHUNK_NY]; /* One chunk of data */ + int check_chunk[CHUNK_NX][CHUNK_NY]; /* Buffer to read data in */ + int read_direct_buf[CHUNK_NX][CHUNK_NY]; /* Buffer to read a chunk */ + hsize_t read_buf_size = 0; /* buf size */ + unsigned flt_msk = 0; /* Filter mask */ + unsigned read_flt_msk = 0; /* Filter mask after direct read */ + hsize_t offset[2] = {0, 0}; /* Offset coordinates of a chunk */ + hsize_t nchunks = 0; /* Number of chunks */ + hsize_t chk_index = 0; /* Index of a chunk */ + int aggression = 9; /* Compression aggression setting */ + hsize_t start[2]; /* Start of hyperslab */ + hsize_t stride[2]; /* Stride of hyperslab */ + hsize_t count[2]; /* Block count */ + hsize_t block[2]; /* Block sizes */ + int ii, jj; /* Array indices */ + + TESTING("getting filter mask when compression filter is skipped"); + + /* Create the file */ + h5_fixname(FILTERMASK_FILE, fapl, filename, sizeof filename); + + /* Create a new file. */ + if((filter_file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Create file data space with unlimited dimensions. */ + if((dspace = H5Screate_simple(RANK, dims, maxdims)) < 0) + TEST_ERROR; + + /* Create memory data space. */ + if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0) + TEST_ERROR; + + /* Create dataset create property list with chunking and compression + enabled. */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR; + + if(H5Pset_chunk( cparms, RANK, chunk_dims) < 0) + TEST_ERROR; + + if(H5Pset_deflate( cparms, (unsigned ) aggression) < 0) + TEST_ERROR; + + /* Create a new dataset using cparms creation properties. */ + if((dset = H5Dcreate2(filter_file, SKIP_FILTER_DSET_NAME, H5T_NATIVE_INT, dspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Create transfer property list for writing */ + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) + TEST_ERROR; + + /* Initialize data for one chunk */ + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + direct_buf[ii][jj] = (int)(ii*jj); + + /* Indicate the compression filter is to be skipped. */ + flt_msk = 0x00000001; + + /* Write a chunk of uncompressed data */ + offset[0] = CHUNK_NX; + offset[1] = CHUNK_NY; + if(H5Dwrite_chunk(dset, H5P_DEFAULT, flt_msk, offset, CHK_SIZE, direct_buf) < 0) + TEST_ERROR; + + if(H5Fflush(dset, H5F_SCOPE_LOCAL) < 0) + TEST_ERROR; + + /* Close and re-open the dataset */ + if(H5Dclose(dset) < 0) + TEST_ERROR; + if((dset = H5Dopen2(filter_file, SKIP_FILTER_DSET_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Select hyperslab for the chunk just written in the file */ + start[0] = CHUNK_NX; start[1] = CHUNK_NY; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = CHUNK_NX; block[1] = CHUNK_NY; + if(H5Sselect_hyperslab(dspace, H5S_SELECT_SET, start, stride, count, block) < 0) + TEST_ERROR; + + /* Read the chunk back */ + if(H5Dread(dset, H5T_NATIVE_INT, mem_space, dspace, H5P_DEFAULT, check_chunk) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + if(direct_buf[ii][jj] != check_chunk[ii][jj]) { + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", ii, jj); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[ii][jj], check_chunk[ii][jj]); + TEST_ERROR; + } + + /* Query chunk storage size */ + if(H5Dget_chunk_storage_size(dset, offset, &read_buf_size) < 0) + TEST_ERROR; + if(read_buf_size != CHK_SIZE) + TEST_ERROR; + + /* Read the raw chunk back with H5Dread_chunk */ + HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf)); + if(H5Dread_chunk(dset, H5P_DEFAULT, offset, &read_flt_msk, read_direct_buf) < 0) + TEST_ERROR; + if(read_flt_msk != flt_msk) + TEST_ERROR; + + /* Check that the direct chunk read is the same as the chunk written */ + for(ii = 0; ii < CHUNK_NX; ii++) + for(jj = 0; jj < CHUNK_NY; jj++) + if(direct_buf[ii][jj] != read_direct_buf[ii][jj]) { + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", ii, jj); + HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[ii][jj], read_direct_buf[ii][jj]); + TEST_ERROR; + } + + /* Get and verify the number of chunks written */ + if(H5Dget_num_chunks(dset, H5S_ALL, &nchunks) < 0) TEST_ERROR + VERIFY(nchunks, ONE_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + + /* Get and verify info of the first and only chunk */ + chk_index = 0; + offset[0] = CHUNK_NX; + offset[1] = CHUNK_NY; + if(verify_get_chunk_info(dset, H5S_ALL, chk_index, CHK_SIZE, offset, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info failed\n"); + + /* Get info of the chunk at the specified offsets and verify its info */ + if(verify_get_chunk_info_by_coord(dset, offset, CHK_SIZE, flt_msk) == FAIL) + FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord failed\n"); + + /* Release resourse */ + if(H5Dclose(dset) < 0) TEST_ERROR + if(H5Sclose(mem_space) < 0) TEST_ERROR + if(H5Sclose(dspace) < 0) TEST_ERROR + if(H5Pclose(cparms) < 0) TEST_ERROR + if(H5Pclose(dxpl) < 0) TEST_ERROR + if(H5Fclose(filter_file) < 0) TEST_ERROR + + /* Remove the test file */ + remove(filename); + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(mem_space); + H5Sclose(dspace); + H5Pclose(cparms); + H5Pclose(dxpl); + H5Fclose(filter_file); + } H5E_END_TRY; + + H5_FAILED(); + return FAIL; +} /* test_flt_msk_with_skip_compress() */ + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Tests functions related to chunk information + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Binh-Minh Ribler + * November 5, 2018 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + int nerrors = 0; /* Number of errors so far */ + + h5_reset(); + + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + /* Test basic operations on the chunk query functions */ + nerrors += test_basic_query(fapl) < 0 ? 1 : 0; + + /* Tests getting chunk information of version 1.8 and prior */ + nerrors += test_get_chunk_info_highest_v18(fapl) < 0 ? 1 : 0; + + /* Tests getting chunk information of version 1.10 */ + nerrors += test_get_chunk_info_v110(fapl) < 0 ? 1 : 0; + + /* Tests getting filter mask when compression filter is skipped */ + nerrors += test_flt_msk_with_skip_compress(fapl) < 0 ? 1 : 0; + + if(nerrors) + TEST_ERROR + + HDprintf("All chunk query tests passed.\n"); + + h5_cleanup(FILENAME, fapl); + + return SUCCEED; + +error: + nerrors = MAX(1, nerrors); + HDprintf("***** %d QUERY CHUNK INFO TEST%s FAILED! *****\n", + nerrors, 1 == nerrors ? "" : "S"); + return FAIL; +} + +/**************************************************************************** + Additional tests to be added: +- do the query when extending the dataset (shrink or expand) +- verify that invalid input parameters are handled properly + +****************************************************************************/ diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 22950e9..ff3767c 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -19,8 +19,8 @@ /* See H5private.h for how to include headers */ #undef NDEBUG -#define H5T_FRIEND /*suppress error about including H5Tpkg */ -#include "H5Tpkg.h" /*to turn off hardware conversions*/ +#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#include "H5Tpkg.h" /*to turn off hardware conversions*/ #include "H5Iprivate.h" #include "h5test.h" @@ -120,29 +120,29 @@ typedef struct { long long r, s, t; } stype4; -#define NX 100u -#define NY 2000u +#define NX 100u +#define NY 2000u #define PACK_NMEMBS 100 - + /*------------------------------------------------------------------------- - * Function: test_compound + * Function: test_compound * - * Purpose: Creates a simple dataset of a compound type and then reads - * it back. The dataset is read back in various ways to - * exercise the I/O pipeline and compound type conversion. + * Purpose: Creates a simple dataset of a compound type and then reads + * it back. The dataset is read back in various ways to + * exercise the I/O pipeline and compound type conversion. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 23, 1998 * * Modifications: - * Robb Matzke, 1999-06-23 - * If the command line switch `--noopt' is present then the fast - * compound datatype conversion is turned off. + * Robb Matzke, 1999-06-23 + * If the command line switch `--noopt' is present then the fast + * compound datatype conversion is turned off. * * Raymond Lu, 15 June 2007 * Moved this part of code from MAIN to TEST_COMPOUND function. @@ -152,53 +152,53 @@ static unsigned test_compound (char *filename, hid_t fapl) { /* First dataset */ - s1_t *s1 = NULL; - hid_t s1_tid; + s1_t *s1 = NULL; + hid_t s1_tid; /* Second dataset */ - s2_t *s2 = NULL; - hid_t s2_tid; + s2_t *s2 = NULL; + hid_t s2_tid; /* Third dataset */ - s3_t *s3 = NULL; - hid_t s3_tid; + s3_t *s3 = NULL; + hid_t s3_tid; /* Fourth dataset */ - s4_t *s4 = NULL; - hid_t s4_tid; + s4_t *s4 = NULL; + hid_t s4_tid; /* Fifth dataset */ - s5_t *s5 = NULL; - hid_t s5_tid; + s5_t *s5 = NULL; + hid_t s5_tid; /* Sixth dataset */ - s6_t *s6 = NULL; - hid_t s6_tid; + s6_t *s6 = NULL; + hid_t s6_tid; /* Seventh dataset */ - hid_t s7_sid; + hid_t s7_sid; /* Eighth dataset */ - s1_t *s8 = NULL; - hid_t s8_f_sid; /*file data space */ - hid_t s8_m_sid; /*memory data space */ + s1_t *s8 = NULL; + hid_t s8_f_sid; /*file data space */ + hid_t s8_m_sid; /*memory data space */ /* Ninth dataset */ /* Tenth dataset */ /* Eleventh dataset */ - s4_t *s11 = NULL; + s4_t *s11 = NULL; /* Other variables */ - unsigned int i, j; - hid_t file, dataset, space, PRESERVE; + unsigned int i, j; + hid_t file, dataset, space, PRESERVE; hid_t array_dt; - static hsize_t dim[] = {NX, NY}; - hsize_t f_offset[2]; /*offset of hyperslab in file */ - hsize_t h_size[2]; /*size of hyperslab */ - hsize_t memb_size[1] = {4}; - int ret_code; + static hsize_t dim[] = {NX, NY}; + hsize_t f_offset[2]; /*offset of hyperslab in file */ + hsize_t h_size[2]; /*size of hyperslab */ + hsize_t memb_size[1] = {4}; + int ret_code; /* Allocate buffers for datasets */ if(NULL == (s1 = (s1_t *)HDmalloc(sizeof(s1_t) * NX * NY))) @@ -216,7 +216,7 @@ test_compound (char *filename, hid_t fapl) /* Create the file */ if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { - goto error; + goto error; } /* Create the data space */ @@ -226,15 +226,15 @@ test_compound (char *filename, hid_t fapl) /* Also verify H5Pset_preserve is initially 0 and then is set to 1. */ if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto error; if ((ret_code=H5Pget_preserve (PRESERVE)) != 0){ - printf("Preserve status of dataset transfer property list should be" - " 0 (FALSE), got %d\n", ret_code); - goto error; + HDprintf("Preserve status of dataset transfer property list should be" + " 0 (FALSE), got %d\n", ret_code); + goto error; } if (H5Pset_preserve (PRESERVE, 1)<0) goto error; if ((ret_code=H5Pget_preserve (PRESERVE)) != 1){ - printf("Preserve status of dataset transfer property list should be" - " 1 (TRUE), got %d\n", ret_code); - goto error; + HDprintf("Preserve status of dataset transfer property list should be" + " 1 (TRUE), got %d\n", ret_code); + goto error; } /* @@ -245,14 +245,14 @@ test_compound (char *filename, hid_t fapl) /* Initialize the dataset */ for (i=0; i<NX*NY; i++) { - s1[i].a = 8*i+0; - s1[i].b = 2000+2*i; - s1[i].c[0] = 8*i+2; - s1[i].c[1] = 8*i+3; - s1[i].c[2] = 8*i+4; - s1[i].c[3] = 8*i+5; - s1[i].d = 2001+2*i; - s1[i].e = 8*i+7; + s1[i].a = 8*i+0; + s1[i].b = 2000+2*i; + s1[i].c[0] = 8*i+2; + s1[i].c[1] = 8*i+3; + s1[i].c[2] = 8*i+4; + s1[i].c[3] = 8*i+5; + s1[i].d = 2001+2*i; + s1[i].e = 8*i+7; } /* Create the memory data type */ @@ -269,19 +269,19 @@ test_compound (char *filename, hid_t fapl) /* Create the dataset */ if((dataset = H5Dcreate2(file, "s1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + goto error; /* Write the data */ if(H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) - goto error; + goto error; PASSED(); /* *###################################################################### * STEP 2: We create a new type ID for the second dataset even though - * it's the same as the first just to test things better, but - * in fact, we could have used s1_tid. + * it's the same as the first just to test things better, but + * in fact, we could have used s1_tid. */ TESTING("basic compound read"); @@ -299,31 +299,31 @@ test_compound (char *filename, hid_t fapl) /* Read the data */ if (H5Dread (dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s2) < 0) { - goto error; + goto error; } /* Compare s2 with s1. They should be the same */ for (i=0; i<NX*NY; i++) { - if (s1[i].a!=s2[i].a || - s1[i].b!=s2[i].b || - s1[i].c[0]!=s2[i].c[0] || - s1[i].c[1]!=s2[i].c[1] || - s1[i].c[2]!=s2[i].c[2] || - s1[i].c[3]!=s2[i].c[3] || - s1[i].d!=s2[i].d || - s1[i].e!=s2[i].e) { - H5_FAILED(); - puts(" Incorrect values read from the file"); - goto error; - } + if (s1[i].a!=s2[i].a || + s1[i].b!=s2[i].b || + s1[i].c[0]!=s2[i].c[0] || + s1[i].c[1]!=s2[i].c[1] || + s1[i].c[2]!=s2[i].c[2] || + s1[i].c[3]!=s2[i].c[3] || + s1[i].d!=s2[i].d || + s1[i].e!=s2[i].e) { + H5_FAILED(); + puts(" Incorrect values read from the file"); + goto error; + } } PASSED(); /* *###################################################################### * STEP 3: Read the dataset back into a third memory buffer. This buffer - * has the same data space but the data type is different: the - * data type is a struct whose members are in the opposite order. + * has the same data space but the data type is different: the + * data type is a struct whose members are in the opposite order. */ TESTING("reversal of struct members"); @@ -341,23 +341,23 @@ test_compound (char *filename, hid_t fapl) /* Read the data */ if (H5Dread (dataset, s3_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s3) < 0) { - goto error; + goto error; } /* Compare s3 with s1. They should be the same */ for (i=0; i<NX*NY; i++) { - if (s1[i].a!=s3[i].a || - s1[i].b!=s3[i].b || - s1[i].c[0]!=s3[i].c[0] || - s1[i].c[1]!=s3[i].c[1] || - s1[i].c[2]!=s3[i].c[2] || - s1[i].c[3]!=s3[i].c[3] || - s1[i].d!=s3[i].d || - s1[i].e!=s3[i].e) { - H5_FAILED(); - puts(" Incorrect values read from the file"); - goto error; - } + if (s1[i].a!=s3[i].a || + s1[i].b!=s3[i].b || + s1[i].c[0]!=s3[i].c[0] || + s1[i].c[1]!=s3[i].c[1] || + s1[i].c[2]!=s3[i].c[2] || + s1[i].c[3]!=s3[i].c[3] || + s1[i].d!=s3[i].d || + s1[i].e!=s3[i].e) { + H5_FAILED(); + puts(" Incorrect values read from the file"); + goto error; + } } PASSED(); @@ -375,33 +375,33 @@ test_compound (char *filename, hid_t fapl) /* Read the data */ if (H5Dread (dataset, s4_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s4) < 0) { - goto error; + goto error; } /* Compare s4 with s1 */ for (i=0; i<NX*NY; i++) { - if (s1[i].b!=s4[i].b || - s1[i].d!=s4[i].d) { - H5_FAILED(); - puts(" Incorrect values read from the file"); - goto error; - } + if (s1[i].b!=s4[i].b || + s1[i].d!=s4[i].d) { + H5_FAILED(); + puts(" Incorrect values read from the file"); + goto error; + } } PASSED(); /* *###################################################################### * STEP 5: Read all the members into a struct which has other members - * which have already been initialized. + * which have already been initialized. */ TESTING("partially initialized superset read"); /* Initialize some members */ for (i=0; i<NX*NY; i++) { - s5[i].pre = 1000+4*i; - s5[i].mid1 = 1001+4*i; - s5[i].mid2 = 1002+4*i; - s5[i].post = 1003+4*i; + s5[i].pre = 1000+4*i; + s5[i].mid1 = 1001+4*i; + s5[i].mid2 = 1002+4*i; + s5[i].post = 1003+4*i; } /* Create a data type for s5 */ @@ -418,42 +418,42 @@ test_compound (char *filename, hid_t fapl) /* Read the data */ if (H5Dread (dataset, s5_tid, H5S_ALL, H5S_ALL, PRESERVE, s5) < 0) { - goto error; + goto error; } /* Check that the data was read properly */ for (i=0; i<NX*NY; i++) { - if (s1[i].a!=s5[i].a || - s1[i].b!=s5[i].b || - s1[i].c[0]!=s5[i].c[0] || - s1[i].c[1]!=s5[i].c[1] || - s1[i].c[2]!=s5[i].c[2] || - s1[i].c[3]!=s5[i].c[3] || - s1[i].d!=s5[i].d || - s1[i].e!=s5[i].e) { - H5_FAILED(); - puts(" Incorrect values read from the file"); - goto error; - } + if (s1[i].a!=s5[i].a || + s1[i].b!=s5[i].b || + s1[i].c[0]!=s5[i].c[0] || + s1[i].c[1]!=s5[i].c[1] || + s1[i].c[2]!=s5[i].c[2] || + s1[i].c[3]!=s5[i].c[3] || + s1[i].d!=s5[i].d || + s1[i].e!=s5[i].e) { + H5_FAILED(); + puts(" Incorrect values read from the file"); + goto error; + } } /* Check that no previous values were clobbered */ for (i=0; i<NX*NY; i++) { - if (s5[i].pre != 1000+4*i || - s5[i].mid1 != 1001+4*i || - s5[i].mid2 != 1002+4*i || - s5[i].post != 1003+4*i) { - H5_FAILED(); - puts(" Memory values were clobbered"); - goto error; - } + if (s5[i].pre != 1000+4*i || + s5[i].mid1 != 1001+4*i || + s5[i].mid2 != 1002+4*i || + s5[i].post != 1003+4*i) { + H5_FAILED(); + puts(" Memory values were clobbered"); + goto error; + } } PASSED(); /* *###################################################################### * STEP 6: Read all the members into a struct which has other members - * which have already been initialized. This is to test the + * which have already been initialized. This is to test the * optimization for the Chicago company. The optimization is * for the special case when the source members are a subset of * destination, and the order is the same, and no conversion @@ -470,10 +470,10 @@ test_compound (char *filename, hid_t fapl) /* Initialize some members */ for (i=0; i<NX*NY; i++) { - s6[i].pre = 1000+4*i; - s6[i].mid1 = 1001+4*i; - s6[i].mid2 = 1002+4*i; - s6[i].post = 1003+4*i; + s6[i].pre = 1000+4*i; + s6[i].mid1 = 1001+4*i; + s6[i].mid2 = 1002+4*i; + s6[i].post = 1003+4*i; } /* Create a data type for s6 */ @@ -494,35 +494,35 @@ test_compound (char *filename, hid_t fapl) /* Read the data */ if (H5Dread (dataset, s6_tid, H5S_ALL, H5S_ALL, PRESERVE, s6) < 0) { - goto error; + goto error; } /* Check that the data was read properly */ for (i=0; i<NX*NY; i++) { - if (s1[i].a!=s6[i].a || - s1[i].b!=s6[i].b || - s1[i].c[0]!=s6[i].c[0] || - s1[i].c[1]!=s6[i].c[1] || - s1[i].c[2]!=s6[i].c[2] || - s1[i].c[3]!=s6[i].c[3] || - s1[i].d!=s6[i].d || - s1[i].e!=s6[i].e) { - H5_FAILED(); - puts(" Incorrect values read from the file"); - goto error; - } + if (s1[i].a!=s6[i].a || + s1[i].b!=s6[i].b || + s1[i].c[0]!=s6[i].c[0] || + s1[i].c[1]!=s6[i].c[1] || + s1[i].c[2]!=s6[i].c[2] || + s1[i].c[3]!=s6[i].c[3] || + s1[i].d!=s6[i].d || + s1[i].e!=s6[i].e) { + H5_FAILED(); + puts(" Incorrect values read from the file"); + goto error; + } } /* Check that no previous values were clobbered */ for (i=0; i<NX*NY; i++) { - if (s6[i].pre != 1000+4*i || - s6[i].mid1 != 1001+4*i || - s6[i].mid2 != 1002+4*i || - s6[i].post != 1003+4*i) { - H5_FAILED(); - puts(" Memory values were clobbered"); - goto error; - } + if (s6[i].pre != 1000+4*i || + s6[i].mid1 != 1001+4*i || + s6[i].mid2 != 1002+4*i || + s6[i].post != 1003+4*i) { + H5_FAILED(); + puts(" Memory values were clobbered"); + goto error; + } } PASSED(); @@ -531,45 +531,45 @@ test_compound (char *filename, hid_t fapl) *###################################################################### * STEP 7: Update fields `b' and `d' on the file leaving the other * fields unchanged. This tests member alignment and background - * buffers. + * buffers. */ TESTING("partially initialized superset write"); /* Initialize `s4' with new values */ for (i=0; i<NX*NY; i++) { - s4[i].b = 8*i+1; - s4[i].d = 8*i+6; + s4[i].b = 8*i+1; + s4[i].d = 8*i+6; } /* Write the data to file */ if (H5Dwrite (dataset, s4_tid, H5S_ALL, H5S_ALL, PRESERVE, s4) < 0) { - goto error; + goto error; } /* Read the data back */ if (H5Dread (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) { - goto error; + goto error; } /* Compare */ for (i=0; i<NX*NY; i++) { - if (s1[i].a != 8*i+0 || - s1[i].b != 8*i+1 || - s1[i].c[0] != 8*i+2 || - s1[i].c[1] != 8*i+3 || - s1[i].c[2] != 8*i+4 || - s1[i].c[3] != 8*i+5 || - s1[i].d != 8*i+6 || - s1[i].e != 8*i+7) { - H5_FAILED(); - printf(" i==%u, row=%u, col=%u\n", i, i/NY, i%NY); - printf(" got: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n", - s1[i].a, s1[i].b, s1[i].c[0], s1[i].c[1], s1[i].c[2], - s1[i].c[3], s1[i].d, s1[i].e); - printf(" ans: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n", - 8*i+0, 8*i+1, 8*i+2, 8*i+3, 8*i+4, 8*i+5, 8*i+6, 8*i+7); - goto error; - } + if (s1[i].a != 8*i+0 || + s1[i].b != 8*i+1 || + s1[i].c[0] != 8*i+2 || + s1[i].c[1] != 8*i+3 || + s1[i].c[2] != 8*i+4 || + s1[i].c[3] != 8*i+5 || + s1[i].d != 8*i+6 || + s1[i].e != 8*i+7) { + H5_FAILED(); + HDprintf(" i==%u, row=%u, col=%u\n", i, i/NY, i%NY); + HDprintf(" got: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n", + s1[i].a, s1[i].b, s1[i].c[0], s1[i].c[1], s1[i].c[2], + s1[i].c[3], s1[i].d, s1[i].e); + HDprintf(" ans: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n", + 8*i+0, 8*i+1, 8*i+2, 8*i+3, 8*i+4, 8*i+5, 8*i+6, 8*i+7); + goto error; + } } PASSED(); @@ -586,23 +586,23 @@ test_compound (char *filename, hid_t fapl) /* Read the dataset */ if (H5Dread (dataset, s2_tid, s7_sid, H5S_ALL, H5P_DEFAULT, s2) < 0) { - goto error; + goto error; } /* Compare */ for (i=0; i<NX*NY; i++) { - if (s2[i].a != s1[i].a || - s2[i].b != s1[i].b || - s2[i].c[0] != s1[i].c[0] || - s2[i].c[1] != s1[i].c[1] || - s2[i].c[2] != s1[i].c[2] || - s2[i].c[3] != s1[i].c[3] || - s2[i].d != s1[i].d || - s2[i].e != s1[i].e) { - H5_FAILED(); - puts(" Incorrect values read from file"); - goto error; - } + if (s2[i].a != s1[i].a || + s2[i].b != s1[i].b || + s2[i].c[0] != s1[i].c[0] || + s2[i].c[1] != s1[i].c[1] || + s2[i].c[2] != s1[i].c[2] || + s2[i].c[3] != s1[i].c[3] || + s2[i].d != s1[i].d || + s2[i].e != s1[i].e) { + H5_FAILED(); + puts(" Incorrect values read from file"); + goto error; + } } PASSED(); @@ -621,7 +621,7 @@ test_compound (char *filename, hid_t fapl) h_size[0] = 2*NX/3 - f_offset[0]; h_size[1] = 2*NY/3 - f_offset[1]; if (H5Sselect_hyperslab (s8_f_sid, H5S_SELECT_SET, f_offset, NULL, - h_size, NULL) < 0) goto error; + h_size, NULL) < 0) goto error; /* Create memory data space */ if ((s8_m_sid = H5Screate_simple (2, h_size, NULL)) < 0) goto error; @@ -630,28 +630,28 @@ test_compound (char *filename, hid_t fapl) s8 = (s1_t *) HDcalloc ((size_t)(h_size[0]*h_size[1]), sizeof(s1_t)); assert (s8); if (H5Dread (dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) { - goto error; + goto error; } /* Compare */ for (i=0; i<h_size[0]; i++) { - for (j=0; j<h_size[1]; j++) { - s1_t *ps1 = s1 + (f_offset[0]+i)*NY + f_offset[1] + j; - s1_t *ps8 = s8 + i*h_size[1] + j; - - if (ps8->a != ps1->a || - ps8->b != ps1->b || - ps8->c[0] != ps1->c[0] || - ps8->c[1] != ps1->c[1] || - ps8->c[2] != ps1->c[2] || - ps8->c[3] != ps1->c[3] || - ps8->d != ps1->d || - ps8->e != ps1->e) { - H5_FAILED(); - puts(" Incorrect values read from file"); - goto error; - } - } + for (j=0; j<h_size[1]; j++) { + s1_t *ps1 = s1 + (f_offset[0]+i)*NY + f_offset[1] + j; + s1_t *ps8 = s8 + i*h_size[1] + j; + + if (ps8->a != ps1->a || + ps8->b != ps1->b || + ps8->c[0] != ps1->c[0] || + ps8->c[1] != ps1->c[1] || + ps8->c[2] != ps1->c[2] || + ps8->c[3] != ps1->c[3] || + ps8->d != ps1->d || + ps8->e != ps1->e) { + H5_FAILED(); + puts(" Incorrect values read from file"); + goto error; + } + } } HDfree (s8); @@ -668,51 +668,51 @@ test_compound (char *filename, hid_t fapl) /* Initialize */ for (i=0; i<NX*NY; i++) { - s2[i].a = s2[i].b = s2[i].d = s2[i].e = (unsigned)(-1); - s2[i].c[0] = s2[i].c[1] = s2[i].c[2] = s2[i].c[3] = (unsigned)(-1); + s2[i].a = s2[i].b = s2[i].d = s2[i].e = (unsigned)(-1); + s2[i].c[0] = s2[i].c[1] = s2[i].c[2] = s2[i].c[3] = (unsigned)(-1); } /* Read the hyperslab */ if (H5Dread (dataset, s2_tid, s8_f_sid, s8_f_sid, H5P_DEFAULT, s2) < 0) { - goto error; + goto error; } /* Compare */ for (i=0; i<NX; i++) { - for (j=0; j<NY; j++) { - s1_t *ps1 = s1 + i*NY + j; - s2_t *ps2 = s2 + i*NY + j; - if (i>=f_offset[0] && - i<f_offset[0]+h_size[0] && - j>=f_offset[1] && - j<f_offset[1]+h_size[1]) { - if (ps2->a != ps1->a || - ps2->b != ps1->b || - ps2->c[0] != ps1->c[0] || - ps2->c[1] != ps1->c[1] || - ps2->c[2] != ps1->c[2] || - ps2->c[3] != ps1->c[3] || - ps2->d != ps1->d || - ps2->e != ps1->e) { - H5_FAILED(); - puts(" Memory values clobbered"); - goto error; - } - } else { - if (ps2->a != (unsigned)(-1) || - ps2->b != (unsigned)(-1) || - ps2->c[0] != (unsigned)(-1) || - ps2->c[1] != (unsigned)(-1) || - ps2->c[2] != (unsigned)(-1) || - ps2->c[3] != (unsigned)(-1) || - ps2->d != (unsigned)(-1) || - ps2->e != (unsigned)(-1)) { - H5_FAILED(); - puts(" Incorrect values read from file"); - goto error; - } - } - } + for (j=0; j<NY; j++) { + s1_t *ps1 = s1 + i*NY + j; + s2_t *ps2 = s2 + i*NY + j; + if (i>=f_offset[0] && + i<f_offset[0]+h_size[0] && + j>=f_offset[1] && + j<f_offset[1]+h_size[1]) { + if (ps2->a != ps1->a || + ps2->b != ps1->b || + ps2->c[0] != ps1->c[0] || + ps2->c[1] != ps1->c[1] || + ps2->c[2] != ps1->c[2] || + ps2->c[3] != ps1->c[3] || + ps2->d != ps1->d || + ps2->e != ps1->e) { + H5_FAILED(); + puts(" Memory values clobbered"); + goto error; + } + } else { + if (ps2->a != (unsigned)(-1) || + ps2->b != (unsigned)(-1) || + ps2->c[0] != (unsigned)(-1) || + ps2->c[1] != (unsigned)(-1) || + ps2->c[2] != (unsigned)(-1) || + ps2->c[3] != (unsigned)(-1) || + ps2->d != (unsigned)(-1) || + ps2->e != (unsigned)(-1)) { + H5_FAILED(); + puts(" Incorrect values read from file"); + goto error; + } + } + } } PASSED(); @@ -725,60 +725,60 @@ test_compound (char *filename, hid_t fapl) /* Initialize */ for (i=0; i<NX*NY; i++) { - s5[i].a = s5[i].b = s5[i].d = s5[i].e = (unsigned)(-1); - s5[i].c[0] = s5[i].c[1] = s5[i].c[2] = s5[i].c[3] = (unsigned)(-1); - s5[i].pre = s5[i].mid1 = s5[i].mid2 = s5[i].post = (unsigned)(-1); + s5[i].a = s5[i].b = s5[i].d = s5[i].e = (unsigned)(-1); + s5[i].c[0] = s5[i].c[1] = s5[i].c[2] = s5[i].c[3] = (unsigned)(-1); + s5[i].pre = s5[i].mid1 = s5[i].mid2 = s5[i].post = (unsigned)(-1); } /* Read the hyperslab */ if (H5Dread (dataset, s5_tid, s8_f_sid, s8_f_sid, PRESERVE, s5) < 0) { - goto error; + goto error; } /* Compare */ for (i=0; i<NX; i++) { - for (j=0; j<NY; j++) { - s1_t *ps1 = s1 + i*NY + j; - s5_t *ps5 = s5 + i*NY + j; - if (i>=f_offset[0] && - i<f_offset[0]+h_size[0] && - j>=f_offset[1] && - j<f_offset[1]+h_size[1]) { - if (ps5->pre != (unsigned)(-1) || - ps5->a != ps1->a || - ps5->b != ps1->b || - ps5->mid1 != (unsigned)(-1) || - ps5->c[0] != ps1->c[0] || - ps5->c[1] != ps1->c[1] || - ps5->c[2] != ps1->c[2] || - ps5->c[3] != ps1->c[3] || - ps5->mid2 != (unsigned)(-1) || - ps5->d != ps1->d || - ps5->e != ps1->e || - ps5->post != (unsigned)(-1)) { - H5_FAILED(); - puts(" Memory values clobbered"); - goto error; - } - } else { - if (ps5->pre != (unsigned)(-1) || - ps5->a != (unsigned)(-1) || - ps5->b != (unsigned)(-1) || - ps5->mid1 != (unsigned)(-1) || - ps5->c[0] != (unsigned)(-1) || - ps5->c[1] != (unsigned)(-1) || - ps5->c[2] != (unsigned)(-1) || - ps5->c[3] != (unsigned)(-1) || - ps5->mid2 != (unsigned)(-1) || - ps5->d != (unsigned)(-1) || - ps5->e != (unsigned)(-1) || - ps5->post != (unsigned)(-1)) { - H5_FAILED(); - puts(" Incorrect values read from file"); - goto error; - } - } - } + for (j=0; j<NY; j++) { + s1_t *ps1 = s1 + i*NY + j; + s5_t *ps5 = s5 + i*NY + j; + if (i>=f_offset[0] && + i<f_offset[0]+h_size[0] && + j>=f_offset[1] && + j<f_offset[1]+h_size[1]) { + if (ps5->pre != (unsigned)(-1) || + ps5->a != ps1->a || + ps5->b != ps1->b || + ps5->mid1 != (unsigned)(-1) || + ps5->c[0] != ps1->c[0] || + ps5->c[1] != ps1->c[1] || + ps5->c[2] != ps1->c[2] || + ps5->c[3] != ps1->c[3] || + ps5->mid2 != (unsigned)(-1) || + ps5->d != ps1->d || + ps5->e != ps1->e || + ps5->post != (unsigned)(-1)) { + H5_FAILED(); + puts(" Memory values clobbered"); + goto error; + } + } else { + if (ps5->pre != (unsigned)(-1) || + ps5->a != (unsigned)(-1) || + ps5->b != (unsigned)(-1) || + ps5->mid1 != (unsigned)(-1) || + ps5->c[0] != (unsigned)(-1) || + ps5->c[1] != (unsigned)(-1) || + ps5->c[2] != (unsigned)(-1) || + ps5->c[3] != (unsigned)(-1) || + ps5->mid2 != (unsigned)(-1) || + ps5->d != (unsigned)(-1) || + ps5->e != (unsigned)(-1) || + ps5->post != (unsigned)(-1)) { + H5_FAILED(); + puts(" Incorrect values read from file"); + goto error; + } + } + } } PASSED(); @@ -799,56 +799,56 @@ test_compound (char *filename, hid_t fapl) /* Initialize */ for (i=0; i<h_size[0]*h_size[1]; i++) { - s11[i].b = s11[i].d = (unsigned)(-1); + s11[i].b = s11[i].d = (unsigned)(-1); } /* Write to disk */ if (H5Dwrite (dataset, s4_tid, s8_m_sid, s8_f_sid, PRESERVE, s11) < 0) { - goto error; + goto error; } HDfree (s11); s11=NULL; /* Read the whole thing */ if (H5Dread (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) { - goto error; + goto error; } /* Compare */ for (i=0; i<NX; i++) { - for (j=0; j<NY; j++) { - s1_t *ps1 = s1 + i*NY + j; - - if (ps1->a != 8*(i*NY+j)+0 || - ps1->c[0] != 8*(i*NY+j)+2 || - ps1->c[1] != 8*(i*NY+j)+3 || - ps1->c[2] != 8*(i*NY+j)+4 || - ps1->c[3] != 8*(i*NY+j)+5 || - ps1->e != 8*(i*NY+j)+7) { - H5_FAILED(); - puts(" Write clobbered values"); - goto error; - } - - if (i>=f_offset[0] && - i<f_offset[0]+h_size[0] && - j>=f_offset[1] && - j<f_offset[1]+h_size[1]) { - if (ps1->b != (unsigned)(-1) || - ps1->d != (unsigned)(-1)) { - H5_FAILED(); - puts(" Wrong values written or read"); - goto error; - } - } else { - if (ps1->b != 8*(i*NY+j)+1 || - ps1->d != 8*(i*NY+j)+6) { - H5_FAILED(); - puts(" Write clobbered values"); - goto error; - } - } - } + for (j=0; j<NY; j++) { + s1_t *ps1 = s1 + i*NY + j; + + if (ps1->a != 8*(i*NY+j)+0 || + ps1->c[0] != 8*(i*NY+j)+2 || + ps1->c[1] != 8*(i*NY+j)+3 || + ps1->c[2] != 8*(i*NY+j)+4 || + ps1->c[3] != 8*(i*NY+j)+5 || + ps1->e != 8*(i*NY+j)+7) { + H5_FAILED(); + puts(" Write clobbered values"); + goto error; + } + + if (i>=f_offset[0] && + i<f_offset[0]+h_size[0] && + j>=f_offset[1] && + j<f_offset[1]+h_size[1]) { + if (ps1->b != (unsigned)(-1) || + ps1->d != (unsigned)(-1)) { + H5_FAILED(); + puts(" Wrong values written or read"); + goto error; + } + } else { + if (ps1->b != 8*(i*NY+j)+1 || + ps1->d != 8*(i*NY+j)+6) { + H5_FAILED(); + puts(" Write clobbered values"); + goto error; + } + } + } } /* @@ -873,29 +873,29 @@ error: puts("*** DATASET TESTS FAILED ***"); /* Release resources */ - if(s1) + if(s1) HDfree(s1); - if(s2) + if(s2) HDfree(s2); - if(s3) + if(s3) HDfree(s3); - if(s4) + if(s4) HDfree(s4); - if(s5) + if(s5) HDfree(s5); - if(s6) + if(s6) HDfree(s6); return 1; } - + /*------------------------------------------------------------------------- - * Function: initialize_stype1 + * Function: initialize_stype1 * - * Purpose: Initialize data buffer. + * Purpose: Initialize data buffer. * - * Return: void + * Return: void * * Programmer: Raymond Lu * Friday, 15 June 2007 @@ -906,22 +906,22 @@ error: static void initialize_stype1(unsigned char *buf, size_t num) { - int i, j; + int i, j; stype1 *s_ptr; for(i = 0; i < (int)num; i++) { - s_ptr = (stype1 *)((void *)buf) + i; - s_ptr->a = i * 8 + 0; - s_ptr->b = i * 8 + 1; + s_ptr = (stype1 *)((void *)buf) + i; + s_ptr->a = i * 8 + 0; + s_ptr->b = i * 8 + 1; for(j = 0; j < 8; j++) - s_ptr->c[j] = i * 8 + j; - s_ptr->d = i * 8 + 6; - s_ptr->e = i * 8 + 7; + s_ptr->c[j] = i * 8 + j; + s_ptr->d = i * 8 + 6; + s_ptr->e = i * 8 + 7; s_ptr->f = (float)(i * 2 / 3); s_ptr->g = (float)(i * 2 / 3 + 1); for(j = 0; j < 16; j++) - s_ptr->h[j] = (float)(i * j / 5 + j); + s_ptr->h[j] = (float)(i * j / 5 + j); s_ptr->i = (float)(i * 2 / 3 + 2); s_ptr->j = (float)(i * 2 / 3 + 3); @@ -932,13 +932,13 @@ initialize_stype1(unsigned char *buf, size_t num) } } - + /*------------------------------------------------------------------------- - * Function: initialize_stype2 + * Function: initialize_stype2 * - * Purpose: Initialize data buffer. + * Purpose: Initialize data buffer. * - * Return: void + * Return: void * * Programmer: Raymond Lu * Friday, 15 June 2007 @@ -953,18 +953,18 @@ initialize_stype2(unsigned char *buf, size_t num) stype2 *s_ptr; for(i = 0; i < num; i++) { - s_ptr = (stype2 *)((void *)buf) + i; - s_ptr->a = (int)(i * 8 + 0); - s_ptr->b = (int)(i * 8 + 1); + s_ptr = (stype2 *)((void *)buf) + i; + s_ptr->a = (int)(i * 8 + 0); + s_ptr->b = (int)(i * 8 + 1); for(j = 0; j < 8; j++) - s_ptr->c[j] = (int)(i * 8 + j); - s_ptr->d = (int)(i * 8 + 6); - s_ptr->e = (int)(i * 8 + 7); + s_ptr->c[j] = (int)(i * 8 + j); + s_ptr->d = (int)(i * 8 + 6); + s_ptr->e = (int)(i * 8 + 7); s_ptr->f = (float)(i * 2 / 3); s_ptr->g = (float)(i * 2 / 3 + 1); for(j = 0; j < 16; j++) - s_ptr->h[j] = (float)(i * j / 5 + j); + s_ptr->h[j] = (float)(i * j / 5 + j); s_ptr->i = (float)(i * 2 / 3 + 2); s_ptr->j = (float)(i * 2 / 3 + 3); @@ -979,13 +979,13 @@ initialize_stype2(unsigned char *buf, size_t num) } } - + /*------------------------------------------------------------------------- - * Function: initialize_stype3 + * Function: initialize_stype3 * - * Purpose: Initialize data buffer. + * Purpose: Initialize data buffer. * - * Return: Success: + * Return: Success: * * Programmer: Raymond Lu * Friday, 15 June 2007 @@ -996,27 +996,27 @@ initialize_stype2(unsigned char *buf, size_t num) static void initialize_stype3(unsigned char *buf, size_t num) { - int i, j; + int i, j; stype3 *s_ptr; for(i = 0; i < (int)num; i++) { - s_ptr = (stype3 *)((void *)buf) + i; - s_ptr->a = i * 8 + 0; - s_ptr->b = i * 8 + 1; + s_ptr = (stype3 *)((void *)buf) + i; + s_ptr->a = i * 8 + 0; + s_ptr->b = i * 8 + 1; for(j = 0; j < 8; j++) - s_ptr->c[j] = i * 8 + j; - s_ptr->d = i * 8 + 6; - s_ptr->e = i * 8 + 7; + s_ptr->c[j] = i * 8 + j; + s_ptr->d = i * 8 + 6; + s_ptr->e = i * 8 + 7; } } - + /*------------------------------------------------------------------------- - * Function: initialize_stype4 + * Function: initialize_stype4 * - * Purpose: Initialize data buffer. + * Purpose: Initialize data buffer. * - * Return: void + * Return: void * * Programmer: Raymond Lu * Friday, 15 June 2007 @@ -1031,18 +1031,18 @@ initialize_stype4(unsigned char *buf, size_t num) stype4 *s_ptr; for(i = 0; i < num; i++) { - s_ptr = (stype4 *)((void *)buf) + i; - s_ptr->a = (int)(i * 8 + 0); - s_ptr->b = (int)(i * 8 + 1); + s_ptr = (stype4 *)((void *)buf) + i; + s_ptr->a = (int)(i * 8 + 0); + s_ptr->b = (int)(i * 8 + 1); for(j = 0; j < 8; j++) - s_ptr->c[j] = (int)(i * 8 + j); - s_ptr->d = (int)(i * 8 + 6); - s_ptr->e = (int)(i * 8 + 7); + s_ptr->c[j] = (int)(i * 8 + j); + s_ptr->d = (int)(i * 8 + 6); + s_ptr->e = (int)(i * 8 + 7); s_ptr->f = (float)(i * 2 / 3); s_ptr->g = (float)(i * 2 / 3 + 1); for(j = 0; j < 16; j++) - s_ptr->h[j] = (float)(i * j / 5 + j); + s_ptr->h[j] = (float)(i * j / 5 + j); s_ptr->i = (float)(i * 2 / 3 + 2); s_ptr->j = (float)(i * 2 / 3 + 3); @@ -1061,13 +1061,13 @@ initialize_stype4(unsigned char *buf, size_t num) } } - + /*------------------------------------------------------------------------- - * Function: create_stype1 + * Function: create_stype1 * - * Purpose: Create HDF5 compound datatype for stype1. + * Purpose: Create HDF5 compound datatype for stype1. * - * Return: Success: datatype ID + * Return: Success: datatype ID * * Failure: negative * @@ -1081,7 +1081,7 @@ static hid_t create_stype1(void) { hid_t array_dt1, array_dt2, tid; - const hsize_t eight = 8, sixteen = 16; + const hsize_t eight = 8, sixteen = 16; /* Build hdf5 datatypes */ if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0) @@ -1117,13 +1117,13 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: create_stype2 + * Function: create_stype2 * - * Purpose: Create HDF5 compound datatype for stype2. + * Purpose: Create HDF5 compound datatype for stype2. * - * Return: Success: datatype ID + * Return: Success: datatype ID * * Failure: negative * @@ -1137,7 +1137,7 @@ static hid_t create_stype2(void) { hid_t array_dt1, array_dt2, tid; - const hsize_t eight = 8, sixteen = 16; + const hsize_t eight = 8, sixteen = 16; /* Build hdf5 datatypes */ if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0) @@ -1176,13 +1176,13 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: create_stype3 + * Function: create_stype3 * - * Purpose: Create HDF5 compound datatype for stype3. + * Purpose: Create HDF5 compound datatype for stype3. * - * Return: Success: datatype ID + * Return: Success: datatype ID * * Failure: negative * @@ -1196,7 +1196,7 @@ static hid_t create_stype3(void) { hid_t array_dt1, tid; - const hsize_t eight = 8; + const hsize_t eight = 8; /* Build hdf5 datatypes */ if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0) @@ -1219,13 +1219,13 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: create_stype4 + * Function: create_stype4 * - * Purpose: Create HDF5 compound datatype for stype4. + * Purpose: Create HDF5 compound datatype for stype4. * - * Return: Success: datatype ID + * Return: Success: datatype ID * * Failure: negative * @@ -1239,7 +1239,7 @@ static hid_t create_stype4(void) { hid_t array_dt1, array_dt2, tid; - const hsize_t eight = 8, sixteen = 16; + const hsize_t eight = 8, sixteen = 16; /* Build hdf5 datatypes */ if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0) @@ -1281,13 +1281,13 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: compare_data + * Function: compare_data * - * Purpose: Compare data of stype1 and stype2. + * Purpose: Compare data of stype1 and stype2. * - * Return: Success: 0 + * Return: Success: 0 * * Failure: negative * @@ -1306,21 +1306,21 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset) for(i = 0; i < (int)(NX * NY); i++) { if(src_subset) { - s_ptr = ((stype1 *)src_data) + i; - d_ptr = ((stype2 *)dst_data) + i; + s_ptr = ((stype1 *)src_data) + i; + d_ptr = ((stype2 *)dst_data) + i; } else { - s_ptr = (stype1 *)(((stype2 *)src_data) + i); - d_ptr = (stype2 *)(((stype1 *)dst_data) + i); + s_ptr = (stype1 *)(((stype2 *)src_data) + i); + d_ptr = (stype2 *)(((stype1 *)dst_data) + i); } - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e || + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e || !H5_FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) || !H5_FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) || !H5_FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) || @@ -1332,25 +1332,25 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset) !H5_DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) || !H5_DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) { - H5_FAILED(); - printf(" i=%d\n", i); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->c[4], s_ptr->c[5], s_ptr->c[6], s_ptr->c[7], + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->c[4], s_ptr->c[5], s_ptr->c[6], s_ptr->c[7], s_ptr->d, s_ptr->e, (double)s_ptr->f, (double)s_ptr->g,(double)s_ptr->h[0],(double)s_ptr->h[1],(double)s_ptr->h[2], (double)s_ptr->h[3],(double)s_ptr->h[4],(double)s_ptr->h[5],(double)s_ptr->h[6],(double)s_ptr->h[7],(double)s_ptr->h[8], (double)s_ptr->h[9],(double)s_ptr->h[10],(double)s_ptr->h[11],(double)s_ptr->h[12],(double)s_ptr->h[13],(double)s_ptr->h[14], (double)s_ptr->h[15], (double)s_ptr->i,(double)s_ptr->j,s_ptr->k,s_ptr->l,s_ptr->m,s_ptr->n); - printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->c[4], d_ptr->c[5], d_ptr->c[6], d_ptr->c[7], + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->c[4], d_ptr->c[5], d_ptr->c[6], d_ptr->c[7], d_ptr->d, d_ptr->e, (double)d_ptr->f, (double)d_ptr->g,(double)d_ptr->h[0],(double)d_ptr->h[1],(double)d_ptr->h[2], (double)d_ptr->h[3],(double)d_ptr->h[4],(double)d_ptr->h[5],(double)d_ptr->h[6],(double)d_ptr->h[7],(double)d_ptr->h[8], (double)d_ptr->h[9],(double)d_ptr->h[10],(double)d_ptr->h[11],(double)d_ptr->h[12],(double)d_ptr->h[13], (double)d_ptr->h[14],(double)d_ptr->h[15],(double)d_ptr->i,(double)d_ptr->j,d_ptr->k,d_ptr->l, d_ptr->m,d_ptr->n); - goto error; - } + goto error; + } } return SUCCEED; @@ -1359,11 +1359,11 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: test_hdf5_src_subset + * Function: test_hdf5_src_subset * - * Purpose: Test the optimization of compound data writing, rewriting, + * Purpose: Test the optimization of compound data writing, rewriting, * and reading when the source type is a subset of destination * type. For example: * struct source { struct destination { @@ -1375,11 +1375,11 @@ error: * }; * This optimization is for the Chicago company. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, 15 June 2007 * * Modifications: @@ -1399,7 +1399,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) /* Create the file for this test */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; /* Build hdf5 datatypes */ if ((src_tid=create_stype1()) < 0) @@ -1413,7 +1413,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) /* Create the data space */ if((space = H5Screate_simple(2, dims, NULL)) < 0) - goto error; + goto error; /* Allocate space and initialize data */ orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype1)); @@ -1441,7 +1441,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0) - goto error; + goto error; if(H5Dclose(dataset) < 0) goto error; @@ -1456,7 +1456,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0) - goto error; + goto error; if(H5Dclose(dataset) < 0) goto error; @@ -1482,7 +1482,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR @@ -1493,7 +1493,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR @@ -1559,15 +1559,15 @@ test_hdf5_src_subset(char *filename, hid_t fapl) return 0; error: - puts("*** DATASET TESTS FAILED ***"); + HDputs("*** DATASET TESTS FAILED ***"); return 1; } - + /*------------------------------------------------------------------------- - * Function: test_hdf5_dst_subset + * Function: test_hdf5_dst_subset * - * Purpose: Test the optimization of compound data writing, rewriting, + * Purpose: Test the optimization of compound data writing, rewriting, * and reading when the destination type is a subset of the * source type. For example: * struct source { struct destination { @@ -1580,11 +1580,11 @@ error: * This optimization is for the Chicago company. This test * is in opposite of test_hdf5_src_subset. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, 15 June 2007 * * Modifications: @@ -1604,7 +1604,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) /* Create the file for this test */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; /* Build hdf5 datatypes */ if ((src_tid=create_stype2()) < 0) @@ -1618,7 +1618,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) /* Create the data space */ if((space = H5Screate_simple(2, dims, NULL)) < 0) - goto error; + goto error; /* Allocate space and initialize data */ orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype2)); @@ -1645,7 +1645,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0) - goto error; + goto error; if(H5Dclose(dataset) < 0) goto error; @@ -1660,7 +1660,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0) - goto error; + goto error; if(H5Dclose(dataset) < 0) goto error; @@ -1686,7 +1686,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0) - goto error; + goto error; if(H5Dclose(dataset) < 0) goto error; @@ -1697,7 +1697,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) /* Write the data to the dataset */ if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0) - goto error; + goto error; if(H5Dclose(dataset) < 0) goto error; @@ -1773,27 +1773,27 @@ error: { \ int _i; \ H5_FAILED(); AT(); \ - printf(" Insertion order ="); \ + HDprintf(" Insertion order ="); \ for(_i=0; _i<PACK_NMEMBS; _i++) \ - printf(" %d", order[_i]); \ - printf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \ + HDprintf(" %d", order[_i]); \ + HDprintf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \ fflush(stdout); \ goto error; \ } - + /*------------------------------------------------------------------------- - * Function: test_pack_ooo + * Function: test_pack_ooo * - * Purpose: Test inserting fields into a compound out of offset order. + * Purpose: Test inserting fields into a compound out of offset order. * Verifies that the compound is correctly marked as packed * or non-packed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, 22 January 2009 * * Modifications: @@ -1840,9 +1840,9 @@ test_pack_ooo(void) for(extra_space=0; extra_space<2; extra_space ++) { if(extra_space) - puts("With extra space at the end of compound..."); + HDputs("With extra space at the end of compound..."); else - puts("Without extra space at the end of compound..."); + HDputs("Without extra space at the end of compound..."); TESTING("random member insertion with empty compound subtype"); @@ -1854,7 +1854,7 @@ test_pack_ooo(void) /* Insert the compound members in the random order previously generated */ for(i=0; i<PACK_NMEMBS; i++) { - sprintf(name, "%05d", i); + HDsprintf(name, "%05d", i); if(i == sub_cmpd_order) { if(H5Tinsert(cmpd, name, (size_t)(4 * order[i]), sub_cmpd) < 0) PACK_OOO_ERROR } else @@ -1880,7 +1880,7 @@ test_pack_ooo(void) /* Insert the compound members in the random order previously generated */ for(i=0; i<PACK_NMEMBS; i++) { - sprintf(name, "%05d", i); + HDsprintf(name, "%05d", i); if(i == sub_cmpd_order) { if(H5Tinsert(cmpd, name, (size_t)(4 * order[i]), sub_cmpd) < 0) PACK_OOO_ERROR } else @@ -1907,7 +1907,7 @@ test_pack_ooo(void) /* Insert the compound members in reverse order, with compound last */ for(i=0; i<PACK_NMEMBS; i++) { - sprintf(name, "%05d", i); + HDsprintf(name, "%05d", i); if(i == PACK_NMEMBS - 1) { if(H5Tinsert(cmpd, name, (size_t)(4 * (PACK_NMEMBS - i - 1)), sub_cmpd) < 0) PACK_OOO_ERROR } else @@ -1933,7 +1933,7 @@ test_pack_ooo(void) /* Insert the compound members in reverse order, with compound last */ for(i=0; i<PACK_NMEMBS; i++) { - sprintf(name, "%05d", i); + HDsprintf(name, "%05d", i); if(i == PACK_NMEMBS - 1) { if(H5Tinsert(cmpd, name, (size_t)(4 * (PACK_NMEMBS - i - 1)), sub_cmpd) < 0) PACK_OOO_ERROR } else @@ -1960,7 +1960,7 @@ test_pack_ooo(void) /* Insert the compound members in forward order, with compound first */ for(i=0; i<PACK_NMEMBS; i++) { - sprintf(name, "%05d", i); + HDsprintf(name, "%05d", i); if(i == 0) { if(H5Tinsert(cmpd, name, (size_t)(4 * i), sub_cmpd) < 0) PACK_OOO_ERROR } else @@ -1986,7 +1986,7 @@ test_pack_ooo(void) /* Insert the compound members in forward order */ for(i=0; i<PACK_NMEMBS; i++) { - sprintf(name, "%05d", i); + HDsprintf(name, "%05d", i); if(i == 0) { if(H5Tinsert(cmpd, name, (size_t)(4 * i), sub_cmpd) < 0) PACK_OOO_ERROR } else @@ -2007,25 +2007,25 @@ test_pack_ooo(void) return 0; error: - puts("*** DATASET TESTS FAILED ***"); +HDputs("*** DATASET TESTS FAILED ***"); return 1; } - + /*------------------------------------------------------------------------- - * Function: test_ooo_order + * Function: test_ooo_order * - * Purpose: Test inserting fields into a compound out of offset order. + * Purpose: Test inserting fields into a compound out of offset order. * Verifies that the order of compound members is the same as * the order in which they were inserted. While this is * explicitly not guaranteed by the documentation, the H5TB * API currently makes this assumption. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, 19 October 2009 * * Modifications: @@ -2183,18 +2183,18 @@ error: H5Tclose(dtype); H5Fclose(file); } H5E_END_TRY - puts("*** DATASET TESTS FAILED ***"); + HDputs("*** DATASET TESTS FAILED ***"); return 1; } /* test_ooo_order */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test different cases of I/O for compound data and the + * Purpose: Test different cases of I/O for compound data and the * compound optimization for the Chicago company. * - * Return: Success: 0 + * Return: Success: 0 * * Failure: 1 * @@ -2207,19 +2207,19 @@ error: int main (int argc, char *argv[]) { - hid_t fapl_id; - char fname[256]; - unsigned nerrors = 0; + hid_t fapl_id; + char fname[256]; + unsigned nerrors = 0; h5_reset(); /* Turn off optimized compound converter? */ if (argc>1) { - if (argc>2 || strcmp("--noopt", argv[1])) { - fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); - exit(EXIT_FAILURE); - } - H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, (H5T_conv_t)((void (*) (void))H5T__conv_struct_opt)); + if (argc>2 || strcmp("--noopt", argv[1])) { + HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]); + HDexit(EXIT_FAILURE); + } + H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, (H5T_conv_t)((void (*) (void))H5T__conv_struct_opt)); } /* Create the file */ @@ -2227,33 +2227,33 @@ main (int argc, char *argv[]) h5_fixname(FILENAME[0], fapl_id, fname, sizeof(fname)); - puts("Testing compound dataset:"); + HDputs("Testing compound dataset:"); nerrors += test_compound(fname, fapl_id); - puts("Testing the optimization of when the source type is a subset of the dest:"); + HDputs("Testing the optimization of when the source type is a subset of the dest:"); h5_fixname(FILENAME[1], fapl_id, fname, sizeof(fname)); nerrors += test_hdf5_src_subset(fname, fapl_id); - puts("Testing the optimization of when the dest type is a subset of the source:"); + HDputs("Testing the optimization of when the dest type is a subset of the source:"); h5_fixname(FILENAME[2], fapl_id, fname, sizeof(fname)); nerrors += test_hdf5_dst_subset(fname, fapl_id); - puts("Testing that compound types can be packed out of order:"); + HDputs("Testing that compound types can be packed out of order:"); nerrors += test_pack_ooo(); - puts("Testing compound member ordering:"); + HDputs("Testing compound member ordering:"); nerrors += test_ooo_order(fname, fapl_id); /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); if (nerrors) { - printf("***** %u FAILURE%s! *****\n", + HDprintf("***** %u FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } h5_cleanup(FILENAME, fapl_id); - puts("All compound dataset tests passed."); + HDputs("All compound dataset tests passed."); return 0; } diff --git a/test/cork.c b/test/cork.c index 240be77..09076d2 100644 --- a/test/cork.c +++ b/test/cork.c @@ -24,9 +24,9 @@ * This file needs to access private information from the H5C package. * This file also needs to access the metadata cache testing code. */ -#define H5C_FRIEND /*suppress error about including H5Cpkg */ -#define H5C_TESTING /*suppress warning about H5C testing funcs*/ -#include "H5Cpkg.h" /* Cache */ +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#define H5C_TESTING /*suppress warning about H5C testing funcs*/ +#include "H5Cpkg.h" /* Cache */ /* ============ */ @@ -74,7 +74,7 @@ static unsigned verify_group_cork(hbool_t swmr); static unsigned verify_named_cork(hbool_t swmr); static unsigned verify_multiple_cork(hbool_t swmr); - + /*------------------------------------------------------------------------- * Function: verify_old_dset_cork * @@ -120,15 +120,15 @@ verify_old_dset_cork(void) FAIL_STACK_ERROR /* Create chunked dataset with v1-btree indexing: DSET_BT1 */ - if((sid = H5Screate_simple(2, dims, max_dims)) < 0) + if((sid = H5Screate_simple(2, dims, max_dims)) < 0) TEST_ERROR if((did = H5Dcreate2(fid, DSET_BT1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR - + /* Get dataset object header address: DSET_BT1 */ if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR - + /* Cork the dataset: DSET_BT1 */ if(H5Odisable_mdc_flushes(did) < 0) TEST_ERROR @@ -159,13 +159,13 @@ verify_old_dset_cork(void) FAIL_STACK_ERROR if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR - if((did2 = H5Dcreate2(fid, DSET_COMPACT, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0) + if((did2 = H5Dcreate2(fid, DSET_COMPACT, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get dataset object address */ if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR - + /* Cork the dataset: DSET_COMPACT */ if(H5Odisable_mdc_flushes(did2) < 0) TEST_ERROR @@ -212,7 +212,7 @@ verify_old_dset_cork(void) FAIL_STACK_ERROR if(H5Pset_layout(dcpl3, H5D_CONTIGUOUS) < 0) FAIL_STACK_ERROR - if((did3 = H5Dcreate2(fid, DSET_CONTIG, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl3, H5P_DEFAULT)) < 0) + if((did3 = H5Dcreate2(fid, DSET_CONTIG, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl3, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get dataset object address: DSET_CONTIG */ @@ -224,11 +224,11 @@ verify_old_dset_cork(void) TEST_ERROR /* Verify the cork status for DSET_CONTIG */ - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR /* Verify the cork status for DSET_BT1 */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) TEST_ERROR /* Un-cork the dataset: DSET_CONTIG */ @@ -236,7 +236,7 @@ verify_old_dset_cork(void) TEST_ERROR /* Verify the cork status for DSET_CONTIG */ - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) TEST_ERROR /* Closing */ @@ -268,7 +268,7 @@ error: return 1; } /* verify_old_dset_cork */ - + /*------------------------------------------------------------------------- * Function: verify_obj_dset_cork * @@ -325,23 +325,23 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR /* Create dataset: DSET */ - if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Get dataset object header address */ if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR - + /* Verify cork status of the dataset: DSET */ if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) TEST_ERROR - + /* Cork the dataset: DSET */ if(H5Odisable_mdc_flushes(did) < 0) TEST_ERROR /* Attach and write to an attribute to the dataset: DSET */ - if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET */ @@ -349,24 +349,24 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR /* Close the attribute */ - if(H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET */ if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) TEST_ERROR - + /* Create dcpl */ if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR /* Set to early allocation for dataset space */ - if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0) + if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR /* Create chunked dataset with implicit indexing: DSET_NONE */ if(H5Pset_chunk(dcpl2, 1, chunk_dim) < 0) FAIL_STACK_ERROR - if((sid2 = H5Screate_simple(1, dim, NULL)) < 0) + if((sid2 = H5Screate_simple(1, dim, NULL)) < 0) TEST_ERROR if((did2 = H5Dcreate2(fid, DSET_NONE, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0) TEST_ERROR @@ -391,7 +391,7 @@ verify_obj_dset_cork(hbool_t swmr) } /* end for */ /* Verify cork status of the dataset: DSET_NONE */ - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) TEST_ERROR /* Closing */ @@ -412,11 +412,11 @@ verify_obj_dset_cork(hbool_t swmr) flags = H5F_ACC_RDWR; if(swmr) flags |= H5F_ACC_SWMR_WRITE; - if((fid = H5Fopen(FILENAME, flags, fapl)) < 0) + if((fid = H5Fopen(FILENAME, flags, fapl)) < 0) TEST_ERROR /* Open the dataset object: DSET_NONE */ - if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0) + if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET */ @@ -469,7 +469,7 @@ error: return 1; } /* verify_obj_dset_cork */ - + /*------------------------------------------------------------------------- * Function: verify_dset_cork * @@ -540,15 +540,15 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) FAIL_STACK_ERROR /* Create chunked dataset with extensive array indexing: DSET_EA */ - if((sid = H5Screate_simple(2, dims, max_dims)) < 0) + if((sid = H5Screate_simple(2, dims, max_dims)) < 0) TEST_ERROR if((did = H5Dcreate2(fid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR - + /* Get dataset object header address: DSET_EA */ if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR - + /* Cork the dataset: DSET_EA */ if(H5Odisable_mdc_flushes(did) < 0) TEST_ERROR @@ -558,7 +558,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR /* Create chunked dataset with fixed array indexing: DSET_FA */ - if((sid2 = H5Screate_simple(2, dims, NULL)) < 0) + if((sid2 = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR if((did2 = H5Dcreate2(fid, DSET_FA, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -566,7 +566,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) /* Get dataset object header address: DSET_FA */ if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR - + /* Cork the dataset: DSET_FA */ if(H5Odisable_mdc_flushes(did2) < 0) TEST_ERROR @@ -585,7 +585,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) /* Create chunked dataset with v2-Btree indexing */ max_dims[0] = H5S_UNLIMITED; - if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0) + if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0) TEST_ERROR if((did3 = H5Dcreate2(fid, DSET_BT2, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR @@ -708,7 +708,7 @@ error: } /* verify_dset_cork */ - + /*------------------------------------------------------------------------- * Function: verify_group_cork * @@ -758,11 +758,11 @@ verify_group_cork(hbool_t swmr) TEST_ERROR /* Create 3 groups */ - if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Cork the second group: GRP2 */ @@ -778,23 +778,23 @@ verify_group_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the groups */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) TEST_ERROR - + /* Close the second group: GRP2 */ if(H5Gclose(gid2) < 0) TEST_ERROR /* Re-open the second group: GRP2 */ - if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0) + if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify cork status of the second group: GRP2 */ - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0) TEST_ERROR /* Closing */ @@ -813,11 +813,11 @@ verify_group_cork(hbool_t swmr) flags |= H5F_ACC_SWMR_WRITE; if((fid = H5Fopen(FILENAME, flags, fapl)) < 0) FAIL_STACK_ERROR - if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0) + if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0) + if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create dataspace */ @@ -826,7 +826,7 @@ verify_group_cork(hbool_t swmr) /* Attach 8 attributes to the third group: GRP3 */ for(i = 0;i < 8; i++) { - sprintf(attrname, "attr %d", i); + HDsprintf(attrname, "attr %d", i); if((aid = H5Acreate2(gid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0) @@ -835,7 +835,7 @@ verify_group_cork(hbool_t swmr) if(i == 3) { if(H5Odisable_mdc_flushes(gid3) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR } if(H5Aclose(aid) < 0) @@ -843,7 +843,7 @@ verify_group_cork(hbool_t swmr) } /* end for */ /* Verify cork status of the third group: GRP3 */ - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR /* Closing */ @@ -875,7 +875,7 @@ error: return 1; } /* verify_group_cork */ - + /*------------------------------------------------------------------------- * Function: verify_named_cork * @@ -935,21 +935,21 @@ verify_named_cork(hbool_t swmr) TEST_ERROR /* Commit datatype /DT */ - if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Create /GRP */ - if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Commit datatype /GRP/DT2 */ - if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Create /GRP/GRP2 */ - if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Commit datatype /GRP/GRP2/DT3 */ - if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Cork 2 named datatypes: /DT and /GRP/GRP2/DT3 */ @@ -967,11 +967,11 @@ verify_named_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the named datatypes */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR /* Close the datatypes */ @@ -983,19 +983,19 @@ verify_named_cork(hbool_t swmr) TEST_ERROR /* Re-open the named datatypes */ - if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0) + if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0) + if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0) + if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify cork status of the named datatypes */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) TEST_ERROR /* Closing */ @@ -1019,17 +1019,17 @@ verify_named_cork(hbool_t swmr) flags |= H5F_ACC_SWMR_WRITE; if((fid = H5Fopen(FILENAME, flags, fapl)) < 0) FAIL_STACK_ERROR - if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0) + if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Re-open the named datatypes */ - if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0) + if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0) + if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0) + if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Cork the datatype: DT2 */ @@ -1042,7 +1042,7 @@ verify_named_cork(hbool_t swmr) /* Attach 8 attributes to datatype: DT3 */ for(i = 0;i < 8; i++) { - sprintf(attrname, "attr %d", i); + HDsprintf(attrname, "attr %d", i); if((aid = H5Acreate2(tid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0) @@ -1051,7 +1051,7 @@ verify_named_cork(hbool_t swmr) if(i == 3) { if(H5Odisable_mdc_flushes(tid3) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR } if(H5Aclose(aid) < 0) @@ -1059,7 +1059,7 @@ verify_named_cork(hbool_t swmr) } /* end for */ /* Create a dataset with named datatype: DT */ - if((did = H5Dcreate2(fid, DSET, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DSET, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get dataset object header address */ @@ -1071,20 +1071,20 @@ verify_named_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the datatype: DT */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0) TEST_ERROR /* Verify cork status of the datatype: DT2 */ - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) TEST_ERROR /* Verify cork status of the datatype: DT3 */ - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR /* Un-cork the datatype: DT3 */ if(H5Oenable_mdc_flushes(tid3) < 0) TEST_ERROR /* Verify cork status of the datatype: DT3 */ - if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0) TEST_ERROR /* Cork the datatype: DT */ @@ -1092,14 +1092,14 @@ verify_named_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the datatype: DT */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) TEST_ERROR /* Verify cork status of the datatype: DT2 */ - if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET */ - if(H5C__verify_cork_tag_test(fid, oinfo4.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo4.addr, TRUE) < 0) TEST_ERROR /* Close the dataset */ @@ -1107,11 +1107,11 @@ verify_named_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the datatype: DT */ - if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET */ - if(H5C__verify_cork_tag_test(fid, oinfo4.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid, oinfo4.addr, FALSE) < 0) TEST_ERROR /* Closing */ @@ -1149,7 +1149,7 @@ error: return 1; } /* verify_named_cork */ - + /*------------------------------------------------------------------------- * Function: verify_multiple_cork * @@ -1279,7 +1279,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the group: gid2 */ if(H5Oget_info2(gid2, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid2, oinfo1.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid2, oinfo1.addr, TRUE) < 0) TEST_ERROR /* Check cork status of the group: gid1 */ @@ -1307,7 +1307,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the dataset: did1 */ if(H5Oget_info2(did1, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, TRUE) < 0) TEST_ERROR /* Check cork status of the dataset: did2 */ @@ -1335,7 +1335,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the datatype: tid2 */ if(H5Oget_info2(tid2, &oinfo3, H5O_INFO_BASIC) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid2, oinfo3.addr, TRUE) < 0) + if(H5C__verify_cork_tag_test(fid2, oinfo3.addr, TRUE) < 0) TEST_ERROR /* Check cork status of the datatype: tid1 */ @@ -1351,7 +1351,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the group: gid1 */ if(H5Oget_info2(gid1, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0) TEST_ERROR /* Check cork status of the group: gid2 */ @@ -1371,7 +1371,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the group: gid1 */ - if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0) TEST_ERROR /* Close the group: gid1 */ @@ -1385,7 +1385,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the dataset: did2 */ if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR - if(H5C__verify_cork_tag_test(fid2, oinfo2.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid2, oinfo2.addr, FALSE) < 0) TEST_ERROR /* Check cork status of the dataset: did1 */ @@ -1405,7 +1405,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Verify cork status of the dataset: did1 */ - if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, FALSE) < 0) + if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, FALSE) < 0) TEST_ERROR /* Close the dataset: did1 */ @@ -1517,7 +1517,7 @@ error: /*------------------------------------------------------------------------- * Function: test_objs_cork * - * Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public + * Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public * routines are working as specified. * * Return: 0 on Success, 1 on Failure @@ -1723,7 +1723,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) } H5E_END_TRY; if(ret >= 0) TEST_ERROR - + /* Cork the named datatype */ if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR @@ -1796,7 +1796,7 @@ error: return 1; } /* test_objs_cork() */ - + /*------------------------------------------------------------------------- * Function: test_dset_cork * @@ -1847,7 +1847,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) } /* end if */ /* Create fapl */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR /* Set to use latest format */ @@ -1880,7 +1880,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) /* Set up dataset creation property list */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR - + /* Enable chunking */ if(H5Pset_chunk(dcpl, RANK, cdims) < 0) TEST_ERROR @@ -2003,7 +2003,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR if(!corked) TEST_ERROR - + /* Close the dataset */ if(H5Dclose(did1) < 0) TEST_ERROR @@ -2053,7 +2053,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR /* Second open of the named datatype */ - if((tid2 = H5Topen2(gid, "datatype", H5P_DEFAULT)) < 0) + if((tid2 = H5Topen2(gid, "datatype", H5P_DEFAULT)) < 0) TEST_ERROR /* Check cork status of the second opened named datatype */ @@ -2124,7 +2124,7 @@ error: } /* test_dset_cork() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -2138,12 +2138,12 @@ error: * *------------------------------------------------------------------------- */ -int -main(void) +int +main(void) { unsigned swmr; /* Loop over SWMR/non-SWMR */ unsigned nerrs = 0; /* Error Encountered */ - + /* Test for dataset created with old library format */ nerrs += verify_old_dset_cork(); @@ -2158,10 +2158,10 @@ main(void) /* Tests with/without SWMR access */ nerrs += verify_obj_dset_cork(swmr); - nerrs += verify_dset_cork(swmr, TRUE); - nerrs += verify_dset_cork(swmr, FALSE); - nerrs += verify_group_cork(swmr); - nerrs += verify_named_cork(swmr); + nerrs += verify_dset_cork(swmr, TRUE); + nerrs += verify_dset_cork(swmr, FALSE); + nerrs += verify_group_cork(swmr); + nerrs += verify_named_cork(swmr); nerrs += verify_multiple_cork(swmr); } /* end for */ diff --git a/test/cross_read.c b/test/cross_read.c index 2219151..5444aae 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -109,7 +109,7 @@ check_data_i(const char *dsetname, hid_t fid) if(data_out[i][j] != data_in[i][j]) if(!nerrors++) { H5_FAILED(); - printf("element [%d][%d] is %lld but should have been %lld\n", + HDprintf("element [%d][%d] is %lld but should have been %lld\n", (int)i, (int)j, data_out[i][j], data_in[i][j]); } /* end if */ @@ -119,7 +119,7 @@ check_data_i(const char *dsetname, hid_t fid) /* Failure */ if(nerrors) { - printf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY)); + HDprintf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY)); return 1; } /* end if */ @@ -182,7 +182,7 @@ check_data_f(const char *dsetname, hid_t fid) if(!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], (double)0.001F)) if(!nerrors++) { H5_FAILED(); - printf("element [%d][%d] is %g but should have been %g\n", + HDprintf("element [%d][%d] is %g but should have been %g\n", (int)i, (int)j, data_out[i][j], data_in[i][j]); } /* end if */ @@ -192,7 +192,7 @@ check_data_f(const char *dsetname, hid_t fid) /* Failure */ if(nerrors) { - printf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY)); + HDprintf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY)); return 1; } /* end if */ @@ -369,11 +369,11 @@ main(void) nerrors += check_file(filename); if(nerrors) { - printf("***** %d FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); + HDprintf("***** %d FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); return EXIT_FAILURE; } /* end if */ - printf("All data type tests passed.\n"); + HDprintf("All data type tests passed.\n"); return EXIT_SUCCESS; } /* end main() */ diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index d88045c..ada7a6f 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -41,7 +41,7 @@ const char *FILENAME[] = { */ static void catch_signal(int H5_ATTR_UNUSED signo) { - HDexit(1); + HDexit(EXIT_FAILURE); } /* catch_signal() */ diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 9ea814c..7b17043 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -13,7 +13,7 @@ #include "h5test.h" -#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) # define H5_ZLIB_HEADER "zlib.h" #endif #if defined(H5_ZLIB_HEADER) @@ -46,10 +46,10 @@ #define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*H5_DOUBLE(1.001))+H5_DOUBLE(12.0)) /* Temporary filter IDs used for testing */ -#define H5Z_FILTER_BOGUS1 305 -#define H5Z_FILTER_BOGUS2 306 -#define ADD_ON 7 -#define FACTOR 3 +#define H5Z_FILTER_BOGUS1 305 +#define H5Z_FILTER_BOGUS2 306 +#define ADD_ON 7 +#define FACTOR 3 /* Constants for the overwrite test */ #define OVERWRITE_NDIMS 3 @@ -83,33 +83,33 @@ static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS1, /* Filter id number */ + H5Z_FILTER_BOGUS1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus1", /* Filter name for debugging */ + "bogus1", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus1, /* The actual filter function */ + filter_bogus1, /* The actual filter function */ }}; const H5Z_class2_t H5Z_BOGUS2[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS2, /* Filter id number */ + H5Z_FILTER_BOGUS2, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus2", /* Filter name for debugging */ + "bogus2", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus2, /* The actual filter function */ + filter_bogus2, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: test_direct_chunk_write + * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5Dwrite_chunk + * Purpose: Test the basic functionality of H5Dwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -121,7 +121,7 @@ test_direct_chunk_write (hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; @@ -136,11 +136,11 @@ test_direct_chunk_write (hid_t file) size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst = NULL; /*destination buffer */ - uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); - uLong z_src_nbytes = (uLong)buf_size; + Bytef *z_dst = NULL; /*destination buffer */ + uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); + uLong z_src_nbytes = (uLong)buf_size; int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ @@ -175,29 +175,29 @@ test_direct_chunk_write (hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME1, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; /* Initialize the dataset */ for(i = n = 0; i < NX; i++) for(j = 0; j < NY; j++) - data[i][j] = n++; + data[i][j] = n++; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; /* * Write the data for the dataset. It should stay in the chunk cache. - * It will be evicted from the cache by the H5Dwrite_chunk calls. + * It will be evicted from the cache by the H5Dwrite_chunk calls. */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - dxpl, data)) < 0) + dxpl, data)) < 0) goto error; /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -218,8 +218,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i<NX/CHUNK_NX; i++) { for(j=0; j<NY/CHUNK_NY; j++) { status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, z_dst_nbytes, outbuf); @@ -232,7 +232,7 @@ test_direct_chunk_write (hid_t file) if(outbuf) HDfree(outbuf); - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; if(H5Dclose(dataset) < 0) @@ -261,7 +261,7 @@ test_direct_chunk_write (hid_t file) if(direct_buf[i][j] != check_chunk[i][j]) { HDprintf(" 1. Read different values than written."); HDprintf(" At index %d,%d\n", i, j); - HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); goto error; } } @@ -270,7 +270,7 @@ test_direct_chunk_write (hid_t file) /* Reinitialize different data for one chunk */ for(i = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = i + j; + direct_buf[i][j] = i + j; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -291,8 +291,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Rewrite the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Rewrite the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ offset[0] = offset[1] = 0; for(i=0; i<NX/CHUNK_NX; i++) { for(j=0; j<NY/CHUNK_NY; j++) { @@ -306,7 +306,7 @@ test_direct_chunk_write (hid_t file) if(outbuf) HDfree(outbuf); - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; if(H5Dclose(dataset) < 0) @@ -325,7 +325,7 @@ test_direct_chunk_write (hid_t file) if(direct_buf[i][j] != check_chunk[i][j]) { HDprintf(" 2. Read different values than written."); HDprintf(" At index %d,%d\n", i, j); - HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); goto error; } } @@ -339,7 +339,7 @@ test_direct_chunk_write (hid_t file) H5Sclose(dataspace); H5Pclose(cparms); H5Pclose(dxpl); - + PASSED(); return 0; @@ -467,15 +467,15 @@ error: } /* end test_direct_chunk_overwrite_data() */ /*------------------------------------------------------------------------- - * Function: test_skip_compress_write1 + * Function: test_skip_compress_write1 * - * Purpose: Test skipping compression filter when it is the only filter + * Purpose: Test skipping compression filter when it is the only filter * for the dataset * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -536,7 +536,7 @@ test_skip_compress_write1(hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME2, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -644,13 +644,13 @@ error: } /* test_skip_compress_write1() */ /*------------------------------------------------------------------------- - * Function: filter_bogus1 + * Function: filter_bogus1 * - * Purpose: A bogus filter that adds ADD_ON to the original value + * Purpose: A bogus filter that adds ADD_ON to the original value * - * Return: Success: Data chunk size + * Return: Success: Data chunk size * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -682,13 +682,13 @@ filter_bogus1(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, } /* filter_bogus1() */ /*------------------------------------------------------------------------- - * Function: filter_bogus2 + * Function: filter_bogus2 * - * Purpose: A bogus filter that multiplies the original value by FACTOR. + * Purpose: A bogus filter that multiplies the original value by FACTOR. * - * Return: Success: Data chunk size + * Return: Success: Data chunk size * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 *------------------------------------------------------------------------- */ @@ -719,15 +719,15 @@ filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, } /* filter_bogus2() */ /*------------------------------------------------------------------------- - * Function: test_skip_compress_write2 + * Function: test_skip_compress_write2 * - * Purpose: Test skipping compression filter when there are three filters + * Purpose: Test skipping compression filter when there are three filters * for the dataset * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -805,7 +805,7 @@ test_skip_compress_write2(hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME3, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -915,14 +915,14 @@ error: } /* test_skip_compress_write2() */ /*------------------------------------------------------------------------- - * Function: test_data_conv + * Function: test_data_conv * - * Purpose: Test data conversion + * Purpose: Test data conversion * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -940,13 +940,13 @@ test_data_conv(hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; int i, j, n; - const hsize_t four = 4; - hid_t st=-1, dt=-1; + const hsize_t four = 4; + hid_t st=-1, dt=-1; hid_t array_dt; unsigned filter_mask = 0; @@ -1010,7 +1010,7 @@ test_data_conv(hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME4, st, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -1030,7 +1030,7 @@ test_data_conv(hid_t file) } } - /* write the chunk data to dataset, using the direct writing function. + /* write the chunk data to dataset, using the direct writing function. * There should be no data conversion involved. */ offset[0] = CHUNK_NX; offset[1] = CHUNK_NY; @@ -1038,7 +1038,7 @@ test_data_conv(hid_t file) if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) < 0) goto error; - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; if(H5Dclose(dataset) < 0) @@ -1065,10 +1065,10 @@ test_data_conv(hid_t file) HDprintf(" 1. Read different values than written."); HDprintf(" At index %d,%d\n", i, j); HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], + (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - (read_chunk[i][j]).a, (read_chunk[i][j]).b, (read_chunk[i][j]).c[0], (read_chunk[i][j]).c[1], + (read_chunk[i][j]).a, (read_chunk[i][j]).b, (read_chunk[i][j]).c[0], (read_chunk[i][j]).c[1], (read_chunk[i][j]).c[2], (read_chunk[i][j]).c[3], (read_chunk[i][j]).d, (read_chunk[i][j]).e); goto error; @@ -1102,10 +1102,10 @@ test_data_conv(hid_t file) HDprintf(" 1. Read different values than written."); HDprintf(" At index %d,%d\n", i, j); HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], + (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", - (check_chunk[i][j]).a, (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2], + (check_chunk[i][j]).a, (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2], (check_chunk[i][j]).c[3], (check_chunk[i][j]).e); goto error; @@ -1143,14 +1143,14 @@ error: } /* test_data_conv() */ /*------------------------------------------------------------------------- - * Function: test_invalid_parameters + * Function: test_invalid_parameters * * Purpose: Test invalid parameters for H5Dwrite_chunk and H5Dread_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -1161,7 +1161,7 @@ test_invalid_parameters(hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; int i, j, n; @@ -1195,7 +1195,7 @@ test_invalid_parameters(hid_t file) * Create a new contiguous dataset to verify H5Dwrite_chunk/H5Dread_chunk doesn't work */ if((dataset = H5Dcreate2(file, DATASETNAME5, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -1244,10 +1244,10 @@ test_invalid_parameters(hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME6, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; - /* Check invalid dataset ID for H5Dwrite_chunk and H5Dread_chunk */ + /* Check invalid dataset ID for H5Dwrite_chunk and H5Dread_chunk */ H5E_BEGIN_TRY { if((status = H5Dwrite_chunk((hid_t)-1, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; @@ -1309,7 +1309,7 @@ test_invalid_parameters(hid_t file) /* Check invalid buffer size for H5Dwrite_chunk only */ offset[0] = CHUNK_NX; offset[1] = CHUNK_NY; - buf_size = 0; + buf_size = 0; H5E_BEGIN_TRY { if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; @@ -1337,7 +1337,7 @@ test_invalid_parameters(hid_t file) H5Sclose(dataspace); H5Pclose(cparms); H5Pclose(dxpl); - + PASSED(); return 0; @@ -1643,7 +1643,7 @@ test_direct_chunk_read_cache (hid_t file, hbool_t flush) goto error; if(read_buf_size == 0) goto error; - + /* Read the compressed chunk back using the direct read function. */ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, outbuf)) < 0) goto error; @@ -1994,7 +1994,7 @@ error: * this jira issue: * Create a file with the latest format and a chunked dataset * with one single chunk. The library will use single chunk - * index for the dataset. + * index for the dataset. * Verify that the data read is the same as the written data. * * Since expanded to test multiple combinations of cases @@ -2139,15 +2139,15 @@ error: } /* test_single_chunk_latest() */ /*------------------------------------------------------------------------- - * Function: Main function + * Function: Main function * - * Purpose: Test direct chunk write function H5Dwrite_chunk and + * Purpose: Test direct chunk write function H5Dwrite_chunk and * chunk direct read function H5Dread_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -2168,7 +2168,7 @@ int main( void ) #ifdef H5_HAVE_FILTER_DEFLATE nerrors += test_direct_chunk_write(file_id); #endif /* H5_HAVE_FILTER_DEFLATE */ - nerrors += test_direct_chunk_overwrite_data(file_id); + nerrors += test_direct_chunk_overwrite_data(file_id); nerrors += test_skip_compress_write1(file_id); nerrors += test_skip_compress_write2(file_id); nerrors += test_data_conv(file_id); @@ -2192,40 +2192,40 @@ int main( void ) continue; /* Print configuration */ - printf("Configuration: "); + HDprintf("Configuration: "); if(config == 0) - printf("<empty>"); + HDprintf("<empty>"); if(config & CONFIG_LATEST) { if(need_comma) - printf(", "); - printf("latest format"); + HDprintf(", "); + HDprintf("latest format"); need_comma = TRUE; } /* end if */ if(config & CONFIG_REOPEN_FILE) { if(need_comma) - printf(", "); - printf("reopen file"); + HDprintf(", "); + HDprintf("reopen file"); need_comma = TRUE; } /* end if */ else if(config & CONFIG_REOPEN_DSET) { if(need_comma) - printf(", "); - printf("reopen dataset"); + HDprintf(", "); + HDprintf("reopen dataset"); need_comma = TRUE; } /* end if */ if(config & CONFIG_DIRECT_WRITE) { if(need_comma) - printf(", "); - printf("direct write"); + HDprintf(", "); + HDprintf("direct write"); need_comma = TRUE; } /* end if */ if(config & CONFIG_DIRECT_READ) { if(need_comma) - printf(", "); - printf("direct read"); + HDprintf(", "); + HDprintf("direct read"); need_comma = TRUE; } /* end if */ - printf(":\n"); + HDprintf(":\n"); fflush(stdout); nerrors += test_single_chunk(config); diff --git a/test/dsets.c b/test/dsets.c index 603f785..649e001 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -88,7 +88,6 @@ const char *FILENAME[] = { #define OHMIN_FILENAME_A "ohdr_min_a" - #define FILENAME_BUF_SIZE 1024 #define KB 1024 @@ -401,7 +400,7 @@ test_create(hid_t file) } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); - puts(" Library allowed overwrite of existing dataset."); + HDputs(" Library allowed overwrite of existing dataset."); goto error; } @@ -423,7 +422,7 @@ test_create(hid_t file) } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); - puts(" Opened a non-existent dataset."); + HDputs(" Opened a non-existent dataset."); goto error; } @@ -445,7 +444,7 @@ test_create(hid_t file) } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); - puts(" Opened a dataset with incorrect chunking parameters."); + HDputs(" Opened a dataset with incorrect chunking parameters."); goto error; } @@ -566,8 +565,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) for(j = 0; j < DSET_DIM2; j++) { if(points[i][j] != check[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } } @@ -590,8 +589,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) for(j = 0; j < DSET_DIM2; j++) { if(points[i][j] != rdata[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } } @@ -605,7 +604,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) } /* end if */ else { SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + HDputs(" Current VFD doesn't support continuous address space"); } /* end else */ return SUCCEED; @@ -699,8 +698,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) for(j = 0; j < DSET_DIM2; j++) { if(points[i][j] != rdata[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } } @@ -713,7 +712,7 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } /* end if */ else { SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + HDputs(" Current VFD doesn't support continuous address space"); } /* end else */ return SUCCEED; @@ -814,10 +813,10 @@ test_compact_io(hid_t fapl) for(j = 0; j < 8; j++) if(rbuf[i][j] != wbuf[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); - printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); - printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); + HDprintf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); goto error; } /* end */ @@ -872,10 +871,10 @@ test_compact_io(hid_t fapl) for(j = 0; j < 8; j++) if(rbuf[i][j] != wbuf[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); - printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); - printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); + HDprintf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); goto error; } /* end */ @@ -1013,8 +1012,8 @@ test_max_compact(hid_t fapl) for(u = 0; u < compact_size; u++) if(rbuf[u] != wbuf[u]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %u\n", (unsigned)u); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %u\n", (unsigned)u); goto error; } /* end if */ @@ -1313,7 +1312,7 @@ test_conv_buffer(hid_t fid) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" Library shouldn't allow conversion buffer too small"); + HDputs(" Library shouldn't allow conversion buffer too small"); goto error; } @@ -1338,7 +1337,7 @@ test_conv_buffer(hid_t fid) HDfree(cf); HDfree(cfrR); - puts(" PASSED"); + HDputs(" PASSED"); return SUCCEED; error: @@ -1415,7 +1414,7 @@ test_tconv(hid_t file) in[4 * i + 2] != out[4 * i + 1] || in[4 * i + 3] != out[4 * i + 0]) { H5_FAILED(); - puts(" Read with byte order conversion failed."); + HDputs(" Read with byte order conversion failed."); goto error; } } @@ -1425,7 +1424,7 @@ test_tconv(hid_t file) HDfree(out); HDfree(in); - puts(" PASSED"); + HDputs(" PASSED"); return SUCCEED; error: @@ -1771,7 +1770,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Check if all the filters are available */ if(H5Pall_filters_avail(dcpl)!=TRUE) { H5_FAILED(); - printf(" Line %d: Incorrect filter availability\n",__LINE__); + HDprintf(" Line %d: Incorrect filter availability\n",__LINE__); goto error; } /* end if */ @@ -1794,8 +1793,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, 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", + HDprintf(" Read a non-zero value.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } @@ -1860,10 +1859,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, 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]); + 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]); goto error; } } @@ -1920,8 +1919,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, 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", + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } @@ -1974,8 +1973,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, 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", + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } /* end if */ @@ -2034,13 +2033,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, 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", + 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)); - fprintf(stderr," At original: %d\n", + HDfprintf(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", + HDfprintf(stderr," At returned: %d\n", (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); goto error; } @@ -2302,7 +2301,7 @@ H5_ATTR_UNUSED * STEP 0: Test null I/O filter by itself. *---------------------------------------------------------- */ - puts("Testing 'null' filter"); + HDputs("Testing 'null' filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Zregister (H5Z_BOGUS) < 0) goto error; @@ -2317,7 +2316,7 @@ H5_ATTR_UNUSED * STEP 1: Test Fletcher32 Checksum by itself. *---------------------------------------------------------- */ - puts("Testing Fletcher32 checksum(enabled for read)"); + HDputs("Testing Fletcher32 checksum(enabled for read)"); 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_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error; @@ -2326,21 +2325,21 @@ H5_ATTR_UNUSED if(test_filter_internal(file,DSET_FLETCHER32_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { H5_FAILED(); - puts(" Size after checksumming is incorrect."); + HDputs(" Size after checksumming is incorrect."); goto error; } /* end if */ /* Disable checksum during read */ - puts("Testing Fletcher32 checksum(disabled for read)"); + HDputs("Testing Fletcher32 checksum(disabled for read)"); if(test_filter_internal(file,DSET_FLETCHER32_NAME_2,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { H5_FAILED(); - puts(" Size after checksumming is incorrect."); + HDputs(" Size after checksumming is incorrect."); goto error; } /* end if */ /* Try to corrupt data and see if checksum fails */ - puts("Testing Fletcher32 checksum(when data is corrupted)"); + HDputs("Testing Fletcher32 checksum(when data is corrupted)"); data_corrupt[0] = 52; data_corrupt[1] = 33; data_corrupt[2] = 27; @@ -2350,7 +2349,7 @@ H5_ATTR_UNUSED if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { H5_FAILED(); - puts(" Size after checksumming is incorrect."); + HDputs(" Size after checksumming is incorrect."); goto error; } /* end if */ @@ -2363,7 +2362,7 @@ H5_ATTR_UNUSED *---------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_DEFLATE - puts("Testing deflate filter"); + HDputs("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; @@ -2374,7 +2373,7 @@ H5_ATTR_UNUSED #else /* H5_HAVE_FILTER_DEFLATE */ TESTING("deflate filter"); SKIPPED(); - puts(" Deflate filter not enabled"); + HDputs(" Deflate filter not enabled"); #endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- @@ -2387,7 +2386,7 @@ H5_ATTR_UNUSED if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - puts(""); + HDputs(""); if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error; if(H5Pclose (dc) < 0) goto error; @@ -2399,7 +2398,7 @@ H5_ATTR_UNUSED TESTING("szip filter (without encoder)"); if( h5_szip_can_encode() != 1) { - puts(""); + HDputs(""); if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error; } else { @@ -2409,14 +2408,14 @@ H5_ATTR_UNUSED #else /* H5_HAVE_FILTER_SZIP */ TESTING("szip filter"); SKIPPED(); - puts(" Szip filter not enabled"); + HDputs(" Szip filter not enabled"); #endif /* H5_HAVE_FILTER_SZIP */ /*---------------------------------------------------------- * STEP 4: Test shuffling by itself. *---------------------------------------------------------- */ - puts("Testing shuffle filter"); + HDputs("Testing shuffle filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_shuffle (dc) < 0) goto error; @@ -2424,7 +2423,7 @@ H5_ATTR_UNUSED if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error; if(shuffle_size!=null_size) { H5_FAILED(); - puts(" Shuffled size not the same as uncompressed size."); + HDputs(" Shuffled size not the same as uncompressed size."); goto error; } /* end if */ @@ -2436,7 +2435,7 @@ H5_ATTR_UNUSED *---------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_DEFLATE - puts("Testing shuffle+deflate+checksum filters(checksum first)"); + HDputs("Testing shuffle+deflate+checksum filters(checksum first)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_fletcher32 (dc) < 0) goto error; @@ -2448,7 +2447,7 @@ H5_ATTR_UNUSED /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; - puts("Testing shuffle+deflate+checksum filters(checksum last)"); + HDputs("Testing shuffle+deflate+checksum filters(checksum last)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_shuffle (dc) < 0) goto error; @@ -2462,7 +2461,7 @@ H5_ATTR_UNUSED #else /* H5_HAVE_FILTER_DEFLATE */ TESTING("shuffle+deflate+fletcher32 filters"); SKIPPED(); - puts(" Deflate filter not enabled"); + HDputs(" Deflate filter not enabled"); #endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- @@ -2479,7 +2478,7 @@ H5_ATTR_UNUSED /* Make sure encoding is enabled */ if( h5_szip_can_encode() == 1) { - puts(""); + HDputs(""); if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; } @@ -2490,7 +2489,7 @@ H5_ATTR_UNUSED TESTING("shuffle+szip+checksum filters(checksum first, without encoder)"); if( h5_szip_can_encode() != 1) { - puts(""); + HDputs(""); if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error; } else { @@ -2504,7 +2503,7 @@ H5_ATTR_UNUSED /* Make sure encoding is enabled */ if( h5_szip_can_encode() == 1) { - puts(""); + HDputs(""); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_shuffle (dc) < 0) goto error; @@ -2523,7 +2522,7 @@ H5_ATTR_UNUSED #else /* H5_HAVE_FILTER_SZIP */ TESTING("shuffle+szip+fletcher32 filters"); SKIPPED(); - puts(" szip filter not enabled"); + HDputs(" szip filter not enabled"); #endif /* H5_HAVE_FILTER_SZIP */ return SUCCEED; @@ -2847,8 +2846,8 @@ test_onebyte_shuffle(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(new_data[i][j] != orig_data[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } @@ -2893,7 +2892,7 @@ test_nbit_int(hid_t file) double power; size_t i, j; - puts("Testing nbit filter"); + HDputs("Testing nbit filter"); TESTING(" nbit int (setup)"); /* Define dataset datatype (integer), and set precision, offset */ @@ -2963,8 +2962,8 @@ test_nbit_int(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(((unsigned)new_data[i][j] & mask) != ((unsigned)orig_data[i][j] & mask)) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -3078,8 +3077,8 @@ test_nbit_float(hid_t file) continue; /* skip if value is NaN */ if(!H5_FLT_ABS_EQUAL(new_data[i][j], orig_data[i][j])) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -3210,8 +3209,8 @@ test_nbit_double(hid_t file) continue; /* skip if value is NaN */ if(!H5_DBL_ABS_EQUAL(new_data[i][j], orig_data[i][j])) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -3338,8 +3337,8 @@ test_nbit_array(hid_t file) for(n = 0; n < (size_t)adims[1]; n++) { if(new_data[i][j][m][n]!= orig_data[i][j][m][n]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu,%lu,%lu\n", + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu,%lu,%lu\n", (unsigned long)i, (unsigned long)j, (unsigned long)m, (unsigned long)n); goto error; } @@ -3544,8 +3543,8 @@ test_nbit_compound(hid_t file) (orig_data[i][j].f == orig_data[i][j].f && !H5_FLT_ABS_EQUAL(new_data[i][j].f, orig_data[i][j].f))) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -3875,8 +3874,8 @@ out: (new_data[i][j].a.f == new_data[i][j].a.f && !H5_FLT_ABS_EQUAL(new_data[i][j].a.f, new_data[i][j].a.f)) || new_data[i][j].v != orig_data[i][j].v || b_failed || d_failed) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -4058,8 +4057,8 @@ test_nbit_compound_3(hid_t file) new_data[i].r != orig_data[i].r) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu\n", (unsigned long)i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu\n", (unsigned long)i); goto error; } @@ -4067,8 +4066,8 @@ test_nbit_compound_3(hid_t file) if(((unsigned int *)orig_data[i].v.p)[k] !=((unsigned int *)new_data[i].v.p)[k]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu\n", (unsigned long)i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu\n", (unsigned long)i); goto error; } @@ -4076,8 +4075,8 @@ test_nbit_compound_3(hid_t file) if(orig_data[i].o[j] != new_data[i].o[j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu\n", (unsigned long)i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu\n", (unsigned long)i); goto error; } } @@ -4138,41 +4137,41 @@ test_nbit_int_size(hid_t file) /* Define dataset datatype (integer), and set precision, offset */ if((datatype = H5Tcopy(H5T_NATIVE_INT)) < 0) { H5_FAILED(); - printf(" line %d: H5Tcopy failed\n",__LINE__); + HDprintf(" line %d: H5Tcopy failed\n",__LINE__); goto error; } /* end if */ precision = 16; /* precision includes sign bit */ if(H5Tset_precision(datatype,precision)<0) { H5_FAILED(); - printf(" line %d: H5Pset_precision failed\n",__LINE__); + HDprintf(" line %d: H5Pset_precision failed\n",__LINE__); goto error; } /* end if */ offset = 8; if(H5Tset_offset(datatype,offset)<0) { H5_FAILED(); - printf(" line %d: H5Tset_offset failed\n",__LINE__); + HDprintf(" line %d: H5Tset_offset failed\n",__LINE__); goto error; } /* end if */ /* Copy to memory datatype */ if((mem_datatype = H5Tcopy(datatype)) < 0) { H5_FAILED(); - printf(" line %d: H5Tcopy failed\n",__LINE__); + HDprintf(" line %d: H5Tcopy failed\n",__LINE__); goto error; } /* end if */ /* Set order of dataset datatype */ if(H5Tset_order(datatype, H5T_ORDER_BE)<0) { H5_FAILED(); - printf(" line %d: H5Pset_order failed\n",__LINE__); + HDprintf(" line %d: H5Pset_order failed\n",__LINE__); goto error; } /* end if */ if(H5Tset_size(datatype, 4)<0) { H5_FAILED(); - printf(" line %d: H5Pset_size failed\n",__LINE__); + HDprintf(" line %d: H5Pset_size failed\n",__LINE__); goto error; } /* end if */ @@ -4191,7 +4190,7 @@ test_nbit_int_size(hid_t file) dims[1] = DSET_DIM2; if((dataspace = H5Screate_simple (2, dims, NULL))<0) { H5_FAILED(); - printf(" line %d: H5Pcreate failed\n",__LINE__); + HDprintf(" line %d: H5Pcreate failed\n",__LINE__); goto error; } /* end if */ @@ -4202,13 +4201,13 @@ test_nbit_int_size(hid_t file) chunk_size[1] = DSET_DIM2/10; if((dset_create_props = H5Pcreate (H5P_DATASET_CREATE))<0) { H5_FAILED(); - printf(" line %d: H5Pcreate failed\n",__LINE__); + HDprintf(" line %d: H5Pcreate failed\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk (dset_create_props, 2, chunk_size)<0) { H5_FAILED(); - printf(" line %d: H5Pset_chunk failed\n",__LINE__); + HDprintf(" line %d: H5Pset_chunk failed\n",__LINE__); goto error; } /* end if */ @@ -4217,7 +4216,7 @@ test_nbit_int_size(hid_t file) */ if(H5Pset_nbit (dset_create_props)<0) { H5_FAILED(); - printf(" line %d: H5Pset_nbit failed\n",__LINE__); + HDprintf(" line %d: H5Pset_nbit failed\n",__LINE__); goto error; } /* end if */ @@ -4228,7 +4227,7 @@ test_nbit_int_size(hid_t file) dataspace, H5P_DEFAULT, dset_create_props, H5P_DEFAULT))<0) { H5_FAILED(); - printf(" line %d: H5dwrite failed\n",__LINE__); + HDprintf(" line %d: H5dwrite failed\n",__LINE__); goto error; } /* end if */ @@ -4238,7 +4237,7 @@ test_nbit_int_size(hid_t file) if(H5Dwrite (dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data)<0) { H5_FAILED(); - printf(" Line %d: H5Dwrite failed\n",__LINE__); + HDprintf(" Line %d: H5Dwrite failed\n",__LINE__); goto error; } /* end if */ @@ -4247,7 +4246,7 @@ test_nbit_int_size(hid_t file) */ if((precision = H5Tget_precision(datatype)) == 0) { H5_FAILED(); - printf(" Line %d: wrong precision size: %zu\n",__LINE__, precision); + HDprintf(" Line %d: wrong precision size: %zu\n",__LINE__, precision); goto error; } /* end if */ @@ -4327,7 +4326,7 @@ test_nbit_flt_size(hid_t file) *-------------------------------------------------------------------*/ if((datatype = H5Tcopy(H5T_IEEE_F32LE)) < 0) { H5_FAILED(); - printf(" line %d: H5Tcopy failed\n",__LINE__); + HDprintf(" line %d: H5Tcopy failed\n",__LINE__); goto error; } /* end if */ @@ -4341,38 +4340,38 @@ test_nbit_flt_size(hid_t file) if(H5Tset_fields(datatype, spos, epos, esize, mpos, msize)<0) { H5_FAILED(); - printf(" line %d: H5Tset_fields failed\n",__LINE__); + HDprintf(" line %d: H5Tset_fields failed\n",__LINE__); goto error; } /* end if */ if(H5Tset_offset(datatype,offset)<0) { H5_FAILED(); - printf(" line %d: H5Tset_offset failed\n",__LINE__); + HDprintf(" line %d: H5Tset_offset failed\n",__LINE__); goto error; } /* end if */ if(H5Tset_precision(datatype,precision)<0) { H5_FAILED(); - printf(" line %d: H5Tset_precision failed\n",__LINE__); + HDprintf(" line %d: H5Tset_precision failed\n",__LINE__); goto error; } /* end if */ if(H5Tset_size(datatype, 4)<0) { H5_FAILED(); - printf(" line %d: H5Pset_size failed\n",__LINE__); + HDprintf(" line %d: H5Pset_size failed\n",__LINE__); goto error; } /* end if */ /* Set order of dataset datatype */ if(H5Tset_order(datatype, H5T_ORDER_BE)<0) { H5_FAILED(); - printf(" line %d: H5Pset_order failed\n",__LINE__); + HDprintf(" line %d: H5Pset_order failed\n",__LINE__); goto error; } /* end if */ if(H5Tset_ebias(datatype, 31)<0) { H5_FAILED(); - printf(" line %d: H5Pset_size failed\n",__LINE__); + HDprintf(" line %d: H5Pset_size failed\n",__LINE__); goto error; } /* end if */ @@ -4389,7 +4388,7 @@ test_nbit_flt_size(hid_t file) dims[1] = DSET_DIM2; if((dataspace = H5Screate_simple (2, dims, NULL))<0) { H5_FAILED(); - printf(" line %d: H5Pcreate failed\n",__LINE__); + HDprintf(" line %d: H5Pcreate failed\n",__LINE__); goto error; } /* end if */ @@ -4400,13 +4399,13 @@ test_nbit_flt_size(hid_t file) chunk_size[1] = DSET_DIM2/10; if((dset_create_props = H5Pcreate (H5P_DATASET_CREATE))<0) { H5_FAILED(); - printf(" line %d: H5Pcreate failed\n",__LINE__); + HDprintf(" line %d: H5Pcreate failed\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk (dset_create_props, 2, chunk_size)<0) { H5_FAILED(); - printf(" line %d: H5Pset_chunk failed\n",__LINE__); + HDprintf(" line %d: H5Pset_chunk failed\n",__LINE__); goto error; } /* end if */ @@ -4415,7 +4414,7 @@ test_nbit_flt_size(hid_t file) */ if(H5Pset_nbit (dset_create_props)<0) { H5_FAILED(); - printf(" line %d: H5Pset_nbit failed\n",__LINE__); + HDprintf(" line %d: H5Pset_nbit failed\n",__LINE__); goto error; } /* end if */ @@ -4426,7 +4425,7 @@ test_nbit_flt_size(hid_t file) dataspace, H5P_DEFAULT, dset_create_props, H5P_DEFAULT))<0) { H5_FAILED(); - printf(" line %d: H5dwrite failed\n",__LINE__); + HDprintf(" line %d: H5dwrite failed\n",__LINE__); goto error; } /* end if */ @@ -4436,7 +4435,7 @@ test_nbit_flt_size(hid_t file) if(H5Dwrite (dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data)<0) { H5_FAILED(); - printf(" Line %d: H5Dwrite failed\n",__LINE__); + HDprintf(" Line %d: H5Dwrite failed\n",__LINE__); goto error; } /* end if */ @@ -4445,7 +4444,7 @@ test_nbit_flt_size(hid_t file) */ if((precision = H5Tget_precision(datatype)) == 0) { H5_FAILED(); - printf(" Line %d: wrong precision size: %zu\n",__LINE__, precision); + HDprintf(" Line %d: wrong precision size: %zu\n",__LINE__, precision); goto error; } /* end if */ @@ -4496,7 +4495,7 @@ test_scaleoffset_int(hid_t file) int new_data[2][5]; size_t i, j; - puts("Testing scaleoffset filter"); + HDputs("Testing scaleoffset filter"); TESTING(" scaleoffset int without fill value (setup)"); datatype = H5Tcopy(H5T_NATIVE_INT); @@ -4559,8 +4558,8 @@ test_scaleoffset_int(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(new_data[i][j] != orig_data[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -4688,8 +4687,8 @@ test_scaleoffset_int_2(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(new_data[0][j] != orig_data[0][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); goto error; } } @@ -4800,8 +4799,8 @@ test_scaleoffset_float(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -3.0F)) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -4931,8 +4930,8 @@ test_scaleoffset_float_2(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -3.0F)) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); goto error; } } @@ -5042,8 +5041,8 @@ test_scaleoffset_double(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -7.0F)) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; } } @@ -5173,8 +5172,8 @@ test_scaleoffset_double_2(hid_t file) for(j=0; j<(size_t)size[1]; j++) { if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -7.0F)) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); goto error; } } @@ -5240,7 +5239,7 @@ test_multiopen (hid_t file) if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error; if(cur_size[0] != tmp_size[0]) { H5_FAILED(); - printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); + HDprintf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); goto error; } /* end if */ @@ -5402,30 +5401,30 @@ test_can_apply(hid_t file) /* Create dcpl with special filter */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dcpl\n",__LINE__); + HDprintf(" Line %d: Can't create dcpl\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) { H5_FAILED(); - printf(" Line %d: Can't set chunk sizes\n",__LINE__); + HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__); goto error; } /* end if */ if(H5Zregister (H5Z_CAN_APPLY_TEST) < 0) { H5_FAILED(); - printf(" Line %d: Can't register 'can apply' filter\n",__LINE__); + HDprintf(" Line %d: Can't register 'can apply' filter\n",__LINE__); goto error; } /* The filter is mandate. */ if(H5Pset_filter(dcpl, H5Z_FILTER_CAN_APPLY_TEST, 0, (size_t)0, NULL) < 0) { H5_FAILED(); - printf(" Line %d: Can't set bogus filter\n",__LINE__); + HDprintf(" Line %d: Can't set bogus filter\n",__LINE__); goto error; } /* Create the data space */ if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataspace\n",__LINE__); + HDprintf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ @@ -5437,7 +5436,7 @@ test_can_apply(hid_t file) } H5E_END_TRY; if(dsid >=0) { H5_FAILED(); - printf(" Line %d: Shouldn't have created dataset!\n",__LINE__); + HDprintf(" Line %d: Shouldn't have created dataset!\n",__LINE__); H5Dclose(dsid); goto error; } /* end if */ @@ -5448,7 +5447,7 @@ test_can_apply(hid_t file) } H5E_END_TRY; if(dsid >=0) { H5_FAILED(); - printf(" Line %d: Shouldn't have created dataset!\n",__LINE__); + HDprintf(" Line %d: Shouldn't have created dataset!\n",__LINE__); H5Dclose(dsid); goto error; } /* end if */ @@ -5456,42 +5455,42 @@ test_can_apply(hid_t file) /* Create new dataset */ if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dataset\n",__LINE__); + HDprintf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); - printf(" Line %d: Error writing dataset data\n",__LINE__); + HDprintf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Flush the file (to clear the cache) */ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { H5_FAILED(); - printf(" Line %d: Error flushing file\n",__LINE__); + HDprintf(" Line %d: Error flushing file\n",__LINE__); goto error; } /* end if */ /* Query the dataset's size on disk */ if((dset_size=H5Dget_storage_size(dsid))==0) { H5_FAILED(); - printf(" Line %d: Error querying dataset size\n",__LINE__); + HDprintf(" Line %d: Error querying dataset size\n",__LINE__); goto error; } /* end if */ /* Verify that the size indicates data is uncompressed */ if((H5Tget_size(H5T_NATIVE_INT)*dims[0]*dims[1])!=dset_size) { H5_FAILED(); - printf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size); + HDprintf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size); goto error; } /* end if */ /* Read data */ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { H5_FAILED(); - printf(" Line %d: Error reading dataset data\n",__LINE__); + HDprintf(" Line %d: Error reading dataset data\n",__LINE__); goto error; } /* end if */ @@ -5501,10 +5500,10 @@ test_can_apply(hid_t file) for(j=0; j<(size_t)dims[1]; j++) { if(points[i][j] != check[i][j]) { H5_FAILED(); - printf(" Line %d: Read different values than written.\n",__LINE__); - printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); - printf(" At original: %d\n",points[i][j]); - printf(" At returned: %d\n",check[i][j]); + HDprintf(" Line %d: Read different values than written.\n",__LINE__); + HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); + HDprintf(" At original: %d\n",points[i][j]); + HDprintf(" At returned: %d\n",check[i][j]); goto error; } /* end if */ } /* end for */ @@ -5513,21 +5512,21 @@ test_can_apply(hid_t file) /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n",__LINE__); + HDprintf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close dataspace */ if(H5Sclose(sid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataspace\n",__LINE__); + HDprintf(" Line %d: Can't close dataspace\n",__LINE__); goto error; } /* end if */ /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dcpl\n",__LINE__); + HDprintf(" Line %d: Can't close dcpl\n",__LINE__); goto error; } /* end if */ @@ -5585,72 +5584,72 @@ test_can_apply2(hid_t file) /* Create dcpl with special filter */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dcpl\n",__LINE__); + HDprintf(" Line %d: Can't create dcpl\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) { H5_FAILED(); - printf(" Line %d: Can't set chunk sizes\n",__LINE__); + HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__); goto error; } /* end if */ if(H5Zregister (H5Z_CAN_APPLY_TEST2) < 0) { H5_FAILED(); - printf(" Line %d: Can't register 'can apply' filter\n",__LINE__); + HDprintf(" Line %d: Can't register 'can apply' filter\n",__LINE__); goto error; } /* The filter is optional. */ if(H5Pset_filter(dcpl, H5Z_FILTER_CAN_APPLY_TEST2, H5Z_FLAG_OPTIONAL, (size_t)0, NULL) < 0) { H5_FAILED(); - printf(" Line %d: Can't set bogus filter\n",__LINE__); + HDprintf(" Line %d: Can't set bogus filter\n",__LINE__); goto error; } /* Create the data space */ if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataspace\n",__LINE__); + HDprintf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create new dataset */ if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dataset\n",__LINE__); + HDprintf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); - printf(" Line %d: Error writing dataset data\n",__LINE__); + HDprintf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Flush the file (to clear the cache) */ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { H5_FAILED(); - printf(" Line %d: Error flushing file\n",__LINE__); + HDprintf(" Line %d: Error flushing file\n",__LINE__); goto error; } /* end if */ /* Query the dataset's size on disk */ if((dset_size=H5Dget_storage_size(dsid))==0) { H5_FAILED(); - printf(" Line %d: Error querying dataset size\n",__LINE__); + HDprintf(" Line %d: Error querying dataset size\n",__LINE__); goto error; } /* end if */ /* Verify that the size indicates data is uncompressed */ if((H5Tget_size(H5T_NATIVE_DOUBLE)*dims[0]*dims[1])!=dset_size) { H5_FAILED(); - printf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size); + HDprintf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size); goto error; } /* end if */ /* Read data */ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { H5_FAILED(); - printf(" Line %d: Error reading dataset data\n",__LINE__); + HDprintf(" Line %d: Error reading dataset data\n",__LINE__); goto error; } /* end if */ @@ -5660,10 +5659,10 @@ test_can_apply2(hid_t file) for(j=0; j<(size_t)dims[1]; j++) { if(points[i][j] != check[i][j]) { H5_FAILED(); - printf(" Line %d: Read different values than written.\n",__LINE__); - printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); - printf(" At original: %d\n",points[i][j]); - printf(" At returned: %d\n",check[i][j]); + HDprintf(" Line %d: Read different values than written.\n",__LINE__); + HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); + HDprintf(" At original: %d\n",points[i][j]); + HDprintf(" At returned: %d\n",check[i][j]); goto error; } /* end if */ } /* end for */ @@ -5672,21 +5671,21 @@ test_can_apply2(hid_t file) /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n",__LINE__); + HDprintf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close dataspace */ if(H5Sclose(sid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataspace\n",__LINE__); + HDprintf(" Line %d: Can't close dataspace\n",__LINE__); goto error; } /* end if */ /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dcpl\n",__LINE__); + HDprintf(" Line %d: Can't close dcpl\n",__LINE__); goto error; } /* end if */ @@ -5742,19 +5741,19 @@ file) /* Create the data space */ if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataspace\n",__LINE__); + HDprintf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create dcpl with special filter */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dcpl\n",__LINE__); + HDprintf(" Line %d: Can't create dcpl\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) { H5_FAILED(); - printf(" Line %d: Can't set chunk sizes\n",__LINE__); + HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__); goto error; } /* end if */ @@ -5765,7 +5764,7 @@ file) } H5E_END_TRY; if(ret>=0) { H5_FAILED(); - printf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__); + HDprintf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__); goto error; } @@ -5776,7 +5775,7 @@ file) } H5E_END_TRY; if(ret>=0) { H5_FAILED(); - printf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__); + HDprintf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__); goto error; } @@ -5784,7 +5783,7 @@ file) szip_pixels_per_block=2; if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) { H5_FAILED(); - printf(" Line %d: Can't set szip filter\n",__LINE__); + HDprintf(" Line %d: Can't set szip filter\n",__LINE__); goto error; } @@ -5796,47 +5795,47 @@ file) } H5E_END_TRY; if(dsid <=0) { H5_FAILED(); - printf(" Line %d: Should have created dataset!\n",__LINE__); + HDprintf(" Line %d: Should have created dataset!\n",__LINE__); goto error; } /* end if */ /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n",__LINE__); + HDprintf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close dataspace */ if(H5Sclose(sid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataspace\n",__LINE__); + HDprintf(" Line %d: Can't close dataspace\n",__LINE__); goto error; } /* end if */ /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dcpl\n",__LINE__); + HDprintf(" Line %d: Can't close dcpl\n",__LINE__); goto error; } /* end if */ /* Create another data space */ if((sid = H5Screate_simple(2, dims2, NULL)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataspace\n",__LINE__); + HDprintf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create dcpl with special filter */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dcpl\n",__LINE__); + HDprintf(" Line %d: Can't create dcpl\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0) { H5_FAILED(); - printf(" Line %d: Can't set chunk sizes\n",__LINE__); + HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__); goto error; } /* end if */ @@ -5844,7 +5843,7 @@ file) szip_pixels_per_block=32; if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) { H5_FAILED(); - printf(" Line %d: Can't set szip filter\n",__LINE__); + HDprintf(" Line %d: Can't set szip filter\n",__LINE__); goto error; } @@ -5855,7 +5854,7 @@ file) } H5E_END_TRY; if(dsid >=0) { H5_FAILED(); - printf(" Line %d: Shouldn't have created dataset!\n",__LINE__); + HDprintf(" Line %d: Shouldn't have created dataset!\n",__LINE__); H5Dclose(dsid); goto error; } /* end if */ @@ -5863,14 +5862,14 @@ file) /* Close dataspace */ if(H5Sclose(sid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataspace\n",__LINE__); + HDprintf(" Line %d: Can't close dataspace\n",__LINE__); goto error; } /* end if */ /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dcpl\n",__LINE__); + HDprintf(" Line %d: Can't close dcpl\n",__LINE__); goto error; } /* end if */ @@ -5878,11 +5877,11 @@ file) PASSED(); } else { SKIPPED(); - puts(" Szip encoding is not enabled."); + HDputs(" Szip encoding is not enabled."); } #else /* H5_HAVE_FILTER_SZIP */ SKIPPED(); - puts(" Szip filter is not enabled."); + HDputs(" Szip filter is not enabled."); #endif /* H5_HAVE_FILTER_SZIP */ return SUCCEED; @@ -5948,57 +5947,57 @@ test_set_local(hid_t fapl) /* Open file */ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open file\n",__LINE__); + HDprintf(" Line %d: Can't open file\n",__LINE__); goto error; } /* Create dcpl with special filter */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dcpl\n",__LINE__); + HDprintf(" Line %d: Can't create dcpl\n",__LINE__); goto error; } /* end if */ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) { H5_FAILED(); - printf(" Line %d: Can't set chunk sizes\n",__LINE__); + HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__); goto error; } /* end if */ if(H5Zregister (H5Z_SET_LOCAL_TEST) < 0) { H5_FAILED(); - printf(" Line %d: Can't register 'set local' filter\n",__LINE__); + HDprintf(" Line %d: Can't register 'set local' filter\n",__LINE__); goto error; } if(H5Pset_filter(dcpl, H5Z_FILTER_SET_LOCAL_TEST, 0, (size_t)BOGUS2_PERM_NPARMS, cd_values) < 0) { H5_FAILED(); - printf(" Line %d: Can't set bogus2 filter\n",__LINE__); + HDprintf(" Line %d: Can't set bogus2 filter\n",__LINE__); goto error; } /* Create the data space */ if((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataspace\n",__LINE__); + HDprintf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create new dataset */ if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dataset\n",__LINE__); + HDprintf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); - printf(" Line %d: Error writing dataset data\n",__LINE__); + HDprintf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n",__LINE__); + HDprintf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ @@ -6006,77 +6005,77 @@ test_set_local(hid_t fapl) /* (Shouldn't get modified by output filter) */ if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf(" Line %d: Can't create dataset\n",__LINE__); + HDprintf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ if(H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) { H5_FAILED(); - printf(" Line %d: Error writing dataset data\n",__LINE__); + HDprintf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n",__LINE__); + HDprintf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close dataspace */ if(H5Sclose(sid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataspace\n", __LINE__); + HDprintf(" Line %d: Can't close dataspace\n", __LINE__); goto error; } /* end if */ /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dcpl\n", __LINE__); + HDprintf(" Line %d: Can't close dcpl\n", __LINE__); goto error; } /* end if */ /* Close file (flushes & empties cache) */ if(H5Fclose(file) < 0) { H5_FAILED(); - printf(" Line %d: Can't close file\n", __LINE__); + HDprintf(" Line %d: Can't close file\n", __LINE__); goto error; } /* end if */ /* Open file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open file\n", __LINE__); + HDprintf(" Line %d: Can't open file\n", __LINE__); goto error; } /* Re-open dataset */ if((dsid = H5Dopen2(file, DSET_SET_LOCAL_NAME, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataset\n", __LINE__); + HDprintf(" Line %d: Can't open dataset\n", __LINE__); goto error; } /* end if */ /* Query the dataset's size on disk */ if((dset_size = H5Dget_storage_size(dsid)) == 0) { H5_FAILED(); - printf(" Line %d: Error querying dataset size\n", __LINE__); + HDprintf(" Line %d: Error querying dataset size\n", __LINE__); goto error; } /* end if */ /* Verify that the size indicates data is uncompressed */ if((H5Tget_size(H5T_NATIVE_INT) * dims[0] * dims[1]) != dset_size) { H5_FAILED(); - printf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size); + HDprintf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size); goto error; } /* end if */ /* Read data */ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { H5_FAILED(); - printf(" Line %d: Error reading dataset data\n", __LINE__); + HDprintf(" Line %d: Error reading dataset data\n", __LINE__); goto error; } /* end if */ @@ -6086,10 +6085,10 @@ test_set_local(hid_t fapl) for(j=0; j<dims[1]; j++) { if((points[i][j]+(int)sizeof(int)) != check[i][j]) { H5_FAILED(); - printf(" Line %d: Read different values than written.\n",__LINE__); - printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); - printf(" At original: %d\n",points[i][j]); - printf(" At returned: %d\n",check[i][j]); + HDprintf(" Line %d: Read different values than written.\n",__LINE__); + HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); + HDprintf(" At original: %d\n",points[i][j]); + HDprintf(" At returned: %d\n",check[i][j]); goto error; } /* end if */ } /* end for */ @@ -6098,35 +6097,35 @@ test_set_local(hid_t fapl) /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n", __LINE__); + HDprintf(" Line %d: Can't close dataset\n", __LINE__); goto error; } /* end if */ /* Re-open second dataset */ if((dsid = H5Dopen2(file, DSET_SET_LOCAL_NAME_2, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf(" Line %d: Can't open dataset\n", __LINE__); + HDprintf(" Line %d: Can't open dataset\n", __LINE__); goto error; } /* end if */ /* Query the dataset's size on disk */ if((dset_size = H5Dget_storage_size(dsid)) == 0) { H5_FAILED(); - printf(" Line %d: Error querying dataset size\n", __LINE__); + HDprintf(" Line %d: Error querying dataset size\n", __LINE__); goto error; } /* end if */ /* Verify that the size indicates data is uncompressed */ if((H5Tget_size(H5T_NATIVE_DOUBLE) * dims[0] * dims[1]) != dset_size) { H5_FAILED(); - printf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size); + HDprintf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size); goto error; } /* end if */ /* Read data */ if(H5Dread(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_dbl) < 0) { H5_FAILED(); - printf(" Line %d: Error reading dataset data\n", __LINE__); + HDprintf(" Line %d: Error reading dataset data\n", __LINE__); goto error; } /* end if */ @@ -6138,10 +6137,10 @@ test_set_local(hid_t fapl) * considered not equal. */ if(!H5_DBL_REL_EQUAL(points_dbl[i][j], check_dbl[i][j], (double)0.00001F)) { H5_FAILED(); - printf(" Line %d: Read different values than written.\n",__LINE__); - printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); - printf(" At original: %f\n",points_dbl[i][j]); - printf(" At returned: %f\n",check_dbl[i][j]); + HDprintf(" Line %d: Read different values than written.\n",__LINE__); + HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); + HDprintf(" At original: %f\n",points_dbl[i][j]); + HDprintf(" At returned: %f\n",check_dbl[i][j]); goto error; } /* end if */ } /* end for */ @@ -6150,14 +6149,14 @@ test_set_local(hid_t fapl) /* Close dataset */ if(H5Dclose(dsid) < 0) { H5_FAILED(); - printf(" Line %d: Can't close dataset\n",__LINE__); + HDprintf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close file */ if(H5Fclose(file) < 0) { H5_FAILED(); - printf(" Line %d: Can't close file\n",__LINE__); + HDprintf(" Line %d: Can't close file\n",__LINE__); goto error; } /* end if */ @@ -6458,7 +6457,7 @@ test_filter_delete(hid_t file) } H5E_END_TRY; if(ret >=0) { H5_FAILED(); - printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); + HDprintf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); goto error; } /* end if */ @@ -6468,7 +6467,7 @@ test_filter_delete(hid_t file) } H5E_END_TRY; if(ret >=0) { H5_FAILED(); - printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); + HDprintf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); goto error; } /* end if */ @@ -6566,7 +6565,7 @@ auxread_fdata(hid_t fid, const char *name) if(nelmts) { buf = (void *)HDmalloc((size_t)(nelmts * msize)); if(buf == NULL) { - printf( "cannot read into memory\n" ); + HDprintf( "cannot read into memory\n" ); goto error; } if(H5Dread(dset_id, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) @@ -6965,13 +6964,13 @@ test_missing_chunk(hid_t file) for(u=0; u<MISSING_CHUNK_DIM; u++) { if((u%10)>=5) { if(rdata[u]!=911) { - printf(" Line %d: Incorrect value, rdata[%u]=%d\n",__LINE__,(unsigned)u,rdata[u]); + HDprintf(" Line %d: Incorrect value, rdata[%u]=%d\n",__LINE__,(unsigned)u,rdata[u]); TEST_ERROR; } /* end if */ } /* end if */ else { if(rdata[u]!=wdata[u]) { - printf(" Line %d: Incorrect value, wdata[%u]=%d, rdata[%u]=%d\n",__LINE__,(unsigned)u,wdata[u],(unsigned)u,rdata[u]); + HDprintf(" Line %d: Incorrect value, wdata[%u]=%d, rdata[%u]=%d\n",__LINE__,(unsigned)u,wdata[u],(unsigned)u,rdata[u]); TEST_ERROR; } /* end if */ } /* end else */ @@ -6983,14 +6982,14 @@ test_missing_chunk(hid_t file) if((i % 10) >= 5 || (j % 10) >= 5) { if(rdata2[i][j] != 911) { - printf(" Line %d: Incorrect value, rdata2[%u][%u] = %d\n", + HDprintf(" Line %d: Incorrect value, rdata2[%u][%u] = %d\n", __LINE__,(unsigned)i, (unsigned)j, rdata2[i][j]); TEST_ERROR; } /* end if */ } /* end if */ else { if(rdata2[i][j] != wdata2[i][j]) { - printf(" Line %d: Incorrect value, wdata2[%u][%u] = %d, rdata2[%u][%u] = %d\n", + HDprintf(" Line %d: Incorrect value, wdata2[%u][%u] = %d, rdata2[%u][%u] = %d\n", __LINE__,(unsigned)i, (unsigned)j, wdata2[i][j],(unsigned)i, (unsigned)j, rdata2[i][j]); TEST_ERROR; } /* end if */ @@ -7154,8 +7153,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < NPOINTS; i++) if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); - printf(" coord[%u] = {%lu, %lu}\n", (unsigned)i, (unsigned long)coord[i][0], (unsigned long)coord[i][1]); + HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); + HDprintf(" coord[%u] = {%lu, %lu}\n", (unsigned)i, (unsigned long)coord[i][0], (unsigned long)coord[i][1]); TEST_ERROR; } /* end if */ @@ -7261,7 +7260,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < NPOINTS; i++) if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); + HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); TEST_ERROR; } /* end if */ @@ -7367,7 +7366,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < NPOINTS; i++) if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); + HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); TEST_ERROR; } /* end if */ @@ -7508,7 +7507,7 @@ test_deprec(hid_t file) } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); - puts(" Library allowed overwrite of existing dataset."); + HDputs(" Library allowed overwrite of existing dataset."); goto error; } @@ -7529,7 +7528,7 @@ test_deprec(hid_t file) } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); - puts(" Opened a non-existent dataset."); + HDputs(" Opened a non-existent dataset."); goto error; } @@ -7578,7 +7577,7 @@ test_deprec(hid_t file) } H5E_END_TRY; if(dataset >= 0) { H5_FAILED(); - puts(" Opened a dataset with incorrect chunking parameters."); + HDputs(" Opened a dataset with incorrect chunking parameters."); goto error; } @@ -7630,7 +7629,7 @@ test_deprec(hid_t file) if(H5Zregister(H5Z_DEPREC) < 0) goto error; if(H5Pset_filter(dcpl, H5Z_FILTER_DEPREC, 0, (size_t)0, NULL) < 0) goto error; - puts(""); + HDputs(""); if(test_filter_internal(file,DSET_DEPREC_NAME_FILTER,dcpl,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deprec_size) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -8130,15 +8129,15 @@ test_big_chunks_bypass_cache(hid_t fapl) /* Verify data for the first 1-D dataset */ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) if(rdata1[i] != i) { - printf(" Read different values than written in the 1st chunk.\n"); - printf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], i); + HDprintf(" Read different values than written in the 1st chunk.\n"); + HDprintf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], i); TEST_ERROR } /* end if */ for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++) if(rdata1[j] != fvalue) { - printf(" Read different values than written in the 2nd chunk.\n"); - printf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], fvalue); + HDprintf(" Read different values than written in the 2nd chunk.\n"); + HDprintf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], fvalue); TEST_ERROR } /* end if */ @@ -8146,8 +8145,8 @@ test_big_chunks_bypass_cache(hid_t fapl) for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) if(t_rdata1[i][j] != j) { - printf(" Read different values than written in the 1st chunk.\n"); - printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", + HDprintf(" Read different values than written in the 1st chunk.\n"); + HDprintf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", __LINE__, i, j, t_rdata1[i][j], j); TEST_ERROR } /* end if */ @@ -8155,8 +8154,8 @@ test_big_chunks_bypass_cache(hid_t fapl) for(i = BYPASS_CHUNK_DIM / 2; i < BYPASS_DIM; i++) for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++) if(t_rdata1[i][j] != fvalue) { - printf(" Read different values than written in the 2nd chunk.\n"); - printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", + HDprintf(" Read different values than written in the 2nd chunk.\n"); + HDprintf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", __LINE__, i, j, t_rdata1[i][j], fvalue); TEST_ERROR } /* end if */ @@ -8202,8 +8201,8 @@ test_big_chunks_bypass_cache(hid_t fapl) /* Verify data for the second 1-D dataset */ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) if(rdata2[i] != i) { - printf(" Read different values than written in the chunk.\n"); - printf(" At line %d and index %d, rdata2 = %d. It should be %d.\n", __LINE__, i, rdata2[i], i); + HDprintf(" Read different values than written in the chunk.\n"); + HDprintf(" At line %d and index %d, rdata2 = %d. It should be %d.\n", __LINE__, i, rdata2[i], i); TEST_ERROR } /* end if */ @@ -8211,8 +8210,8 @@ test_big_chunks_bypass_cache(hid_t fapl) for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) if(t_rdata2[i][j] != j) { - printf(" Read different values than written in the chunk.\n"); - printf(" At line %d and index (%d, %d), t_rdata2 = %d. It should be %d.\n", + HDprintf(" Read different values than written in the chunk.\n"); + HDprintf(" At line %d and index (%d, %d), t_rdata2 = %d. It should be %d.\n", __LINE__, i, j, t_rdata2[i][j], j); TEST_ERROR } /* end if */ @@ -8941,7 +8940,7 @@ test_chunk_expand(hid_t fapl) if(sizeof(size_t) <= 4 && low != H5F_LIBVER_LATEST) { SKIPPED(); - puts(" Current machine can't test for error w/old file format"); + HDputs(" Current machine can't test for error w/old file format"); } /* end if */ else { /* Register "expansion" filter */ @@ -9604,7 +9603,7 @@ test_fixed_array(hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < POINTS; i++) if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", + HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); TEST_ERROR; } /* end if */ @@ -9632,7 +9631,7 @@ test_fixed_array(hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < POINTS; i++) if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", + HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); TEST_ERROR; } /* end if */ @@ -9658,7 +9657,7 @@ test_fixed_array(hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < POINTS_BIG; i++) if(rbuf_big[i] != wbuf_big[i]) { - printf(" Line %d: Incorrect value, wbuf_bif[%u]=%d, rbuf_big[%u]=%d\n", + HDprintf(" Line %d: Incorrect value, wbuf_bif[%u]=%d, rbuf_big[%u]=%d\n", __LINE__,(unsigned)i,wbuf_big[i],(unsigned)i,rbuf_big[i]); TEST_ERROR; } /* end if */ @@ -9897,7 +9896,7 @@ test_single_chunk(hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < (DSET_DIM1 * DSET_DIM2); i++) if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", + HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); TEST_ERROR; } /* end if */ @@ -9916,7 +9915,7 @@ test_single_chunk(hid_t fapl) /* Verify that written and read data are the same */ for(i = 0; i < (DSET_TMP_DIM1* DSET_TMP_DIM2); i++) if(t_rbuf[i] != t_wbuf[i]) { - printf(" Line %d: Incorrect value, t_wbuf[%u]=%d, t_rbuf[%u]=%d\n", + HDprintf(" Line %d: Incorrect value, t_wbuf[%u]=%d, t_rbuf[%u]=%d\n", __LINE__,(unsigned)i,t_wbuf[i],(unsigned)i,t_rbuf[i]); TEST_ERROR; } /* end if */ @@ -11518,7 +11517,7 @@ typedef struct scatter_info_t { for(k=0; k<(int)(sizeof(ARR[0][0])/sizeof(ARR[0][0][0])); k++) \ if(ARR[i][j][k] != EXP[i][j][k]) { \ H5_FAILED(); AT(); \ - printf(" " #ARR "[%d][%d][%d] == %d, " #EXP "[%d][%d][%d] == %d\n", i, j, k, ARR[i][j][k], i, j, k, EXP[i][j][k]); \ + HDprintf(" " #ARR "[%d][%d][%d] == %d, " #EXP "[%d][%d][%d] == %d\n", i, j, k, ARR[i][j][k], i, j, k, EXP[i][j][k]); \ goto error; \ } @@ -12899,8 +12898,8 @@ error: * Purpose: Tests various format versions. * (Currently, only virtual dataset feature) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: SUCCEED + * Failure: FAIL * Description: * This function attempts to create a virtual dataset in all * valid combinations of low/high library format bounds. Creation @@ -13079,10 +13078,12 @@ test_object_header_minimization_dcpl(void) TEST_ERROR file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (0 > file_id) TEST_ERROR + if (file_id == H5I_INVALID_HID) + TEST_ERROR dcpl_id = H5Pcreate(H5P_DATASET_CREATE); - if (0 > dcpl_id) TEST_ERROR + if (dcpl_id == H5I_INVALID_HID) + TEST_ERROR /*********/ /* TESTS */ @@ -13090,21 +13091,26 @@ test_object_header_minimization_dcpl(void) /* default value (not set explicitly) */ - if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL) TEST_ERROR + if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL) + TEST_ERROR if (FALSE != minimize) TEST_ERROR /* FALSE-set value */ - if (H5Pset_dset_no_attrs_hint(dcpl_id, FALSE) == FAIL) TEST_ERROR - if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL) TEST_ERROR + if (H5Pset_dset_no_attrs_hint(dcpl_id, FALSE) == FAIL) + TEST_ERROR + if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL) + TEST_ERROR if (FALSE != minimize) TEST_ERROR /* TRUE-set value */ - if (H5Pset_dset_no_attrs_hint(dcpl_id, TRUE) == FAIL) TEST_ERROR - if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL) TEST_ERROR + if (H5Pset_dset_no_attrs_hint(dcpl_id, TRUE) == FAIL) + TEST_ERROR + if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL) + TEST_ERROR if (TRUE != minimize) TEST_ERROR @@ -13161,8 +13167,7 @@ error: * * Purpose: Tests the dataset interface (H5D) * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Tuesday, December 9, 1997 @@ -13228,127 +13233,127 @@ main(void) /* Test with paged aggregation enabled or not */ for(paged = FALSE; paged <= TRUE; paged++) { - /* Temporary: skip testing for multi/split drivers: - fail file create when persisting free-space or using paged aggregation strategy */ - if(!contig_addr_vfd && paged) - continue; - - for (minimized_ohdr = FALSE; minimized_ohdr <= TRUE; minimized_ohdr++) { - - /* Test with old & new format groups */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl, my_fcpl; - - /* Set the FAPL for the type of format */ - if(new_format) { - my_fapl = fapl2; - if(paged) { - my_fcpl = fcpl2; - puts("\nTesting with new file format and paged aggregation"); - } else { - my_fcpl = fcpl; - puts("\nTesting with new file format and non-paged aggregation"); - } - } /* end if */ - else { - my_fapl = fapl; - if(paged) { - my_fcpl = fcpl2; - puts("Testing with old file format and paged aggregation:"); - } else { - my_fcpl = fcpl; - puts("Testing with old file format and non-paged aggregation:"); - } - } /* end else */ + /* Temporary: skip testing for multi/split drivers: + fail file create when persisting free-space or using paged aggregation strategy */ + if(!contig_addr_vfd && paged) + continue; - /* Create the file for this test */ - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, my_fcpl, my_fapl)) < 0) - goto error; + for(minimized_ohdr = FALSE; minimized_ohdr <= TRUE; minimized_ohdr++) { + + /* Test with old & new format groups */ + for(new_format = FALSE; new_format <= TRUE; new_format++) { + hid_t my_fapl, my_fcpl; + + /* Set the FAPL for the type of format */ + if(new_format) { + my_fapl = fapl2; + if(paged) { + my_fcpl = fcpl2; + HDputs("\nTesting with new file format and paged aggregation"); + } else { + my_fcpl = fcpl; + HDputs("\nTesting with new file format and non-paged aggregation"); + } + } /* end if */ + else { + my_fapl = fapl; + if(paged) { + my_fcpl = fcpl2; + HDputs("Testing with old file format and paged aggregation:"); + } else { + my_fcpl = fcpl; + HDputs("Testing with old file format and non-paged aggregation:"); + } + } /* end else */ - if (TRUE == minimized_ohdr) { - if (0 > H5Fset_dset_no_attrs_hint(file, TRUE)) + /* Create the file for this test */ + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, my_fcpl, my_fapl)) < 0) goto error; - puts("(minimized dataset object headers with file setting)"); - } - /* Cause the library to emit initial messages */ - if((grp = H5Gcreate2(file, "emit diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; - if(H5Oset_comment(grp, "Causes diagnostic messages to be emitted") < 0) - goto error; - if(H5Gclose(grp) < 0) - goto error; + if (TRUE == minimized_ohdr) { + if (0 > H5Fset_dset_no_attrs_hint(file, TRUE)) + goto error; + HDputs("(minimized dataset object headers with file setting)"); + } + + /* Cause the library to emit initial messages */ + if((grp = H5Gcreate2(file, "emit diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Oset_comment(grp, "Causes diagnostic messages to be emitted") < 0) + goto error; + if(H5Gclose(grp) < 0) + goto error; - nerrors += (test_create(file) < 0 ? 1 : 0); - 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_open_close_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); - nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); - nerrors += (test_nbit_int(file) < 0 ? 1 : 0); - nerrors += (test_nbit_float(file) < 0 ? 1 : 0); - nerrors += (test_nbit_double(file) < 0 ? 1 : 0); - nerrors += (test_nbit_array(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound_2(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound_3(file) < 0 ? 1 : 0); - nerrors += (test_nbit_int_size(file) < 0 ? 1 : 0); - nerrors += (test_nbit_flt_size(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_int(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_int_2(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_float(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_float_2(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_double(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_double_2(file) < 0 ? 1 : 0); - nerrors += (test_multiopen (file) < 0 ? 1 : 0); - nerrors += (test_types(file) < 0 ? 1 : 0); - nerrors += (test_userblock_offset(envval, my_fapl, new_format) < 0 ? 1 : 0); - nerrors += (test_missing_filter(file) < 0 ? 1 : 0); - nerrors += (test_can_apply(file) < 0 ? 1 : 0); - nerrors += (test_can_apply2(file) < 0 ? 1 : 0); - nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); - nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); - nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); - nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0); - nerrors += (test_filter_delete(file) < 0 ? 1 : 0); - nerrors += (test_filters_endianess() < 0 ? 1 : 0); - nerrors += (test_zero_dims(file) < 0 ? 1 : 0); - nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); - nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_create(file) < 0 ? 1 : 0); + 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_open_close_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); + nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); + nerrors += (test_nbit_int(file) < 0 ? 1 : 0); + nerrors += (test_nbit_float(file) < 0 ? 1 : 0); + nerrors += (test_nbit_double(file) < 0 ? 1 : 0); + nerrors += (test_nbit_array(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound_2(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound_3(file) < 0 ? 1 : 0); + nerrors += (test_nbit_int_size(file) < 0 ? 1 : 0); + nerrors += (test_nbit_flt_size(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_int(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_int_2(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_float(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_float_2(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_double(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_double_2(file) < 0 ? 1 : 0); + nerrors += (test_multiopen (file) < 0 ? 1 : 0); + nerrors += (test_types(file) < 0 ? 1 : 0); + nerrors += (test_userblock_offset(envval, my_fapl, new_format) < 0 ? 1 : 0); + nerrors += (test_missing_filter(file) < 0 ? 1 : 0); + nerrors += (test_can_apply(file) < 0 ? 1 : 0); + nerrors += (test_can_apply2(file) < 0 ? 1 : 0); + nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); + nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); + nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); + nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_filter_delete(file) < 0 ? 1 : 0); + nerrors += (test_filters_endianess() < 0 ? 1 : 0); + nerrors += (test_zero_dims(file) < 0 ? 1 : 0); + nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); + nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); #ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += (test_deprec(file) < 0 ? 1 : 0); + nerrors += (test_deprec(file) < 0 ? 1 : 0); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); - nerrors += (test_big_chunks_bypass_cache(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_fast(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_reopen_chunk_fast(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_fast_bug1(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_expand(my_fapl) < 0 ? 1 : 0); - nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0); - nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); - nerrors += (test_idx_compatible() < 0 ? 1 : 0); - nerrors += (test_unfiltered_edge_chunks(my_fapl) < 0 ? 1 : 0); - nerrors += (test_single_chunk(my_fapl) < 0 ? 1 : 0); - nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); - nerrors += (test_zero_dim_dset(my_fapl) < 0 ? 1 : 0); - nerrors += (test_storage_size(my_fapl) < 0 ? 1 : 0); - nerrors += (test_power2up(my_fapl) < 0 ? 1 : 0); - - nerrors += (test_swmr_non_latest(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_earray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_farray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_bt2_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); - - if(H5Fclose(file) < 0) - goto error; - } /* end for new_format */ - } /* for minimized dset object headers */ + nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); + nerrors += (test_big_chunks_bypass_cache(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_fast(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_reopen_chunk_fast(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_fast_bug1(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_expand(my_fapl) < 0 ? 1 : 0); + nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0); + nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); + nerrors += (test_idx_compatible() < 0 ? 1 : 0); + nerrors += (test_unfiltered_edge_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_single_chunk(my_fapl) < 0 ? 1 : 0); + nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); + nerrors += (test_zero_dim_dset(my_fapl) < 0 ? 1 : 0); + nerrors += (test_storage_size(my_fapl) < 0 ? 1 : 0); + nerrors += (test_power2up(my_fapl) < 0 ? 1 : 0); + + nerrors += (test_swmr_non_latest(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_earray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_farray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_bt2_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); + + if(H5Fclose(file) < 0) + goto error; + } /* end for new_format */ + } /* end for minimized_ohdr */ } /* end for paged */ /* Close property lists */ @@ -13363,7 +13368,7 @@ main(void) nerrors += (test_gather_error() < 0 ? 1 : 0); /* Tests version bounds using its own file */ - nerrors += (test_versionbounds() < 0 ? 1 : 0); + nerrors += (test_versionbounds() < 0 ? 1 : 0); nerrors += (test_object_header_minimization_dcpl() < 0 ? 1 : 0); @@ -13375,19 +13380,19 @@ main(void) if(nerrors) goto error; - printf("All dataset tests passed.\n"); + HDprintf("All dataset tests passed.\n"); #ifdef H5_HAVE_FILTER_SZIP if (GetTestCleanup()) HDremove(NOENCODER_COPY_FILENAME); #endif /* H5_HAVE_FILTER_SZIP */ h5_cleanup(FILENAME, fapl); - return EXIT_SUCCESS; + HDexit(EXIT_SUCCESS); error: nerrors = MAX(1, nerrors); - printf("***** %d DATASET TEST%s FAILED! *****\n", + HDprintf("***** %d DATASET TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return EXIT_FAILURE; + HDexit(EXIT_FAILURE); } /* end main() */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 645608b..7e1adf5 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -21,7 +21,7 @@ #include "h5test.h" /* Number of elements in each random test */ -#define NTESTELEM 10000 +#define NTESTELEM 10000 /* Epsilon for floating-point comparisons */ #define FP_EPSILON 0.000001F @@ -30,7 +30,7 @@ * Offset from alinged memory returned by malloc(). This can be used to test * that type conversions handle non-aligned buffers correctly. */ -#define ALIGNMENT 1 +#define ALIGNMENT 1 /* * Define if you want to test alignment code on a machine that doesn't @@ -41,7 +41,7 @@ /* Alignment test stuff */ #ifdef TEST_ALIGNMENT -#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif #define SET_ALIGNMENT(TYPE,VAL) \ @@ -58,7 +58,7 @@ const char *FILENAME[] = { * endian. If local variable `endian' is H5T_ORDER_BE then the result will * be I, otherwise the result will be Z-(I+1). */ -#define ENDIAN(Z,I,E) (H5T_ORDER_BE==E?(I):(Z)-((I)+1)) +#define ENDIAN(Z,I,E) (H5T_ORDER_BE==E?(I):(Z)-((I)+1)) typedef enum dtype_t { INT_SCHAR, INT_UCHAR, INT_SHORT, INT_USHORT, INT_INT, INT_UINT, @@ -100,8 +100,8 @@ static int skip_overflow_tests_g = 0; static int without_hardware_g = 0; /* Allocates memory aligned on a certain boundary. */ -#define aligned_malloc(Z) ((void*)((char*)HDmalloc(ALIGNMENT+Z)+ALIGNMENT)) -#define aligned_free(M) HDfree((char*)(M)-ALIGNMENT) +#define aligned_malloc(Z) ((void*)((char*)HDmalloc(ALIGNMENT+Z)+ALIGNMENT)) +#define aligned_free(M) HDfree((char*)(M)-ALIGNMENT) /* Initialize source buffer of integer for integer->integer and integer->floating-point conversion test. * This algorithm is mainly to avoid any casting and comparison between source and destination types @@ -394,13 +394,13 @@ static int my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, size_t esize); /*------------------------------------------------------------------------- - * Function: fpe_handler + * Function: fpe_handler * - * Purpose: Exit with 255 + * Purpose: Exit with 255 * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 6, 1998 * * Modifications: @@ -419,16 +419,16 @@ fpe_handler(int H5_ATTR_UNUSED signo) HDexit(255); } - + /*------------------------------------------------------------------------- - * Function: reset_hdf5 + * Function: reset_hdf5 * - * Purpose: Reset the hdf5 library. This causes statistics to be printed - * and counters to be reset. + * Purpose: Reset the hdf5 library. This causes statistics to be printed + * and counters to be reset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 * * Modifications: @@ -461,19 +461,19 @@ reset_hdf5(void) } - + /*------------------------------------------------------------------------- - * Function: except_func + * Function: except_func * - * Purpose: Gets called for all data type conversion exceptions. + * Purpose: Gets called for all data type conversion exceptions. * - * Return: H5T_CONV_ABORT: -1 + * Return: H5T_CONV_ABORT: -1 * * H5T_CONV_UNHANDLED 0 * * H5T_CONV_HANDLED 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April 19, 2004 * * Modifications: @@ -482,7 +482,7 @@ reset_hdf5(void) */ static H5T_conv_ret_t except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, void H5_ATTR_UNUSED *src_buf, - void *dst_buf, void *user_data) + void *dst_buf, void *user_data) { H5T_conv_ret_t ret = H5T_CONV_HANDLED; @@ -509,19 +509,19 @@ except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 return ret; } - + /*------------------------------------------------------------------------- - * Function: some_dummy_func + * Function: some_dummy_func * - * Purpose: A dummy function to help check for overflow. + * Purpose: A dummy function to help check for overflow. * - * Note: DO NOT DECLARE THIS FUNCTION STATIC OR THE COMPILER MIGHT - * PROMOTE ARGUMENT `x' TO DOUBLE AND DEFEAT THE OVERFLOW - * CHECKING. + * Note: DO NOT DECLARE THIS FUNCTION STATIC OR THE COMPILER MIGHT + * PROMOTE ARGUMENT `x' TO DOUBLE AND DEFEAT THE OVERFLOW + * CHECKING. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, July 21, 1998 * *------------------------------------------------------------------------- @@ -529,21 +529,21 @@ except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 void some_dummy_func(float x) { - char s[128]; + char s[128]; HDsnprintf(s, sizeof(s), "%g", (double)x); } - + /*------------------------------------------------------------------------- - * Function: generates_sigfpe + * Function: generates_sigfpe * - * Purpose: Determines if SIGFPE is generated from overflows. We must be - * able to fork() and waitpid() in order for this test to work - * properly. Sets skip_overflow_tests_g to non-zero if they - * would generate SIGBUS, zero otherwise. + * Purpose: Determines if SIGFPE is generated from overflows. We must be + * able to fork() and waitpid() in order for this test to work + * properly. Sets skip_overflow_tests_g to non-zero if they + * would generate SIGBUS, zero otherwise. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, July 21, 1998 * * Modifications: @@ -554,38 +554,38 @@ static void generates_sigfpe(void) { #if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) - pid_t pid; - int status; - size_t i, j; - double d; + pid_t pid; + int status; + size_t i, j; + double d; unsigned char *dp = (unsigned char*)&d; - float f; + float f; HDfflush(stdout); HDfflush(stderr); if ((pid=fork()) < 0) { - HDperror("fork"); - HDexit(EXIT_FAILURE); + HDperror("fork"); + HDexit(EXIT_FAILURE); } else if (0==pid) { - for (i=0; i<2000; i++) { - for(j = 0; j < sizeof(double); j++) + for (i=0; i<2000; i++) { + for(j = 0; j < sizeof(double); j++) dp[j] = (unsigned char)HDrand(); - f = (float)d; - some_dummy_func((float)f); - } - HDexit(EXIT_SUCCESS); + f = (float)d; + some_dummy_func((float)f); + } + HDexit(EXIT_SUCCESS); } while (pid!=waitpid(pid, &status, 0)) /*void*/; if (WIFEXITED(status) && 0==WEXITSTATUS(status)) { - HDputs("Floating-point overflow cases will be tested."); - skip_overflow_tests_g = FALSE; + HDputs("Floating-point overflow cases will be tested."); + skip_overflow_tests_g = FALSE; } else if (WIFSIGNALED(status) && SIGFPE==WTERMSIG(status)) { - HDputs("Floating-point overflow cases cannot be safely tested."); - skip_overflow_tests_g = TRUE; - /* delete the core dump file that SIGFPE may have created */ - HDunlink("core"); + HDputs("Floating-point overflow cases cannot be safely tested."); + skip_overflow_tests_g = TRUE; + /* delete the core dump file that SIGFPE may have created */ + HDunlink("core"); } #else HDputs("Cannot determine if floating-point overflows generate a SIGFPE;"); @@ -595,7 +595,7 @@ generates_sigfpe(void) #endif } - + /*------------------------------------------------------------------------- * Function: test_hard_query * @@ -621,7 +621,7 @@ test_hard_query(void) /* Verify the conversion from int to float is a hard conversion. */ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); - printf("Can't query conversion function\n"); + HDprintf("Can't query conversion function\n"); goto error; } @@ -630,7 +630,7 @@ test_hard_query(void) H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (H5T_conv_t)((void (*) (void))H5T__conv_int_float)); if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) { H5_FAILED(); - printf("Can't query conversion function\n"); + HDprintf("Can't query conversion function\n"); goto error; } @@ -639,7 +639,7 @@ test_hard_query(void) H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (H5T_conv_t)((void (*) (void))H5T__conv_int_float)); if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); - printf("Can't query conversion function\n"); + HDprintf("Can't query conversion function\n"); goto error; } @@ -660,16 +660,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: expt_handle + * Function: expt_handle * - * Purpose: Gets called from test_particular_fp_integer() for data type + * Purpose: Gets called from test_particular_fp_integer() for data type * conversion exceptions. * - * Return: H5T_CONV_HANDLED 1 + * Return: H5T_CONV_HANDLED 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Sept 7, 2005 * * Modifications: @@ -678,7 +678,7 @@ error: */ static H5T_conv_ret_t expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, void H5_ATTR_UNUSED *src_buf, - void *dst_buf, void *user_data) + void *dst_buf, void *user_data) { signed char fill_value1 = 7; int fill_value2 = 13; @@ -694,7 +694,7 @@ expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 return H5T_CONV_HANDLED; } - + /*------------------------------------------------------------------------- * Function: test_particular_fp_integer * @@ -714,12 +714,6 @@ expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 * Return: Success: 0 * * Failure: number of errors - * - * Programmer: Raymond Lu - * Sept 7, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_particular_fp_integer(void) @@ -735,7 +729,7 @@ static int test_particular_fp_integer(void) float src_f = (float)INT_MAX; int dst_i; int fill_value = 13; - int endian; /*endianess */ + int endian; /*endianess */ unsigned int fails_this_test = 0; size_t j; @@ -743,7 +737,7 @@ static int test_particular_fp_integer(void) if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - printf("Can't create data transfer property list\n"); + HDprintf("Can't create data transfer property list\n"); goto error; } @@ -754,25 +748,25 @@ static int test_particular_fp_integer(void) buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); saved_buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); - memcpy(buf1, &src_d, src_size1); - memcpy(saved_buf1, &src_d, src_size1); + HDmemcpy(buf1, &src_d, src_size1); + HDmemcpy(saved_buf1, &src_d, src_size1); /* Register exception handling function and signal the destination is "signed char". */ flag = 1; if(H5Pset_type_conv_cb(dxpl_id, expt_handle, &flag) < 0) { H5_FAILED(); - printf("Can't register conversion callback\n"); + HDprintf("Can't register conversion callback\n"); goto error; } /* Do conversion */ if(H5Tconvert(H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR, (size_t)1, buf1, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } - memcpy(&dst_c, buf1, dst_size1); + HDmemcpy(&dst_c, buf1, dst_size1); /* Print errors */ if(dst_c != SCHAR_MAX) { @@ -782,20 +776,20 @@ static int test_particular_fp_integer(void) if(0 == fails_this_test++) H5_FAILED(); - printf(" test double to signed char:\n"); - printf(" src = "); + HDprintf(" test double to signed char:\n"); + HDprintf(" src = "); for (j=0; j<src_size1; j++) - printf(" %02x", saved_buf1[ENDIAN(src_size1, j, endian)]); + HDprintf(" %02x", saved_buf1[ENDIAN(src_size1, j, endian)]); HDmemcpy(&x, saved_buf1, src_size1); - printf(" %29.20e\n", x); + HDprintf(" %29.20e\n", x); - printf(" dst = "); + HDprintf(" dst = "); for (j=0; j<dst_size1; j++) - printf(" %02x", buf1[ENDIAN(dst_size1, j, endian)]); + HDprintf(" %02x", buf1[ENDIAN(dst_size1, j, endian)]); HDmemcpy(&y, buf1, dst_size1); - printf(" %29d\n", y); + HDprintf(" %29d\n", y); } /* Test conversion from float (the value is INT_MAX) to int. */ @@ -812,11 +806,11 @@ static int test_particular_fp_integer(void) /* Do conversion */ if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)1, buf2, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } - memcpy(&dst_i, buf2, dst_size2); + HDmemcpy(&dst_i, buf2, dst_size2); /* Print errors */ if(dst_i != fill_value) { @@ -826,20 +820,20 @@ static int test_particular_fp_integer(void) if(0 == fails_this_test++) H5_FAILED(); - printf(" test float to int:\n"); - printf(" src = "); + HDprintf(" test float to int:\n"); + HDprintf(" src = "); for (j=0; j<src_size2; j++) - printf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]); + HDprintf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]); HDmemcpy(&x, saved_buf2, src_size2); - printf(" %29.20e\n", (double)x); + HDprintf(" %29.20e\n", (double)x); - printf(" dst = "); + HDprintf(" dst = "); for (j=0; j<dst_size2; j++) - printf(" %02x", buf2[ENDIAN(dst_size2, j, endian)]); + HDprintf(" %02x", buf2[ENDIAN(dst_size2, j, endian)]); HDmemcpy(&y, buf2, dst_size2); - printf(" %29d\n", y); + HDprintf(" %29d\n", y); } if(fails_this_test) @@ -847,7 +841,7 @@ static int test_particular_fp_integer(void) if(H5Pclose(dxpl_id) < 0) { H5_FAILED(); - printf("Can't close property list\n"); + HDprintf("Can't close property list\n"); goto error; } @@ -885,7 +879,7 @@ error: return MAX((int)fails_this_test, 1); } - + /*------------------------------------------------------------------------- * Function: test_derived_flt * @@ -912,11 +906,11 @@ test_derived_flt(void) size_t src_size, dst_size; unsigned char *buf=NULL, *saved_buf=NULL; int *aligned=NULL; - int endian; /*endianess */ + int endian; /*endianess */ size_t nelmts = NTESTELEM; unsigned int fails_this_test = 0; - const size_t max_fails=40; /*max number of failures*/ - char str[256]; /*message string */ + const size_t max_fails=40; /*max number of failures*/ + char str[256]; /*message string */ unsigned int i, j; TESTING("user-define and query functions of floating-point types"); @@ -925,25 +919,25 @@ test_derived_flt(void) h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf("Can't create file\n"); + HDprintf("Can't create file\n"); goto error; } if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - printf("Can't create data transfer property list\n"); + HDprintf("Can't create data transfer property list\n"); goto error; } if((tid1 = H5Tcopy(H5T_IEEE_F64LE)) < 0) { H5_FAILED(); - printf("Can't copy data type\n"); + HDprintf("Can't copy data type\n"); goto error; } if((tid2 = H5Tcopy(H5T_IEEE_F32LE)) < 0) { H5_FAILED(); - printf("Can't copy data type\n"); + HDprintf("Can't copy data type\n"); goto error; } @@ -967,44 +961,44 @@ test_derived_flt(void) *-----------------------------------------------------------------------*/ if(H5Tset_fields(tid1, (size_t)44, (size_t)34, (size_t)10, (size_t)3, (size_t)31) < 0) { H5_FAILED(); - printf("Can't set fields\n"); + HDprintf("Can't set fields\n"); goto error; } if(H5Tset_offset(tid1, (size_t)3) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_precision(tid1, (size_t)42) < 0) { H5_FAILED(); - printf("Can't set precision 1\n"); + HDprintf("Can't set precision 1\n"); goto error; } if(H5Tset_size(tid1, (size_t)7) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_ebias(tid1, (size_t)511) < 0) { H5_FAILED(); - printf("Can't set exponent bias\n"); + HDprintf("Can't set exponent bias\n"); goto error; } if(H5Tset_pad(tid1, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); - printf("Can't set padding\n"); + HDprintf("Can't set padding\n"); goto error; } if(H5Tcommit2(file, "new float type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't set inpad\n"); + HDprintf("Can't set inpad\n"); goto error; } if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1012,33 +1006,33 @@ test_derived_flt(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_fields(tid1, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); - printf("Can't get fields\n"); + HDprintf("Can't get fields\n"); goto error; } if(spos != 44 || epos != 34 || esize != 10 || mpos != 3 || msize != 31) { H5_FAILED(); - printf("Wrong field values\n"); + HDprintf("Wrong field values\n"); goto error; } if(H5Tget_precision(tid1) != 42) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid1)!=3) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if((size = H5Tget_size(tid1))!=7) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_ebias(tid1)!=511) { H5_FAILED(); - printf("Can't get exponent bias or wrong bias\n"); + HDprintf("Can't get exponent bias or wrong bias\n"); goto error; } @@ -1061,13 +1055,13 @@ test_derived_flt(void) * The mantissa is big enough to retain the integer's precision. */ if(H5Tconvert(H5T_NATIVE_INT, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } /* Convert data from the derived floating-point type back to native integer. */ if(H5Tconvert(tid1, H5T_NATIVE_INT, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } @@ -1081,26 +1075,26 @@ test_derived_flt(void) /* Print errors */ if (0==fails_this_test++) { - HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); - printf("%-70s", str); - HDfflush(stdout); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); + HDprintf("%-70s", str); + HDfflush(stdout); H5_FAILED(); } - printf(" test %u elmt %u: \n", 1, (unsigned)i); + HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); - printf(" src = "); + HDprintf(" src = "); for (j=0; j<src_size; j++) - printf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]); + HDprintf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]); HDmemcpy(aligned, saved_buf+i*sizeof(int), sizeof(int)); - printf(" %29d\n", *aligned); + HDprintf(" %29d\n", *aligned); - printf(" dst = "); + HDprintf(" dst = "); for (j=0; j<src_size; j++) - printf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]); + HDprintf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]); HDmemcpy(aligned, buf+i*sizeof(int), sizeof(int)); - printf(" %29d\n", *aligned); + HDprintf(" %29d\n", *aligned); if (fails_this_test>=max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1127,43 +1121,43 @@ test_derived_flt(void) *--------------------------------------------------------------------------*/ if(H5Tset_fields(tid2, (size_t)23, (size_t)16, (size_t)7, (size_t)0, (size_t)16) < 0) { H5_FAILED(); - printf("Can't set fields\n"); + HDprintf("Can't set fields\n"); goto error; } if(H5Tset_offset(tid2, (size_t)0) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_precision(tid2, (size_t)24) < 0) { H5_FAILED(); - printf("Can't set precision 2\n"); + HDprintf("Can't set precision 2\n"); goto error; } if(H5Tset_size(tid2, (size_t)3) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_ebias(tid2, (size_t)63) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_pad(tid2, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); - printf("Can't set padding\n"); + HDprintf("Can't set padding\n"); goto error; } if(H5Tcommit2(file, "new float type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't set inpad\n"); + HDprintf("Can't set inpad\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1171,33 +1165,33 @@ test_derived_flt(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_fields(tid2, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); - printf("Can't get fields\n"); + HDprintf("Can't get fields\n"); goto error; } if(spos != 23 || epos != 16 || esize != 7 || mpos != 0 || msize != 16) { H5_FAILED(); - printf("Wrong field values\n"); + HDprintf("Wrong field values\n"); goto error; } if(H5Tget_precision(tid2) != 24) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid2)!=0) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if((size = H5Tget_size(tid2))!=3) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_ebias(tid2)!=63) { H5_FAILED(); - printf("Can't get exponent bias or wrong bias\n"); + HDprintf("Can't get exponent bias or wrong bias\n"); goto error; } @@ -1221,13 +1215,13 @@ test_derived_flt(void) * the precision and exponent power. */ if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } /* Convert data from the 1st back to the 2nd derived floating-point type. */ if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } @@ -1249,22 +1243,22 @@ test_derived_flt(void) /* Print errors */ if (0==fails_this_test++) { - HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); - printf("%-70s", str); - HDfflush(stdout); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); + HDprintf("%-70s", str); + HDfflush(stdout); H5_FAILED(); } - printf(" test %u elmt %u: \n", 1, (unsigned)i); + HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); - printf(" src = "); + HDprintf(" src = "); for (j=0; j<src_size; j++) - printf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]); - printf("\n"); + HDprintf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]); + HDprintf("\n"); - printf(" dst = "); + HDprintf(" dst = "); for (j=0; j<src_size; j++) - printf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]); - printf("\n"); + HDprintf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]); + HDprintf("\n"); if (fails_this_test>=max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1277,25 +1271,25 @@ test_derived_flt(void) if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Pclose(dxpl_id) < 0) { H5_FAILED(); - printf("Can't close property list\n"); + HDprintf("Can't close property list\n"); goto error; } if(H5Fclose(file) < 0) { H5_FAILED(); - printf("Can't close file\n"); + HDprintf("Can't close file\n"); goto error; } /* end if */ @@ -1304,7 +1298,7 @@ test_derived_flt(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ return 0; @@ -1328,7 +1322,7 @@ test_derived_flt(void) return MAX((int)fails_this_test, 1); } - + /*------------------------------------------------------------------------- * Function: test_derived_integer * @@ -1353,11 +1347,11 @@ test_derived_integer(void) char filename[1024]; size_t src_size, dst_size; unsigned char *buf=NULL, *saved_buf=NULL; - int endian; /*endianess */ + int endian; /*endianess */ size_t nelmts = NTESTELEM; unsigned int fails_this_test = 0; - const size_t max_fails=40; /*max number of failures*/ - char str[256]; /*message string */ + const size_t max_fails=40; /*max number of failures*/ + char str[256]; /*message string */ unsigned int i, j; TESTING("user-define and query functions of integer types"); @@ -1366,25 +1360,25 @@ test_derived_integer(void) h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf("Can't create file\n"); + HDprintf("Can't create file\n"); goto error; } if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - printf("Can't create data transfer property list\n"); + HDprintf("Can't create data transfer property list\n"); goto error; } if((tid1 = H5Tcopy(H5T_STD_I32LE)) < 0) { H5_FAILED(); - printf("Can't copy data type\n"); + HDprintf("Can't copy data type\n"); goto error; } if((tid2 = H5Tcopy(H5T_STD_U64LE)) < 0) { H5_FAILED(); - printf("Can't copy data type\n"); + HDprintf("Can't copy data type\n"); goto error; } @@ -1402,37 +1396,37 @@ test_derived_integer(void) *--------------------------------------------------------------------------*/ if(H5Tset_offset(tid1, (size_t)0) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_size(tid1, (size_t)3) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_precision(tid1, (size_t)24) < 0) { H5_FAILED(); - printf("Can't set precision\n"); + HDprintf("Can't set precision\n"); goto error; } if(H5Tset_order(tid1, H5T_ORDER_BE) < 0) { H5_FAILED(); - printf("Can't set order\n"); + HDprintf("Can't set order\n"); goto error; } if(H5Tcommit2(file, "new integer type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit data type\n"); + HDprintf("Can't commit data type\n"); goto error; } if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1440,22 +1434,22 @@ test_derived_integer(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_precision(tid1) != 24) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid1) != 0) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if(H5Tget_size(tid1) != 3) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_order(tid1)!=H5T_ORDER_BE) { H5_FAILED(); - printf("Can't get order or wrong order\n"); + HDprintf("Can't get order or wrong order\n"); goto error; } @@ -1469,31 +1463,31 @@ test_derived_integer(void) *--------------------------------------------------------------------------*/ if(H5Tset_precision(tid2, (size_t)48) < 0) { H5_FAILED(); - printf("Can't set precision\n"); + HDprintf("Can't set precision\n"); goto error; } if(H5Tset_offset(tid2, (size_t)10) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_sign(tid2, H5T_SGN_2) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tcommit2(file, "new integer type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit data type\n"); + HDprintf("Can't commit data type\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1501,22 +1495,22 @@ test_derived_integer(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_precision(tid2) != 48) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid2) != 10) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if(H5Tget_size(tid2) != 8) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_sign(tid2)!=H5T_SGN_2) { H5_FAILED(); - printf("Can't get sign or wrong sign\n"); + HDprintf("Can't get sign or wrong sign\n"); goto error; } @@ -1540,13 +1534,13 @@ test_derived_integer(void) * the 1st type's precision. */ if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } /* Convert data from the 2nd back to the 1st derived integer type. */ if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } @@ -1560,22 +1554,22 @@ test_derived_integer(void) /* Print errors */ if (0==fails_this_test++) { - HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); - printf("%-70s", str); - HDfflush(stdout); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); + HDprintf("%-70s", str); + HDfflush(stdout); H5_FAILED(); } - printf(" test %u elmt %u: \n", 1, (unsigned)i); + HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); - printf(" src = "); + HDprintf(" src = "); for (j=0; j<src_size; j++) - printf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]); - printf("\n"); + HDprintf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]); + HDprintf("\n"); - printf(" dst = "); + HDprintf(" dst = "); for (j=0; j<src_size; j++) - printf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]); - printf("\n"); + HDprintf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]); + HDprintf("\n"); if (fails_this_test>=max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1585,25 +1579,25 @@ test_derived_integer(void) if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Pclose(dxpl_id) < 0) { H5_FAILED(); - printf("Can't close property list\n"); + HDprintf("Can't close property list\n"); goto error; } if(H5Fclose(file) < 0) { H5_FAILED(); - printf("Can't close file\n"); + HDprintf("Can't close file\n"); goto error; } /* end if */ @@ -1615,7 +1609,7 @@ test_derived_integer(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ return 0; @@ -1638,24 +1632,24 @@ test_derived_integer(void) return MAX((int)fails_this_test, 1); } - + /*------------------------------------------------------------------------- - * Function: test_conv_int_1 + * Function: test_conv_int_1 * - * Purpose: Test conversion of integer values from SRC to DST. - * These types should be any combination of: + * Purpose: Test conversion of integer values from SRC to DST. + * These types should be any combination of: * - * H5T_NATIVE_SCHAR H5T_NATIVE_UCHAR - * H5T_NATIVE_SHORT H5T_NATIVE_USHORT - * H5T_NATIVE_INT H5T_NATIVE_UINT - * H5T_NATIVE_LONG H5T_NATIVE_ULONG - * H5T_NATIVE_LLONG H5T_NATIVE_ULLONG + * H5T_NATIVE_SCHAR H5T_NATIVE_UCHAR + * H5T_NATIVE_SHORT H5T_NATIVE_USHORT + * H5T_NATIVE_INT H5T_NATIVE_UINT + * H5T_NATIVE_LONG H5T_NATIVE_ULONG + * H5T_NATIVE_LLONG H5T_NATIVE_ULLONG * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 * * Modifications: @@ -1665,121 +1659,121 @@ test_derived_integer(void) static int test_conv_int_1(const char *name, hid_t src, hid_t dst) { - size_t nelmts=0; /*num values per test */ - const size_t max_fails=8; /*max number of failures*/ - size_t fails_all_tests=0; /*number of failures */ - size_t fails_this_test; /*fails for this test */ - char str[256]; /*hello string */ - dtype_t src_type, dst_type; /*data types */ - const char *src_type_name=NULL; /*source type name */ - const char *dst_type_name=NULL; /*destination type name */ - int endian; /*machine endianess */ - size_t src_size, dst_size; /*type sizes */ - unsigned char *buf=NULL; /*buffer for conversion */ - unsigned char *saved=NULL; /*original values */ - size_t j, k; /*counters */ - unsigned char *hw=NULL; /*hardware conv result */ - unsigned char src_bits[32]; /*src value in LE order */ - unsigned char dst_bits[32]; /*dest value in LE order*/ - size_t src_nbits; /*source length in bits */ - size_t dst_nbits; /*dst length in bits */ + size_t nelmts=0; /*num values per test */ + const size_t max_fails=8; /*max number of failures*/ + size_t fails_all_tests=0; /*number of failures */ + size_t fails_this_test; /*fails for this test */ + char str[256]; /*hello string */ + dtype_t src_type, dst_type; /*data types */ + const char *src_type_name=NULL; /*source type name */ + const char *dst_type_name=NULL; /*destination type name */ + int endian; /*machine endianess */ + size_t src_size, dst_size; /*type sizes */ + unsigned char *buf=NULL; /*buffer for conversion */ + unsigned char *saved=NULL; /*original values */ + size_t j, k; /*counters */ + unsigned char *hw=NULL; /*hardware conv result */ + unsigned char src_bits[32]; /*src value in LE order */ + unsigned char dst_bits[32]; /*dest value in LE order*/ + size_t src_nbits; /*source length in bits */ + size_t dst_nbits; /*dst length in bits */ H5T_sign_t src_sign; /*source sign type */ H5T_sign_t dst_sign; /*dst sign type */ - void *aligned=NULL; /*aligned temp buffer */ - signed char hw_char; - unsigned char hw_uchar; - short hw_short; - unsigned short hw_ushort; - int hw_int; - unsigned hw_uint; - long hw_long; - unsigned long hw_ulong; - long long hw_llong; - unsigned long long hw_ullong; + void *aligned=NULL; /*aligned temp buffer */ + signed char hw_char; + unsigned char hw_uchar; + short hw_short; + unsigned short hw_ushort; + int hw_int; + unsigned hw_uint; + long hw_long; + unsigned long hw_ulong; + long long hw_llong; + unsigned long long hw_ullong; /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_SCHAR)) { - src_type_name = "signed char"; - src_type = INT_SCHAR; + src_type_name = "signed char"; + src_type = INT_SCHAR; } else if (H5Tequal(src, H5T_NATIVE_UCHAR)) { - src_type_name = "unsigned char"; - src_type = INT_UCHAR; + src_type_name = "unsigned char"; + src_type = INT_UCHAR; } else if (H5Tequal(src, H5T_NATIVE_SHORT)) { - src_type_name = "short"; - src_type = INT_SHORT; + src_type_name = "short"; + src_type = INT_SHORT; } else if (H5Tequal(src, H5T_NATIVE_USHORT)) { - src_type_name = "unsigned short"; - src_type = INT_USHORT; + src_type_name = "unsigned short"; + src_type = INT_USHORT; } else if (H5Tequal(src, H5T_NATIVE_INT)) { - src_type_name = "int"; - src_type = INT_INT; + src_type_name = "int"; + src_type = INT_INT; } else if (H5Tequal(src, H5T_NATIVE_UINT)) { - src_type_name = "unsigned int"; - src_type = INT_UINT; + src_type_name = "unsigned int"; + src_type = INT_UINT; } else if (H5Tequal(src, H5T_NATIVE_LONG)) { - src_type_name = "long"; - src_type = INT_LONG; + src_type_name = "long"; + src_type = INT_LONG; } else if (H5Tequal(src, H5T_NATIVE_ULONG)) { - src_type_name = "unsigned long"; - src_type = INT_ULONG; + src_type_name = "unsigned long"; + src_type = INT_ULONG; } else if (H5Tequal(src, H5T_NATIVE_LLONG)) { - src_type_name = "long long"; - src_type = INT_LLONG; + src_type_name = "long long"; + src_type = INT_LLONG; } else if (H5Tequal(src, H5T_NATIVE_ULLONG)) { - src_type_name = "unsigned long long"; - src_type = INT_ULLONG; + src_type_name = "unsigned long long"; + src_type = INT_ULLONG; } else { - src_type_name = "UNKNOWN"; - src_type = OTHER; + src_type_name = "UNKNOWN"; + src_type = OTHER; } if (H5Tequal(dst, H5T_NATIVE_SCHAR)) { - dst_type_name = "signed char"; - dst_type = INT_SCHAR; + dst_type_name = "signed char"; + dst_type = INT_SCHAR; } else if (H5Tequal(dst, H5T_NATIVE_UCHAR)) { - dst_type_name = "unsigned char"; - dst_type = INT_UCHAR; + dst_type_name = "unsigned char"; + dst_type = INT_UCHAR; } else if (H5Tequal(dst, H5T_NATIVE_SHORT)) { - dst_type_name = "short"; - dst_type = INT_SHORT; + dst_type_name = "short"; + dst_type = INT_SHORT; } else if (H5Tequal(dst, H5T_NATIVE_USHORT)) { - dst_type_name = "unsigned short"; - dst_type = INT_USHORT; + dst_type_name = "unsigned short"; + dst_type = INT_USHORT; } else if (H5Tequal(dst, H5T_NATIVE_INT)) { - dst_type_name = "int"; - dst_type = INT_INT; + dst_type_name = "int"; + dst_type = INT_INT; } else if (H5Tequal(dst, H5T_NATIVE_UINT)) { - dst_type_name = "unsigned int"; - dst_type = INT_UINT; + dst_type_name = "unsigned int"; + dst_type = INT_UINT; } else if (H5Tequal(dst, H5T_NATIVE_LONG)) { - dst_type_name = "long"; - dst_type = INT_LONG; + dst_type_name = "long"; + dst_type = INT_LONG; } else if (H5Tequal(dst, H5T_NATIVE_ULONG)) { - dst_type_name = "unsigned long"; - dst_type = INT_ULONG; + dst_type_name = "unsigned long"; + dst_type = INT_ULONG; } else if (H5Tequal(dst, H5T_NATIVE_LLONG)) { - dst_type_name = "long long"; - dst_type = INT_LLONG; + dst_type_name = "long long"; + dst_type = INT_LLONG; } else if (H5Tequal(dst, H5T_NATIVE_ULLONG)) { - dst_type_name = "unsigned long long"; - dst_type = INT_ULLONG; + dst_type_name = "unsigned long long"; + dst_type = INT_ULLONG; } else { - dst_type_name = "UNKNOWN"; - dst_type = OTHER; + dst_type_name = "UNKNOWN"; + dst_type = OTHER; } /* Sanity checks */ if (OTHER==src_type || OTHER==dst_type) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" Unknown data type."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" Unknown data type."); + goto error; } else { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test=0; } @@ -2462,44 +2456,44 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) /* Print errors */ if (0==fails_this_test++) H5_FAILED(); - printf(" elmt %u\n", (unsigned)j); + HDprintf(" elmt %u\n", (unsigned)j); - printf(" src = "); + HDprintf(" src = "); for (k=0; k<src_size; k++) - printf(" %02x", saved[j*src_size+ENDIAN(src_size, k, endian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); + HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size, k, endian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); switch (src_type) { case INT_SCHAR: HDmemcpy(aligned, saved+j*sizeof(signed char), sizeof(signed char)); - printf(" %29d\n", (int)*((signed char*)aligned)); + HDprintf(" %29d\n", (int)*((signed char*)aligned)); break; case INT_UCHAR: HDmemcpy(aligned, saved+j*sizeof(unsigned char), sizeof(unsigned char)); - printf(" %29u\n", (unsigned)*((unsigned char*)aligned)); + HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned)); break; case INT_SHORT: HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); - printf(" %29hd\n", *((short*)aligned)); + HDprintf(" %29hd\n", *((short*)aligned)); break; case INT_USHORT: HDmemcpy(aligned, saved+j*sizeof(unsigned short), sizeof(unsigned short)); - printf(" %29hu\n", *((unsigned short*)aligned)); + HDprintf(" %29hu\n", *((unsigned short*)aligned)); break; case INT_INT: HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); - printf(" %29d\n", *((int*)aligned)); + HDprintf(" %29d\n", *((int*)aligned)); break; case INT_UINT: HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); - printf(" %29u\n", *((unsigned*)aligned)); + HDprintf(" %29u\n", *((unsigned*)aligned)); break; case INT_LONG: HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); - printf(" %29ld\n", *((long*)aligned)); + HDprintf(" %29ld\n", *((long*)aligned)); break; case INT_ULONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long), sizeof(unsigned long)); - printf(" %29lu\n", *((unsigned long*)aligned)); + HDprintf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); @@ -2518,42 +2512,42 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) break; } - printf(" dst = "); + HDprintf(" dst = "); for (k=0; k<dst_size; k++) - printf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, endian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); + HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, endian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: HDmemcpy(aligned, buf+j*sizeof(signed char), sizeof(signed char)); - printf(" %29d\n", (int)*((signed char*)aligned)); + HDprintf(" %29d\n", (int)*((signed char*)aligned)); break; case INT_UCHAR: HDmemcpy(aligned, buf+j*sizeof(unsigned char), sizeof(unsigned char)); - printf(" %29u\n", (unsigned)*((unsigned char*)aligned)); + HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned)); break; case INT_SHORT: HDmemcpy(aligned, buf+j*sizeof(short), sizeof(short)); - printf(" %29hd\n", *((short*)aligned)); + HDprintf(" %29hd\n", *((short*)aligned)); break; case INT_USHORT: HDmemcpy(aligned, buf+j*sizeof(unsigned short), sizeof(unsigned short)); - printf(" %29hu\n", *((unsigned short*)aligned)); + HDprintf(" %29hu\n", *((unsigned short*)aligned)); break; case INT_INT: HDmemcpy(aligned, buf+j*sizeof(int), sizeof(int)); - printf(" %29d\n", *((int*)aligned)); + HDprintf(" %29d\n", *((int*)aligned)); break; case INT_UINT: HDmemcpy(aligned, buf+j*sizeof(unsigned), sizeof(unsigned)); - printf(" %29u\n", *((unsigned*)aligned)); + HDprintf(" %29u\n", *((unsigned*)aligned)); break; case INT_LONG: HDmemcpy(aligned, buf+j*sizeof(long), sizeof(long)); - printf(" %29ld\n", *((long*)aligned)); + HDprintf(" %29ld\n", *((long*)aligned)); break; case INT_ULONG: HDmemcpy(aligned, buf+j*sizeof(unsigned long), sizeof(unsigned long)); - printf(" %29lu\n", *((unsigned long*)aligned)); + HDprintf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(long long)); @@ -2572,34 +2566,34 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) break; } - printf(" ans = "); + HDprintf(" ans = "); for (k=0; k<dst_size; k++) - printf(" %02x", hw[ENDIAN(dst_size, k, endian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); + HDprintf(" %02x", hw[ENDIAN(dst_size, k, endian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: - printf(" %29d\n", (int)*((signed char*)((void *)hw))); + HDprintf(" %29d\n", (int)*((signed char*)((void *)hw))); break; case INT_UCHAR: - printf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw))); + HDprintf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw))); break; case INT_SHORT: - printf(" %29hd\n", *((short*)((void *)hw))); + HDprintf(" %29hd\n", *((short*)((void *)hw))); break; case INT_USHORT: - printf(" %29hu\n", *((unsigned short*)((void *)hw))); + HDprintf(" %29hu\n", *((unsigned short*)((void *)hw))); break; case INT_INT: - printf(" %29d\n", *((int*)((void *)hw))); + HDprintf(" %29d\n", *((int*)((void *)hw))); break; case INT_UINT: - printf(" %29u\n", *((unsigned*)((void *)hw))); + HDprintf(" %29u\n", *((unsigned*)((void *)hw))); break; case INT_LONG: - printf(" %29ld\n", *((long*)((void *)hw))); + HDprintf(" %29ld\n", *((long*)((void *)hw))); break; case INT_ULONG: - printf(" %29lu\n", *((unsigned long*)((void *)hw))); + HDprintf(" %29lu\n", *((unsigned long*)((void *)hw))); break; case INT_LLONG: HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)((void *)hw))); @@ -2633,7 +2627,7 @@ done: /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ return (int)fails_all_tests; @@ -2646,23 +2640,23 @@ error: /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ return MAX((int)fails_all_tests, 1); } - + /*------------------------------------------------------------------------- - * Function: test_conv_int_2 + * Function: test_conv_int_2 * - * Purpose: Tests overlap calculates in H5T__conv_i_i(), which should be - * the same as for H5T__conv_f_f() and H5T__conv_s_s(). + * Purpose: Tests overlap calculates in H5T__conv_i_i(), which should be + * the same as for H5T__conv_f_f() and H5T__conv_s_s(). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, April 30, 1999 * * Modifications: @@ -2672,50 +2666,50 @@ error: static int test_conv_int_2(void) { - int i, j; - hid_t src_type, dst_type; - char *buf; + int i, j; + hid_t src_type, dst_type; + char *buf; - printf("%-70s", "Testing overlap calculations"); + HDprintf("%-70s", "Testing overlap calculations"); HDfflush(stdout); buf = (char *)HDcalloc(TMP_BUF_DIM1, TMP_BUF_DIM2); HDassert(buf); for(i = 1; i <= TMP_BUF_DIM1; i++) { - for(j = 1; j <= TMP_BUF_DIM1; j++) { - - /* Source type */ - src_type = H5Tcopy(H5T_NATIVE_CHAR); - H5Tset_size(src_type, (size_t)i); - - /* Destination type */ - dst_type = H5Tcopy(H5T_NATIVE_CHAR); - H5Tset_size(dst_type, (size_t)j); - - /* - * Conversion. If overlap calculations aren't right then an - * assertion will fail in H5T__conv_i_i() - */ - H5Tconvert(src_type, dst_type, (size_t)TMP_BUF_DIM2, buf, NULL, H5P_DEFAULT); - H5Tclose(src_type); - H5Tclose(dst_type); - } + for(j = 1; j <= TMP_BUF_DIM1; j++) { + + /* Source type */ + src_type = H5Tcopy(H5T_NATIVE_CHAR); + H5Tset_size(src_type, (size_t)i); + + /* Destination type */ + dst_type = H5Tcopy(H5T_NATIVE_CHAR); + H5Tset_size(dst_type, (size_t)j); + + /* + * Conversion. If overlap calculations aren't right then an + * assertion will fail in H5T__conv_i_i() + */ + H5Tconvert(src_type, dst_type, (size_t)TMP_BUF_DIM2, buf, NULL, H5P_DEFAULT); + H5Tclose(src_type); + H5Tclose(dst_type); + } } PASSED(); HDfree(buf); return 0; } - + /*------------------------------------------------------------------------- - * Function: my_isnan + * Function: my_isnan * - * Purpose: Determines whether VAL points to NaN. + * Purpose: Determines whether VAL points to NaN. * - * Return: TRUE or FALSE + * Return: TRUE or FALSE * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 6, 1998 * * Modifications: @@ -2729,21 +2723,21 @@ my_isnan(dtype_t type, void *val) char s[256]; if (FLT_FLOAT==type) { - float x; - HDmemcpy(&x, val, sizeof(float)); - retval = (x!=x); + float x; + HDmemcpy(&x, val, sizeof(float)); + retval = (x!=x); } else if (FLT_DOUBLE==type) { - double x; - HDmemcpy(&x, val, sizeof(double)); - retval = (x!=x); + double x; + HDmemcpy(&x, val, sizeof(double)); + retval = (x!=x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x; - HDmemcpy(&x, val, sizeof(long double)); - retval = (x!=x); + long double x; + HDmemcpy(&x, val, sizeof(long double)); + retval = (x!=x); #endif } else { - return 0; + return 0; } /* @@ -2751,42 +2745,42 @@ my_isnan(dtype_t type, void *val) * the result contains a NaN string. */ if (!retval) { - if (FLT_FLOAT==type) { - float x; + if (FLT_FLOAT==type) { + float x; - HDmemcpy(&x, val, sizeof(float)); - HDsnprintf(s, sizeof(s), "%g", (double)x); - } else if (FLT_DOUBLE==type) { - double x; + HDmemcpy(&x, val, sizeof(float)); + HDsnprintf(s, sizeof(s), "%g", (double)x); + } else if (FLT_DOUBLE==type) { + double x; - HDmemcpy(&x, val, sizeof(double)); - HDsnprintf(s, sizeof(s), "%g", x); + HDmemcpy(&x, val, sizeof(double)); + HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - } else if (FLT_LDOUBLE==type) { - long double x; + } else if (FLT_LDOUBLE==type) { + long double x; - HDmemcpy(&x, val, sizeof(long double)); - HDsnprintf(s, sizeof(s), "%Lg", x); + HDmemcpy(&x, val, sizeof(long double)); + HDsnprintf(s, sizeof(s), "%Lg", x); #endif - } else { - return 0; - } - if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan")) - retval = 1; + } else { + return 0; + } + if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan")) + retval = 1; } return retval; } - + /*------------------------------------------------------------------------- - * Function: my_isinf + * Function: my_isinf * - * Purpose: Determines whether VAL points to +/-infinity. + * Purpose: Determines whether VAL points to +/-infinity. * - * Return: TRUE or FALSE + * Return: TRUE or FALSE * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Monday, June 20, 2005 * * Modifications: @@ -2815,70 +2809,70 @@ my_isinf(int endian, unsigned char *val, size_t size, return retval; } - + /*------------------------------------------------------------------------- - * Function: test_conv_flt_1 + * Function: test_conv_flt_1 * - * Purpose: Test conversion of floating point values from SRC to - * DST. These types should be H5T_NATIVE_FLOAT, - * H5T_NATIVE_DOUBLE, or H5T_NATIVE_LDOUBLE. + * Purpose: Test conversion of floating point values from SRC to + * DST. These types should be H5T_NATIVE_FLOAT, + * H5T_NATIVE_DOUBLE, or H5T_NATIVE_LDOUBLE. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 23, 1998 * * Modifications: - * Albert Cheng, Apr 16, 2004 - * Check for underflow condition. If the src number is - * smaller than the dst MIN float number, consider it okay - * if the converted sw and hw dst are both less than or - * equal to the dst MIN float number. + * Albert Cheng, Apr 16, 2004 + * Check for underflow condition. If the src number is + * smaller than the dst MIN float number, consider it okay + * if the converted sw and hw dst are both less than or + * equal to the dst MIN float number. * *------------------------------------------------------------------------- */ static int test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) { - dtype_t src_type, dst_type; /*data types */ - size_t nelmts=0; /*num values per test */ - const size_t max_fails=8; /*max number of failures*/ - size_t fails_all_tests=0; /*number of failures */ - size_t fails_this_test; /*fails for this test */ - const char *src_type_name = NULL; /*source type name */ - const char *dst_type_name = NULL; /*destination type name */ - size_t src_size, dst_size; /*type sizes */ - unsigned char *buf = NULL; /*buffer for conversion */ - unsigned char *saved = NULL; /*original values */ - char str[256]; /*hello string */ - void *aligned=NULL; /*aligned buffer */ - float hw_f; /*hardware-converted */ - double hw_d; /*hardware-converted */ + dtype_t src_type, dst_type; /*data types */ + size_t nelmts=0; /*num values per test */ + const size_t max_fails=8; /*max number of failures*/ + size_t fails_all_tests=0; /*number of failures */ + size_t fails_this_test; /*fails for this test */ + const char *src_type_name = NULL; /*source type name */ + const char *dst_type_name = NULL; /*destination type name */ + size_t src_size, dst_size; /*type sizes */ + unsigned char *buf = NULL; /*buffer for conversion */ + unsigned char *saved = NULL; /*original values */ + char str[256]; /*hello string */ + void *aligned=NULL; /*aligned buffer */ + float hw_f; /*hardware-converted */ + double hw_d; /*hardware-converted */ #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE - long double hw_ld; /*hardware-converted */ + long double hw_ld; /*hardware-converted */ #endif - unsigned char *hw=NULL; /*ptr to hardware-conv'd*/ - int underflow; /*underflow occurred */ - int overflow = 0; /*overflow occurred */ - int uflow=0; /*underflow debug counters*/ - size_t j, k; /*counters */ - int sendian; /* source type endianess */ - int dendian; /* Destination type endianess */ - size_t dst_ebias; /* Destination type's exponent bias */ - size_t src_epos; /* Source type's exponent position */ - size_t src_esize; /* Source type's exponent size */ - size_t dst_epos; /* Destination type's exponent position */ - size_t dst_esize; /* Destination type's exponent size */ - size_t dst_mpos; /* Destination type's mantissa position */ - size_t dst_msize; /* Destination type's mantissa size */ - size_t src_nbits; /* source length in bits */ - size_t dst_nbits; /* dst length in bits */ + unsigned char *hw=NULL; /*ptr to hardware-conv'd*/ + int underflow; /*underflow occurred */ + int overflow = 0; /*overflow occurred */ + int uflow=0; /*underflow debug counters*/ + size_t j, k; /*counters */ + int sendian; /* source type endianess */ + int dendian; /* Destination type endianess */ + size_t dst_ebias; /* Destination type's exponent bias */ + size_t src_epos; /* Source type's exponent position */ + size_t src_esize; /* Source type's exponent size */ + size_t dst_epos; /* Destination type's exponent position */ + size_t dst_esize; /* Destination type's exponent size */ + size_t dst_mpos; /* Destination type's mantissa position */ + size_t dst_msize; /* Destination type's mantissa size */ + size_t src_nbits; /* source length in bits */ + size_t dst_nbits; /* dst length in bits */ #ifdef HANDLE_SIGFPE - pid_t child_pid; /*process ID of child */ - int status; /*child exit status */ + pid_t child_pid; /*process ID of child */ + int status; /*child exit status */ /* * Some systems generage SIGFPE during floating point overflow and we @@ -2889,22 +2883,22 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDfflush(stdout); HDfflush(stderr); if ((child_pid=fork()) < 0) { - HDperror("fork"); - return 1; + HDperror("fork"); + return 1; } else if (child_pid>0) { - while (child_pid!=waitpid(child_pid, &status, 0)) /*void*/; - if (WIFEXITED(status) && 255==WEXITSTATUS(status)) { - return 0; /*child exit after catching SIGFPE*/ - } else if (WIFEXITED(status)) { - return WEXITSTATUS(status); - } else if (WIFSIGNALED(status)) { - HDsnprintf(str, sizeof(str), " Child caught signal %d.", WTERMSIG(status)); - HDputs(str); - return 1; /*child exit after catching non-SIGFPE signal */ - } else { - HDputs(" Child didn't exit normally."); - return 1; - } + while (child_pid!=waitpid(child_pid, &status, 0)) /*void*/; + if (WIFEXITED(status) && 255==WEXITSTATUS(status)) { + return 0; /*child exit after catching SIGFPE*/ + } else if (WIFEXITED(status)) { + return WEXITSTATUS(status); + } else if (WIFSIGNALED(status)) { + HDsnprintf(str, sizeof(str), " Child caught signal %d.", WTERMSIG(status)); + HDputs(str); + return 1; /*child exit after catching non-SIGFPE signal */ + } else { + HDputs(" Child didn't exit normally."); + return 1; + } } #endif @@ -2916,35 +2910,35 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_FLOAT)) { - src_type_name = "float"; - src_type = FLT_FLOAT; + src_type_name = "float"; + src_type = FLT_FLOAT; } else if (H5Tequal(src, H5T_NATIVE_DOUBLE)) { - src_type_name = "double"; - src_type = FLT_DOUBLE; + src_type_name = "double"; + src_type = FLT_DOUBLE; #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (H5Tequal(src, H5T_NATIVE_LDOUBLE)) { - src_type_name = "long double"; - src_type = FLT_LDOUBLE; + src_type_name = "long double"; + src_type = FLT_LDOUBLE; #endif } else { - src_type_name = "UNKNOWN"; - src_type = OTHER; + src_type_name = "UNKNOWN"; + src_type = OTHER; } if (H5Tequal(dst, H5T_NATIVE_FLOAT)) { - dst_type_name = "float"; - dst_type = FLT_FLOAT; + dst_type_name = "float"; + dst_type = FLT_FLOAT; } else if (H5Tequal(dst, H5T_NATIVE_DOUBLE)) { - dst_type_name = "double"; - dst_type = FLT_DOUBLE; + dst_type_name = "double"; + dst_type = FLT_DOUBLE; #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (H5Tequal(dst, H5T_NATIVE_LDOUBLE)) { - dst_type_name = "long double"; - dst_type = FLT_LDOUBLE; + dst_type_name = "long double"; + dst_type = FLT_LDOUBLE; #endif } else { - dst_type_name = "UNKNOWN"; - dst_type = OTHER; + dst_type_name = "UNKNOWN"; + dst_type = OTHER; } /* Sanity checks */ @@ -2952,22 +2946,22 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDputs("Sizeof(float)==sizeof(double) - some tests may not be sensible."); if (OTHER==src_type || OTHER==dst_type) { if(!strcmp(name, "noop")) - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); else if(run_test==TEST_SPECIAL) - HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", + name, src_type_name, dst_type_name); else if(run_test==TEST_NORMAL) - HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", + name, src_type_name, dst_type_name); else if(run_test==TEST_DENORM) - HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", + name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" Unknown data type."); - goto error; + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" Unknown data type."); + goto error; } else { if(!strcmp(name, "noop")) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", @@ -2982,7 +2976,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test = 0; } @@ -3199,18 +3193,18 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) * the SGI compiler assigns the dst's maximal value. */ { - double check_mant[2]; - int check_expo[2]; + double check_mant[2]; + int check_expo[2]; if (FLT_FLOAT==dst_type) { float x; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) - continue; /* all underflowed, no error */ + continue; /* all underflowed, no error */ if (overflow && my_isinf(dendian, buf+j*sizeof(float), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* all overflowed, no error */ + continue; /* all overflowed, no error */ check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { @@ -3218,10 +3212,10 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) - continue; /* all underflowed, no error */ + continue; /* all underflowed, no error */ if (overflow && my_isinf(dendian, buf+j*sizeof(double), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* all overflowed, no error */ + continue; /* all overflowed, no error */ check_mant[0] = HDfrexp(x, check_expo+0); check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) @@ -3264,20 +3258,20 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) H5_WARNING(); } } - printf(" elmt %u\n", (unsigned)j); + HDprintf(" elmt %u\n", (unsigned)j); - printf(" src ="); + HDprintf(" src ="); for (k=0; k<src_size; k++) - printf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); + HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); if (FLT_FLOAT==src_type) { float x; HDmemcpy(&x, &saved[j*src_size], sizeof(float)); - printf(" %29.20e\n", (double)x); + HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==src_type) { double x; HDmemcpy(&x, &saved[j*src_size], sizeof(double)); - printf(" %29.20e\n", x); + HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { long double x; @@ -3286,18 +3280,18 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) #endif } - printf(" dst ="); + HDprintf(" dst ="); for (k=0; k<dst_size; k++) - printf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); + HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); if (FLT_FLOAT==dst_type) { float x; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); - printf(" %29.20e\n", (double)x); + HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==dst_type) { double x; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); - printf(" %29.20e\n", x); + HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { long double x; @@ -3306,14 +3300,14 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) #endif } - printf(" ans ="); + HDprintf(" ans ="); for (k=0; k<dst_size; k++) - printf(" %02x", hw[ENDIAN(dst_size,k,dendian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); + HDprintf(" %02x", hw[ENDIAN(dst_size,k,dendian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); if (FLT_FLOAT==dst_type) - printf(" %29.20e\n", (double)hw_f); + HDprintf(" %29.20e\n", (double)hw_f); else if (FLT_DOUBLE==dst_type) - printf(" %29.20e\n", hw_d); + HDprintf(" %29.20e\n", hw_d); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE else HDfprintf(stdout," %29.20Le\n", hw_ld); @@ -3386,24 +3380,24 @@ error: #endif } - + /*------------------------------------------------------------------------- - * Function: test_conv_int_fp + * Function: test_conv_int_fp * - * Purpose: Test conversion between integer and float values + * Purpose: Test conversion between integer and float values * from SRC to DST. These types should be any combination of: * - * H5T_NATIVE_SCHAR H5T_NATIVE_FLOAT - * H5T_NATIVE_SHORT H5T_NATIVE_DOUBLE - * H5T_NATIVE_INT H5T_NATIVE_LDOUBLE - * H5T_NATIVE_LONG - * H5T_NATIVE_LLONG + * H5T_NATIVE_SCHAR H5T_NATIVE_FLOAT + * H5T_NATIVE_SHORT H5T_NATIVE_DOUBLE + * H5T_NATIVE_INT H5T_NATIVE_LDOUBLE + * H5T_NATIVE_LONG + * H5T_NATIVE_LLONG * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, November 6, 2003 * * Modifications: @@ -3418,143 +3412,143 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) H5T_conv_except_func_t op; /*returned callback function for conversion exception*/ void *user_data; /*returned pointer to user data passed in to the callback*/ hbool_t except_set = FALSE; /*whether user's exception handling is set*/ - size_t nelmts=0; /*num values per test */ - const size_t max_fails=40; /*max number of failures*/ - size_t fails_all_tests=0; /*number of failures */ - size_t fails_this_test; /*fails for this test */ - char str[256]; /*hello string */ - dtype_t src_type; /*data types */ - dtype_t dst_type; /*data types */ - const char *src_type_name=NULL; /*source type name */ - const char *dst_type_name=NULL; /*destination type name */ - int sendian; /*source endianess */ - int dendian; /*destination endianess */ - size_t src_size, dst_size; /*type sizes */ - unsigned char *buf=NULL; /*buffer for conversion */ - unsigned char *saved=NULL; /*original values */ - size_t j, k; /*counters */ - unsigned char *hw=NULL; /*hardware conv result */ - unsigned char src_bits[32]; /*src value in LE order */ - unsigned char dst_bits[32]; /*dest value in LE order*/ - size_t src_nbits; /*source length in bits */ - size_t dst_nbits; /*dst length in bits */ - void *aligned=NULL; /*aligned temp buffer */ - float hw_float=0; - double hw_double=0; - long double hw_ldouble=0; - signed char hw_schar=0; - unsigned char hw_uchar=0; - short hw_short=0; - unsigned short hw_ushort=0; - int hw_int=0; - unsigned hw_uint=0; - long hw_long=0; - unsigned long hw_ulong=0; - long long hw_llong=0; - unsigned long long hw_ullong=0; + size_t nelmts=0; /*num values per test */ + const size_t max_fails=40; /*max number of failures*/ + size_t fails_all_tests=0; /*number of failures */ + size_t fails_this_test; /*fails for this test */ + char str[256]; /*hello string */ + dtype_t src_type; /*data types */ + dtype_t dst_type; /*data types */ + const char *src_type_name=NULL; /*source type name */ + const char *dst_type_name=NULL; /*destination type name */ + int sendian; /*source endianess */ + int dendian; /*destination endianess */ + size_t src_size, dst_size; /*type sizes */ + unsigned char *buf=NULL; /*buffer for conversion */ + unsigned char *saved=NULL; /*original values */ + size_t j, k; /*counters */ + unsigned char *hw=NULL; /*hardware conv result */ + unsigned char src_bits[32]; /*src value in LE order */ + unsigned char dst_bits[32]; /*dest value in LE order*/ + size_t src_nbits; /*source length in bits */ + size_t dst_nbits; /*dst length in bits */ + void *aligned=NULL; /*aligned temp buffer */ + float hw_float=0; + double hw_double=0; + long double hw_ldouble=0; + signed char hw_schar=0; + unsigned char hw_uchar=0; + short hw_short=0; + unsigned short hw_ushort=0; + int hw_int=0; + unsigned hw_uint=0; + long hw_long=0; + unsigned long hw_ulong=0; + long long hw_llong=0; + unsigned long long hw_ullong=0; /* What is the name of the source type */ if (H5Tequal(src, H5T_NATIVE_SCHAR)) { - src_type_name = "signed char"; - src_type = INT_SCHAR; + src_type_name = "signed char"; + src_type = INT_SCHAR; } else if (H5Tequal(src, H5T_NATIVE_UCHAR)) { - src_type_name = "unsigned char"; - src_type = INT_UCHAR; + src_type_name = "unsigned char"; + src_type = INT_UCHAR; } else if (H5Tequal(src, H5T_NATIVE_SHORT)) { - src_type_name = "short"; - src_type = INT_SHORT; + src_type_name = "short"; + src_type = INT_SHORT; } else if (H5Tequal(src, H5T_NATIVE_USHORT)) { - src_type_name = "unsigned short"; - src_type = INT_USHORT; + src_type_name = "unsigned short"; + src_type = INT_USHORT; } else if (H5Tequal(src, H5T_NATIVE_INT)) { - src_type_name = "int"; - src_type = INT_INT; + src_type_name = "int"; + src_type = INT_INT; } else if (H5Tequal(src, H5T_NATIVE_UINT)) { - src_type_name = "unsigned int"; - src_type = INT_UINT; + src_type_name = "unsigned int"; + src_type = INT_UINT; } else if (H5Tequal(src, H5T_NATIVE_LONG)) { - src_type_name = "long"; - src_type = INT_LONG; + src_type_name = "long"; + src_type = INT_LONG; } else if (H5Tequal(src, H5T_NATIVE_ULONG)) { - src_type_name = "unsigned long"; - src_type = INT_ULONG; + src_type_name = "unsigned long"; + src_type = INT_ULONG; } else if (H5Tequal(src, H5T_NATIVE_LLONG)) { - src_type_name = "long long"; - src_type = INT_LLONG; + src_type_name = "long long"; + src_type = INT_LLONG; } else if (H5Tequal(src, H5T_NATIVE_ULLONG)) { - src_type_name = "unsigned long long"; - src_type = INT_ULLONG; + src_type_name = "unsigned long long"; + src_type = INT_ULLONG; } else if (H5Tequal(src, H5T_NATIVE_FLOAT)) { - src_type_name = "float"; - src_type = FLT_FLOAT; + src_type_name = "float"; + src_type = FLT_FLOAT; } else if (H5Tequal(src, H5T_NATIVE_DOUBLE)) { - src_type_name = "double"; - src_type = FLT_DOUBLE; + src_type_name = "double"; + src_type = FLT_DOUBLE; #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (H5Tequal(src, H5T_NATIVE_LDOUBLE)) { - src_type_name = "long double"; - src_type = FLT_LDOUBLE; + src_type_name = "long double"; + src_type = FLT_LDOUBLE; #endif } else { - src_type_name = "UNKNOWN"; - src_type = OTHER; + src_type_name = "UNKNOWN"; + src_type = OTHER; } /* What is the name of the destination type */ if (H5Tequal(dst, H5T_NATIVE_SCHAR)) { - dst_type_name = "signed char"; - dst_type = INT_SCHAR; + dst_type_name = "signed char"; + dst_type = INT_SCHAR; } else if (H5Tequal(dst, H5T_NATIVE_UCHAR)) { - dst_type_name = "unsigned char"; - dst_type = INT_UCHAR; + dst_type_name = "unsigned char"; + dst_type = INT_UCHAR; } else if (H5Tequal(dst, H5T_NATIVE_SHORT)) { - dst_type_name = "short"; - dst_type = INT_SHORT; + dst_type_name = "short"; + dst_type = INT_SHORT; } else if (H5Tequal(dst, H5T_NATIVE_USHORT)) { - dst_type_name = "unsigned short"; - dst_type = INT_USHORT; + dst_type_name = "unsigned short"; + dst_type = INT_USHORT; } else if (H5Tequal(dst, H5T_NATIVE_INT)) { - dst_type_name = "int"; - dst_type = INT_INT; + dst_type_name = "int"; + dst_type = INT_INT; } else if (H5Tequal(dst, H5T_NATIVE_UINT)) { - dst_type_name = "unsigned int"; - dst_type = INT_UINT; + dst_type_name = "unsigned int"; + dst_type = INT_UINT; } else if (H5Tequal(dst, H5T_NATIVE_LONG)) { - dst_type_name = "long"; - dst_type = INT_LONG; + dst_type_name = "long"; + dst_type = INT_LONG; } else if (H5Tequal(dst, H5T_NATIVE_ULONG)) { - dst_type_name = "unsigned long"; - dst_type = INT_ULONG; + dst_type_name = "unsigned long"; + dst_type = INT_ULONG; } else if (H5Tequal(dst, H5T_NATIVE_LLONG)) { - dst_type_name = "long long"; - dst_type = INT_LLONG; + dst_type_name = "long long"; + dst_type = INT_LLONG; } else if (H5Tequal(dst, H5T_NATIVE_ULLONG)) { - dst_type_name = "unsigned long long"; - dst_type = INT_ULLONG; + dst_type_name = "unsigned long long"; + dst_type = INT_ULLONG; } else if (H5Tequal(dst, H5T_NATIVE_FLOAT)) { - dst_type_name = "float"; - dst_type = FLT_FLOAT; + dst_type_name = "float"; + dst_type = FLT_FLOAT; } else if (H5Tequal(dst, H5T_NATIVE_DOUBLE)) { - dst_type_name = "double"; - dst_type = FLT_DOUBLE; + dst_type_name = "double"; + dst_type = FLT_DOUBLE; #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (H5Tequal(dst, H5T_NATIVE_LDOUBLE)) { - dst_type_name = "long double"; - dst_type = FLT_LDOUBLE; + dst_type_name = "long double"; + dst_type = FLT_LDOUBLE; #endif } else { - dst_type_name = "UNKNOWN"; - dst_type = OTHER; + dst_type_name = "UNKNOWN"; + dst_type = OTHER; } /* Sanity checks */ if (OTHER==src_type || OTHER==dst_type) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" Unknown data type."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" Unknown data type."); + goto error; } if ((INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || @@ -3566,12 +3560,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) && FLT_LDOUBLE!=dst_type #endif )) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" 1. Not an integer-float conversion."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" 1. Not an integer-float conversion."); + goto error; } if ((FLT_FLOAT==src_type || FLT_DOUBLE==src_type @@ -3583,12 +3577,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) && INT_USHORT!=dst_type && INT_INT!=dst_type && INT_UINT!=dst_type && INT_LONG!=dst_type && INT_ULONG!=dst_type && INT_LLONG!=dst_type && INT_ULLONG!=dst_type)) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" 2. Not a float-integer conversion."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" 2. Not a float-integer conversion."); + goto error; } if (INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || @@ -3597,7 +3591,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INT_ULLONG==src_type) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test=0; } else { @@ -3610,7 +3604,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) else HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test=0; } @@ -4347,44 +4341,44 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) H5_WARNING(); } } - printf(" elmt %u: \n", (unsigned)j); + HDprintf(" elmt %u: \n", (unsigned)j); - printf(" src = "); + HDprintf(" src = "); for (k=0; k<src_size; k++) - printf(" %02x", saved[j*src_size+ENDIAN(src_size, k, sendian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); + HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size, k, sendian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); switch (src_type) { case INT_SCHAR: HDmemcpy(aligned, saved+j*sizeof(signed char), sizeof(signed char)); - printf(" %29d\n", (int)*((signed char*)aligned)); + HDprintf(" %29d\n", (int)*((signed char*)aligned)); break; case INT_UCHAR: HDmemcpy(aligned, saved+j*sizeof(unsigned char), sizeof(unsigned char)); - printf(" %29u\n", (unsigned)*((unsigned char*)aligned)); + HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned)); break; case INT_SHORT: HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); - printf(" %29hd\n", *((short*)aligned)); + HDprintf(" %29hd\n", *((short*)aligned)); break; case INT_USHORT: HDmemcpy(aligned, saved+j*sizeof(unsigned short), sizeof(unsigned short)); - printf(" %29hu\n", *((unsigned short*)aligned)); + HDprintf(" %29hu\n", *((unsigned short*)aligned)); break; case INT_INT: HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); - printf(" %29d\n", *((int*)aligned)); + HDprintf(" %29d\n", *((int*)aligned)); break; case INT_UINT: HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); - printf(" %29u\n", *((unsigned*)aligned)); + HDprintf(" %29u\n", *((unsigned*)aligned)); break; case INT_LONG: HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); - printf(" %29ld\n", *((long*)aligned)); + HDprintf(" %29ld\n", *((long*)aligned)); break; case INT_ULONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long), sizeof(unsigned long)); - printf(" %29lu\n", *((unsigned long*)aligned)); + HDprintf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); @@ -4396,16 +4390,16 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case FLT_FLOAT: HDmemcpy(aligned, saved+j*sizeof(float), sizeof(float)); - printf(" %29f\n", (double)*((float*)aligned)); + HDprintf(" %29f\n", (double)*((float*)aligned)); break; case FLT_DOUBLE: HDmemcpy(aligned, saved+j*sizeof(double), sizeof(double)); - printf(" %29f\n", *((double*)aligned)); + HDprintf(" %29f\n", *((double*)aligned)); break; #if H5_SIZEOF_LONG_DOUBLE !=0 case FLT_LDOUBLE: HDmemcpy(aligned, saved+j*sizeof(long double), sizeof(long double)); - printf(" %29Lf\n", *((long double*)aligned)); + HDprintf(" %29Lf\n", *((long double*)aligned)); break; #endif case OTHER: @@ -4414,42 +4408,42 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; } - printf(" dst = "); + HDprintf(" dst = "); for (k=0; k<dst_size; k++) - printf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, dendian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); + HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, dendian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: HDmemcpy(aligned, buf+j*sizeof(signed char), sizeof(signed char)); - printf(" %29d\n", (int)*((signed char*)aligned)); + HDprintf(" %29d\n", (int)*((signed char*)aligned)); break; case INT_UCHAR: HDmemcpy(aligned, buf+j*sizeof(unsigned char), sizeof(unsigned char)); - printf(" %29u\n", (unsigned)*((unsigned char*)aligned)); + HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned)); break; case INT_SHORT: HDmemcpy(aligned, buf+j*sizeof(short), sizeof(short)); - printf(" %29hd\n", *((short*)aligned)); + HDprintf(" %29hd\n", *((short*)aligned)); break; case INT_USHORT: HDmemcpy(aligned, buf+j*sizeof(unsigned short), sizeof(unsigned short)); - printf(" %29hu\n", *((unsigned short*)aligned)); + HDprintf(" %29hu\n", *((unsigned short*)aligned)); break; case INT_INT: HDmemcpy(aligned, buf+j*sizeof(int), sizeof(int)); - printf(" %29d\n", *((int*)aligned)); + HDprintf(" %29d\n", *((int*)aligned)); break; case INT_UINT: HDmemcpy(aligned, buf+j*sizeof(unsigned), sizeof(unsigned)); - printf(" %29u\n", *((unsigned*)aligned)); + HDprintf(" %29u\n", *((unsigned*)aligned)); break; case INT_LONG: HDmemcpy(aligned, buf+j*sizeof(long), sizeof(long)); - printf(" %29ld\n", *((long*)aligned)); + HDprintf(" %29ld\n", *((long*)aligned)); break; case INT_ULONG: HDmemcpy(aligned, buf+j*sizeof(unsigned long), sizeof(unsigned long)); - printf(" %29lu\n", *((unsigned long*)aligned)); + HDprintf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(long long)); @@ -4461,16 +4455,16 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case FLT_FLOAT: HDmemcpy(aligned, buf+j*sizeof(float), sizeof(float)); - printf(" %29f\n", (double)*((float*)aligned)); + HDprintf(" %29f\n", (double)*((float*)aligned)); break; case FLT_DOUBLE: HDmemcpy(aligned, buf+j*sizeof(double), sizeof(double)); - printf(" %29f\n", *((double*)aligned)); + HDprintf(" %29f\n", *((double*)aligned)); break; #if H5_SIZEOF_LONG_DOUBLE !=0 case FLT_LDOUBLE: HDmemcpy(aligned, buf+j*sizeof(long double), sizeof(long double)); - printf(" %29Lf\n", *((long double*)aligned)); + HDprintf(" %29Lf\n", *((long double*)aligned)); break; #endif case OTHER: @@ -4479,34 +4473,34 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; } - printf(" ans = "); + HDprintf(" ans = "); for (k=0; k<dst_size; k++) - printf(" %02x", hw[ENDIAN(dst_size, k, dendian)]); - printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); + HDprintf(" %02x", hw[ENDIAN(dst_size, k, dendian)]); + HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: - printf(" %29d\n", (int)*((signed char*)((void *)hw))); + HDprintf(" %29d\n", (int)*((signed char*)((void *)hw))); break; case INT_UCHAR: - printf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw))); + HDprintf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw))); break; case INT_SHORT: - printf(" %29hd\n", *((short*)((void *)hw))); + HDprintf(" %29hd\n", *((short*)((void *)hw))); break; case INT_USHORT: - printf(" %29hu\n", *((unsigned short*)((void *)hw))); + HDprintf(" %29hu\n", *((unsigned short*)((void *)hw))); break; case INT_INT: - printf(" %29d\n", *((int*)((void *)hw))); + HDprintf(" %29d\n", *((int*)((void *)hw))); break; case INT_UINT: - printf(" %29u\n", *((unsigned int*)((void *)hw))); + HDprintf(" %29u\n", *((unsigned int*)((void *)hw))); break; case INT_LONG: - printf(" %29ld\n", *((long*)((void *)hw))); + HDprintf(" %29ld\n", *((long*)((void *)hw))); break; case INT_ULONG: - printf(" %29lu\n", *((unsigned long*)((void *)hw))); + HDprintf(" %29lu\n", *((unsigned long*)((void *)hw))); break; case INT_LLONG: HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)((void *)hw))); @@ -4515,14 +4509,14 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)((void *)hw))); break; case FLT_FLOAT: - printf(" %29f\n", (double)*((float*)((void *)hw))); + HDprintf(" %29f\n", (double)*((float*)((void *)hw))); break; case FLT_DOUBLE: - printf(" %29f\n", *((double*)((void *)hw))); + HDprintf(" %29f\n", *((double*)((void *)hw))); break; #if H5_SIZEOF_LONG_DOUBLE !=0 case FLT_LDOUBLE: - printf(" %29Lf\n", *((long double*)((void *)hw))); + HDprintf(" %29Lf\n", *((long double*)((void *)hw))); break; #endif case OTHER: @@ -4555,7 +4549,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ /* If the source is normalized floating values, treat the failures as error; * if it is denormalized or special floating values, treat the failure as warning.*/ @@ -4573,7 +4567,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ if(run_test==TEST_NORMAL) return MAX((int)fails_all_tests, 1); @@ -4583,19 +4577,19 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) } } - + /*------------------------------------------------------------------------- - * Function: overflows + * Function: overflows * - * Purpose: When convert from float or double to any integer type, + * Purpose: When convert from float or double to any integer type, * check if overflow occurs. * * - * Return: TRUE: overflow happens + * Return: TRUE: overflow happens * * FALSE: no overflow * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Monday, Nov 17, 2003 * * Modifications: @@ -4675,15 +4669,15 @@ done: return ret_value; } - + /*------------------------------------------------------------------------- - * Function: run_integer_tests + * Function: run_integer_tests * - * Purpose: Runs all integer tests. + * Purpose: Runs all integer tests. * - * Return: Number of errors + * Return: Number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Modifications: @@ -4693,7 +4687,7 @@ done: static int run_integer_tests(const char *name) { - int nerrors = 0; + int nerrors = 0; nerrors += test_conv_int_1(name, H5T_NATIVE_SCHAR, H5T_NATIVE_UCHAR); nerrors += test_conv_int_1(name, H5T_NATIVE_SCHAR, H5T_NATIVE_SHORT); @@ -4838,15 +4832,15 @@ run_integer_tests(const char *name) return nerrors; } - + /*------------------------------------------------------------------------- - * Function: run_fp_tests + * Function: run_fp_tests * - * Purpose: Runs all floating-point tests. + * Purpose: Runs all floating-point tests. * - * Return: Number of errors + * Return: Number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, March 22, 2005 * * Modifications: @@ -4856,7 +4850,7 @@ run_integer_tests(const char *name) static int run_fp_tests(const char *name) { - int nerrors = 0; + int nerrors = 0; if(!strcmp(name, "noop")) { nerrors += test_conv_flt_1("noop", TEST_NOOP, H5T_NATIVE_FLOAT, H5T_NATIVE_FLOAT); @@ -4887,11 +4881,11 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, "long double", "float"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); @@ -4915,11 +4909,11 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", "float or double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); @@ -4934,15 +4928,15 @@ done: return nerrors; } - + /*------------------------------------------------------------------------- - * Function: run_int_fp_conv + * Function: run_int_fp_conv * - * Purpose: Runs all integer-float tests. + * Purpose: Runs all integer-float tests. * - * Return: Number of errors + * Return: Number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Monday, November 10, 2003 * * Modifications: @@ -4952,7 +4946,7 @@ done: static int run_int_fp_conv(const char *name) { - int nerrors = 0; + int nerrors = 0; nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_SCHAR, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_SCHAR, H5T_NATIVE_DOUBLE); @@ -5001,11 +4995,11 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "(unsigned) long", "long double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the special algorithm of hardware conversion."); @@ -5020,11 +5014,11 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_LDOUBLE); #else /* H5_LLONG_TO_LDOUBLE_CORRECT */ { - char str[256]; /*hello string */ + char str[256]; /*hello string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long long", "long double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler error in handling conversion."); } @@ -5033,11 +5027,11 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE); #else /* H5_LLONG_TO_LDOUBLE_CORRECT */ { - char str[256]; /*hello string */ + char str[256]; /*hello string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", "long double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler not handling conversion."); } @@ -5048,15 +5042,15 @@ run_int_fp_conv(const char *name) return nerrors; } - + /*------------------------------------------------------------------------- - * Function: run_fp_int_conv + * Function: run_fp_int_conv * - * Purpose: Runs all float-integer tests. + * Purpose: Runs all float-integer tests. * - * Return: Number of errors + * Return: Number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Monday, November 10, 2003 * * Modifications: @@ -5066,7 +5060,7 @@ run_int_fp_conv(const char *name) static int run_fp_int_conv(const char *name) { - int nerrors = 0; + int nerrors = 0; int test_values; for(test_values = TEST_NORMAL; test_values <= TEST_SPECIAL; test_values++) { @@ -5111,7 +5105,7 @@ run_fp_int_conv(const char *name) #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE if(test_values != TEST_SPECIAL) { - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); @@ -5119,18 +5113,18 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); } else { #ifndef H5_DISABLE_SOME_LDOUBLE_CONV - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); #else - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", "signed and unsigned char, short, int, long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); @@ -5152,11 +5146,11 @@ run_fp_int_conv(const char *name) } #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "(unsigned) long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the special algorithm of hardware conversion."); @@ -5172,11 +5166,11 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LLONG); #else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "long long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to hardware conversion error."); @@ -5189,11 +5183,11 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULLONG); #else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "unsigned long long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to hardware conversion error."); @@ -5209,7 +5203,7 @@ run_fp_int_conv(const char *name) return nerrors; } - + /*------------------------------------------------------------------------- * Function: main * @@ -5233,7 +5227,7 @@ run_fp_int_conv(const char *name) int main(void) { - unsigned long nerrors = 0; + unsigned long nerrors = 0; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -5241,7 +5235,7 @@ main(void) reset_hdf5(); if (ALIGNMENT) - printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); + HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); /* Do the tests */ @@ -5310,11 +5304,11 @@ main(void) h5_restore_err(); if (nerrors) { - printf("***** %lu FAILURE%s! *****\n", + HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } - printf("All data type tests passed.\n"); + HDprintf("All data type tests passed.\n"); return 0; } diff --git a/test/dtransform.c b/test/dtransform.c index f022699..6f7e8a4 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -34,17 +34,17 @@ hid_t dset_id_float_chunk = -1; const float windchillFfloat[ROWS][COLS] = { {36.0f, 31.0f, 25.0f, 19.0f, 13.0f, 7.0f, 1.0f, -5.0f, -11.0f, -16.0f, -22.0f, -28.0f, -34.0f, -40.0f, -46.0f, -52.0f, -57.0f, -63.0f}, - {34.0f, 27.0f, 21.0f, 15.0f, 9.0f, 3.0f, -4.0f, -10.0f, -16.0f, -22.0f, -28.0f, -35.0f, -41.0f, -47.0f, -53.0f, -59.0f, -66.0f, -72.0f} , - {32.0f, 25.0f, 19.0f, 13.0f, 6.0f, 0.0f, -7.0f, -13.0f, -19.0f, -26.0f, -32.0f, -39.0f, -45.0f, -51.0f, -58.0f, -64.0f, -71.0f, -77.0f}, - {30.0f, 24.0f, 17.0f, 11.0f, 4.0f, -2.0f, -9.0f, -15.0f, -22.0f, -29.0f, -35.0f, -42.0f, -48.0f, -55.0f, -61.0f, -68.0f, -74.0f, -81.0f}, - {29.0f, 23.0f, 16.0f, 9.0f, 3.0f, -4.0f, -11.0f, -17.0f, -24.0f, -31.0f, -37.0f, -44.0f, -51.0f, -58.0f, -64.0f, -71.0f, -78.0f, -84.0f}, - {28.0f, 22.0f, 15.0f, 8.0f, 1.0f, -5.0f, -12.0f, -19.0f, -26.0f, -33.0f, -39.0f, -46.0f, -53.0f, -60.0f, -67.0f, -73.0f, -80.0f, -87.0f}, - {28.0f, 21.0f, 14.0f, 7.0f, 0.0f, -7.0f, -14.0f, -21.0f, -27.0f, -34.0f, -41.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -82.0f, -89.0f}, - {27.0f, 20.0f, 13.0f, 6.0f, -1.0f, -8.0f, -15.0f, -22.0f, -29.0f, -36.0f, -43.0f, -50.0f, -57.0f, -64.0f, -71.0f, -78.0f, -84.0f, -91.0f}, - {26.0f, 19.0f, 12.0f, 5.0f, -2.0f, -9.0f, -16.0f, -23.0f, -30.0f, -37.0f, -44.0f, -51.0f, -58.0f, -65.0f, -72.0f, -79.0f, -86.0f, -93.0f}, - {26.0f, 19.0f, 12.0f, 4.0f, -3.0f, -10.0f, -17.0f, -24.0f, -31.0f, -38.0f, -45.0f, -52.0f, -60.0f, -67.0f, -74.0f, -81.0f, -88.0f, -95.0f}, - {25.0f, 18.0f, 11.0f, 4.0f, -3.0f, -11.0f, -18.0f, -25.0f, -32.0f, -39.0f, -46.0f, -54.0f, -61.0f, -68.0f, -75.0f, -82.0f, -89.0f, -97.0f}, - {25.0f, 17.0f, 10.0f, 3.0f, -4.0f, -11.0f, -19.0f, -26.0f, -33.0f, -40.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -84.0f, -91.0f, -98.0f} + {34.0f, 27.0f, 21.0f, 15.0f, 9.0f, 3.0f, -4.0f, -10.0f, -16.0f, -22.0f, -28.0f, -35.0f, -41.0f, -47.0f, -53.0f, -59.0f, -66.0f, -72.0f} , + {32.0f, 25.0f, 19.0f, 13.0f, 6.0f, 0.0f, -7.0f, -13.0f, -19.0f, -26.0f, -32.0f, -39.0f, -45.0f, -51.0f, -58.0f, -64.0f, -71.0f, -77.0f}, + {30.0f, 24.0f, 17.0f, 11.0f, 4.0f, -2.0f, -9.0f, -15.0f, -22.0f, -29.0f, -35.0f, -42.0f, -48.0f, -55.0f, -61.0f, -68.0f, -74.0f, -81.0f}, + {29.0f, 23.0f, 16.0f, 9.0f, 3.0f, -4.0f, -11.0f, -17.0f, -24.0f, -31.0f, -37.0f, -44.0f, -51.0f, -58.0f, -64.0f, -71.0f, -78.0f, -84.0f}, + {28.0f, 22.0f, 15.0f, 8.0f, 1.0f, -5.0f, -12.0f, -19.0f, -26.0f, -33.0f, -39.0f, -46.0f, -53.0f, -60.0f, -67.0f, -73.0f, -80.0f, -87.0f}, + {28.0f, 21.0f, 14.0f, 7.0f, 0.0f, -7.0f, -14.0f, -21.0f, -27.0f, -34.0f, -41.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -82.0f, -89.0f}, + {27.0f, 20.0f, 13.0f, 6.0f, -1.0f, -8.0f, -15.0f, -22.0f, -29.0f, -36.0f, -43.0f, -50.0f, -57.0f, -64.0f, -71.0f, -78.0f, -84.0f, -91.0f}, + {26.0f, 19.0f, 12.0f, 5.0f, -2.0f, -9.0f, -16.0f, -23.0f, -30.0f, -37.0f, -44.0f, -51.0f, -58.0f, -65.0f, -72.0f, -79.0f, -86.0f, -93.0f}, + {26.0f, 19.0f, 12.0f, 4.0f, -3.0f, -10.0f, -17.0f, -24.0f, -31.0f, -38.0f, -45.0f, -52.0f, -60.0f, -67.0f, -74.0f, -81.0f, -88.0f, -95.0f}, + {25.0f, 18.0f, 11.0f, 4.0f, -3.0f, -11.0f, -18.0f, -25.0f, -32.0f, -39.0f, -46.0f, -54.0f, -61.0f, -68.0f, -75.0f, -82.0f, -89.0f, -97.0f}, + {25.0f, 17.0f, 10.0f, 3.0f, -4.0f, -11.0f, -19.0f, -26.0f, -33.0f, -40.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -84.0f, -91.0f, -98.0f} }; const int transformData[ROWS][COLS] = @@ -62,202 +62,202 @@ const int transformData[ROWS][COLS] = {25, 17, 10, 3, 4, 11, 19, 26, 33, 40, 48, 55, 62, 69, 4, 12, 19, 26} }; -#define UCOMPARE(TYPE,VAR1,VAR2,TOL) \ -{ \ - size_t i,j; \ - \ - for(i=0; i<ROWS; i++) \ - for(j=0; j<COLS; j++) \ - { \ - if(!( (((VAR1)[i][j] >= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] - TOL) < (TYPE)((VAR2)[i][j]))) || ( ((VAR1)[i][j] <= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] + TOL) > (TYPE)((VAR2)[i][j]))))) \ - { \ - H5_FAILED(); \ - fprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \ - goto error; \ - } \ - } \ - PASSED(); \ +#define UCOMPARE(TYPE,VAR1,VAR2,TOL) \ +{ \ + size_t i,j; \ + \ + for(i=0; i<ROWS; i++) \ + for(j=0; j<COLS; j++) \ + { \ + if(!( (((VAR1)[i][j] >= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] - TOL) < (TYPE)((VAR2)[i][j]))) || ( ((VAR1)[i][j] <= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] + TOL) > (TYPE)((VAR2)[i][j]))))) \ + { \ + H5_FAILED(); \ + HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \ + goto error; \ + } \ + } \ + PASSED(); \ } -#define COMPARE(TYPE,VAR1,VAR2,TOL) \ -{ \ - size_t i,j; \ - \ - for(i=0; i<ROWS; i++) \ - for(j=0; j<COLS; j++) \ - { \ - if( !(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + TOL)) && ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - TOL))) ) \ - { \ - H5_FAILED(); \ - fprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \ - goto error; \ - } \ - } \ - PASSED(); \ +#define COMPARE(TYPE,VAR1,VAR2,TOL) \ +{ \ + size_t i,j; \ + \ + for(i=0; i<ROWS; i++) \ + for(j=0; j<COLS; j++) \ + { \ + if( !(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + TOL)) && ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - TOL))) ) \ + { \ + H5_FAILED(); \ + HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \ + goto error; \ + } \ + } \ + PASSED(); \ } -#define COMPARE_INT(VAR1,VAR2) \ -{ \ - size_t i,j; \ - \ - for(i=0; i<ROWS; i++) \ - for(j=0; j<COLS; j++) \ - { \ - if( (VAR1)[i][j] != (VAR2)[i][j] ) \ - { \ - H5_FAILED(); \ - fprintf(stderr, " ERROR: data failed to match computed data\n"); \ - goto error; \ - } \ - } \ +#define COMPARE_INT(VAR1,VAR2) \ +{ \ + size_t i,j; \ + \ + for(i=0; i<ROWS; i++) \ + for(j=0; j<COLS; j++) \ + { \ + if( (VAR1)[i][j] != (VAR2)[i][j] ) \ + { \ + H5_FAILED(); \ + HDfprintf(stderr, " ERROR: data failed to match computed data\n"); \ + goto error; \ + } \ + } \ } -#define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ -{ \ - TYPE array[ROWS][COLS]; \ - const char* f_to_c = "(5/9.0)*(x-32)"; \ +#define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ +{ \ + TYPE array[ROWS][COLS]; \ + const char* f_to_c = "(5/9.0)*(x-32)"; \ /* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */ \ - const char* utrans = "((x+100)/4)*3"; \ - \ - hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset, dset_nn, dt_nn; \ + const char* utrans = "((x+100)/4)*3"; \ + \ + hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset, dset_nn, dt_nn; \ H5T_order_t order; \ - hsize_t dim[2] = {ROWS, COLS}; \ - \ - if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ + hsize_t dim[2] = {ROWS, COLS}; \ + \ + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \ \ if((dt_nn = H5Tcopy(HDF_TYPE)) < 0) TEST_ERROR \ if((order = H5Tget_order(dt_nn)) == H5T_ORDER_ERROR) TEST_ERROR \ if(H5Tset_order(dt_nn, order == H5T_ORDER_LE ? H5T_ORDER_BE : H5T_ORDER_LE) < 0) TEST_ERROR \ - if((dset_nn = H5Dcreate2(file_id, "/nonnative_transformtest_"TEST_STR, dt_nn, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR \ + if((dset_nn = H5Dcreate2(file_id, "/nonnative_transformtest_"TEST_STR, dt_nn, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR \ if(H5Tclose(dt_nn) < 0) TEST_ERROR \ - \ - if(SIGNED) \ - { \ - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ - if(H5Dwrite(dset_nn, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ - } \ - else \ - { \ - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ - if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ - if(H5Dwrite(dset_nn, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ - } \ - \ - \ - TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \ - \ - if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ - if(SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + \ + if(SIGNED) \ + { \ + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_nn, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ + } \ + else \ + { \ + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ + if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_nn, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ + } \ + \ + \ + TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \ + \ + if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ + if(SIGNED) \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ + else \ + UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ \ - TESTING("contiguous, byte order conversion ("TEST_STR"->"TEST_STR")") \ - \ - if(H5Dread(dset_nn, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ - if(SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ - \ - if(SIGNED) \ - { \ - TESTING("contiguous, with type conversion (float->"TEST_STR")") \ - \ - if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - } \ - \ - if(H5Dclose(dset) < 0) TEST_ERROR; \ - if(H5Sclose(dataspace) < 0) TEST_ERROR; \ + TESTING("contiguous, byte order conversion ("TEST_STR"->"TEST_STR")") \ + \ + if(H5Dread(dset_nn, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ + if(SIGNED) \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ + else \ + UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + \ + if(SIGNED) \ + { \ + TESTING("contiguous, with type conversion (float->"TEST_STR")") \ + \ + if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ + } \ + \ + if(H5Dclose(dset) < 0) TEST_ERROR; \ + if(H5Sclose(dataspace) < 0) TEST_ERROR; \ } -#define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ -{ \ - TYPE array[ROWS][COLS]; \ - const char* f_to_c = "(5/9.0)*(x-32)"; \ +#define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ +{ \ + TYPE array[ROWS][COLS]; \ + const char* f_to_c = "(5/9.0)*(x-32)"; \ /* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */ \ - const char* utrans = "((x+100)/4)*3"; \ - \ - hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, cparms, memspace, dset_chunk, filespace; \ - hsize_t dim[2] = {ROWS, COLS}; \ - hsize_t offset[2] = {0, 0}; \ - \ - \ - if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ - \ - if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; \ - if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \ - \ - if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \ - if((filespace = H5Dget_space(dset_chunk)) < 0) TEST_ERROR \ - if((memspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR \ - if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \ - \ - if(SIGNED) \ - { \ - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ - if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ - } \ - else \ - { \ - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ - if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ - } \ - \ - \ - TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \ - \ - if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ - if(SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ - \ - if(SIGNED) \ - { \ - TESTING("chunked, with type conversion (float->"TEST_STR")") \ - \ - if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - } \ - \ - \ - if(H5Pclose(cparms) < 0) TEST_ERROR; \ - if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \ - if(H5Sclose(dataspace) < 0) TEST_ERROR; \ - if(H5Sclose(memspace) < 0) TEST_ERROR; \ + const char* utrans = "((x+100)/4)*3"; \ + \ + hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, cparms, memspace, dset_chunk, filespace; \ + hsize_t dim[2] = {ROWS, COLS}; \ + hsize_t offset[2] = {0, 0}; \ + \ + \ + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ + \ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; \ + if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \ + \ + if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \ + if((filespace = H5Dget_space(dset_chunk)) < 0) TEST_ERROR \ + if((memspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR \ + if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \ + \ + if(SIGNED) \ + { \ + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ + } \ + else \ + { \ + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ + } \ + \ + \ + TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \ + \ + if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ + if(SIGNED) \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ + else \ + UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + \ + if(SIGNED) \ + { \ + TESTING("chunked, with type conversion (float->"TEST_STR")") \ + \ + if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ + } \ + \ + \ + if(H5Pclose(cparms) < 0) TEST_ERROR; \ + if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \ + if(H5Sclose(dataspace) < 0) TEST_ERROR; \ + if(H5Sclose(memspace) < 0) TEST_ERROR; \ } -#define INVALID_SET_TEST(TRANSFORM) \ -{ \ - if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \ - { \ - PASSED(); \ - } \ - else \ - { \ - H5_FAILED(); \ - fprintf(stderr, " ERROR: Data transform allowed invalid TRANSFORM transform to be set\n"); \ - goto error; \ - } \ +#define INVALID_SET_TEST(TRANSFORM) \ +{ \ + if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \ + { \ + PASSED(); \ + } \ + else \ + { \ + H5_FAILED(); \ + HDfprintf(stderr, " ERROR: Data transform allowed invalid TRANSFORM transform to be set\n"); \ + goto error; \ + } \ } int main(void) { hid_t dxpl_id_c_to_f = -1; hid_t dxpl_id_c_to_f_copy = 1; - hid_t dxpl_id_simple = -1; + hid_t dxpl_id_simple = -1; hid_t dxpl_id_polynomial = -1; hid_t dxpl_id_polynomial_copy = -1; hid_t dxpl_id_utrans_inv = -1; @@ -440,8 +440,8 @@ init_test(hid_t file_id) PASSED(); return 0; - -error: + +error: H5E_BEGIN_TRY { H5Pclose(cparms); H5Pclose(dxpl_id_f_to_c); @@ -472,7 +472,7 @@ test_poly(const hid_t dxpl_id_polynomial) if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread) < 0) TEST_ERROR - + COMPARE(float, polyflread, polyflres, 2.0f) for(row = 0; row < ROWS; row++) @@ -485,12 +485,12 @@ test_poly(const hid_t dxpl_id_polynomial) if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread) < 0) TEST_ERROR - + COMPARE(int, polyintread, polyflres, 4) return 0; -error: +error: return -1; } @@ -533,7 +533,7 @@ test_specials(hid_t file) if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) TEST_ERROR - + COMPARE_INT(read_buf, data_res) if(H5Dclose(dset_id) < 0) @@ -557,7 +557,7 @@ test_specials(hid_t file) if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) TEST_ERROR - + COMPARE_INT(read_buf, data_res) if(H5Dclose(dset_id) < 0) @@ -581,7 +581,7 @@ test_specials(hid_t file) if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) TEST_ERROR - + COMPARE_INT(read_buf, data_res) if(H5Dclose(dset_id) < 0) @@ -605,7 +605,7 @@ test_specials(hid_t file) if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) TEST_ERROR - + COMPARE_INT(read_buf, data_res) if(H5Dclose(dset_id) < 0) @@ -629,7 +629,7 @@ test_specials(hid_t file) if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) TEST_ERROR - + COMPARE_INT(read_buf, data_res) if(H5Dclose(dset_id) < 0) @@ -644,7 +644,7 @@ test_specials(hid_t file) PASSED(); return 0; -error: +error: return -1; } @@ -667,19 +667,19 @@ test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy) if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread) < 0) TEST_ERROR - + COMPARE(int, windchillFintread, windchillFfloat, 2) TESTING("data transform, polynomial transform w/ copied property") if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread) < 0) TEST_ERROR - + COMPARE(int, polyintread, polyflres, 2) return 0; -error: +error: return -1; } @@ -696,7 +696,7 @@ test_trivial(const hid_t dxpl_id_simple) TEST_ERROR for(row = 0; row < ROWS; row++) for(col = 0; col < COLS; col++) { - if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL) + if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n"); } @@ -708,7 +708,7 @@ test_trivial(const hid_t dxpl_id_simple) TEST_ERROR for(row = 0; row < ROWS; row++) for(col = 0; col < COLS; col++) { - if(windchillFintread[row][col] != 4) + if(windchillFintread[row][col] != 4) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") } @@ -740,7 +740,7 @@ test_getset(const hid_t dxpl_id_c_to_f) FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n") PASSED() - + HDfree(ptrgetTest); ptrgetTest = NULL; @@ -752,10 +752,10 @@ test_getset(const hid_t dxpl_id_c_to_f) if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread) < 0) TEST_ERROR - + for(row = 0; row < ROWS; row++) for(col = 0; col < COLS; col++) { - if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL) + if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") } @@ -767,7 +767,7 @@ test_getset(const hid_t dxpl_id_c_to_f) TEST_ERROR if(H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(simple) + 1) < 0) TEST_ERROR - if(HDstrcmp(simple, ptrgetTest) != 0) + if(HDstrcmp(simple, ptrgetTest) != 0) FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n") PASSED() @@ -793,11 +793,11 @@ test_set(void) char *ptrgetTest = NULL; TESTING("H5Pget_data_transform (get before set)") - + if(NULL == (ptrgetTest = (char *)HDmalloc(HDstrlen(str) + 1))) TEST_ERROR - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR /* Test get before set */ @@ -807,7 +807,7 @@ test_set(void) if(H5Pget_data_transform(dxpl_id, ptrgetTest, HDstrlen(str) + 1) < 0) PASSED() - else + else FAIL_PUTS_ERROR(" ERROR: Data transform get before set succeeded (it shouldn't have)\n"); HDfree(ptrgetTest); diff --git a/test/dtypes.c b/test/dtypes.c index 39fad9f..5eaa77c 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -23,7 +23,7 @@ #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ /* Number of elements in each test */ -#define NTESTELEM 100000 +#define NTESTELEM 100000 /* For test_compound_8 and test_compound_10 */ #define ARRAY_DIM 4 @@ -32,7 +32,7 @@ * Offset from alinged memory returned by malloc(). This can be used to test * that type conversions handle non-aligned buffers correctly. */ -#define ALIGNMENT 1 +#define ALIGNMENT 1 /* * Define if you want to test alignment code on a machine that doesn't @@ -43,7 +43,7 @@ /* Alignment test stuff */ #ifdef TEST_ALIGNMENT -#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif @@ -71,7 +71,7 @@ FAIL_STACK_ERROR \ if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \ H5_FAILED(); \ - printf(" #dtype ids expected: %lld; found: %lld\n", \ + HDprintf(" #dtype ids expected: %lld; found: %lld\n", \ (long long)NMEMBS, (long long)H5I_nmembers(H5I_DATATYPE)); \ goto error; \ } @@ -136,22 +136,22 @@ static int num_opaque_conversions_g = 0; static int opaque_check(int tag_it); static herr_t convert_opaque(hid_t st, hid_t dt, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, - void *bkg, hid_t dset_xfer_plid); + void *bkg, hid_t dset_xfer_plid); static int opaque_long(void); static int opaque_funcs(void); - + /*------------------------------------------------------------------------- - * Function: reset_hdf5 + * Function: reset_hdf5 * - * Purpose: Reset the hdf5 library. This causes statistics to be printed - * and counters to be reset. + * Purpose: Reset the hdf5 library. This causes statistics to be printed + * and counters to be reset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 * * Modifications: @@ -182,7 +182,7 @@ reset_hdf5(void) } - + /*------------------------------------------------------------------------- * Function: test_classes * @@ -283,7 +283,7 @@ test_classes(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_copy * @@ -304,7 +304,7 @@ static int test_copy(void) { hid_t a_copy; - herr_t status; + herr_t status; TESTING("H5Tcopy()"); @@ -313,12 +313,12 @@ test_copy(void) /* We should not be able to close a built-in byte */ H5E_BEGIN_TRY { - status = H5Tclose (H5T_NATIVE_SCHAR); + status = H5Tclose (H5T_NATIVE_SCHAR); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - HDputs (" Should not be able to close a predefined type!"); - goto error; + H5_FAILED(); + HDputs (" Should not be able to close a predefined type!"); + goto error; } PASSED(); @@ -328,7 +328,7 @@ test_copy(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_detect * @@ -505,7 +505,7 @@ error: return 1; } - + /*------------------------------------------------------------------------- * Function: test_compound_1 * @@ -669,19 +669,19 @@ error: return retval; } - + /*------------------------------------------------------------------------- - * Function: test_compound_2 + * Function: test_compound_2 * - * Purpose: Tests a compound type conversion where the source and - * destination are the same except for the order of the - * elements. + * Purpose: Tests a compound type conversion where the source and + * destination are the same except for the order of the + * elements. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 * * Modifications: @@ -692,19 +692,19 @@ static int test_compound_2(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - int e, d, c[4], b, a; + int e, d, c[4], b, a; } *d_ptr; - const size_t nelmts = NTESTELEM; - const hsize_t four = 4; - unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; - hid_t st=-1, dt=-1; + const size_t nelmts = NTESTELEM; + const hsize_t four = 4; + unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; + hid_t st=-1, dt=-1; hid_t array_dt; - int64_t nmembs; - int i; + int64_t nmembs; + int i; TESTING("compound element reordering"); @@ -716,15 +716,15 @@ test_compound_2(void) bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - s_ptr->a = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; + s_ptr = ((struct st*)((void *)orig)) + i; + s_ptr->a = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; } HDmemcpy(buf, orig, nelmts*sizeof(struct st)); @@ -754,26 +754,26 @@ test_compound_2(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - printf(" i=%d\n", i); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->d, d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->d, d_ptr->e); + goto error; + } } /* Release resources */ @@ -800,19 +800,19 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_compound_3 + * Function: test_compound_3 * - * Purpose: Tests compound conversions where the source and destination - * are the same except the destination is missing a couple - * members which appear in the source. + * Purpose: Tests compound conversions where the source and destination + * are the same except the destination is missing a couple + * members which appear in the source. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 * * Modifications: @@ -823,19 +823,19 @@ static int test_compound_3(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - int a, c[4], e; + int a, c[4], e; } *d_ptr; - const size_t nelmts = NTESTELEM; - const hsize_t four = 4; - unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; - hid_t st=-1, dt=-1; + const size_t nelmts = NTESTELEM; + const hsize_t four = 4; + unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; + hid_t st=-1, dt=-1; hid_t array_dt; - int64_t nmembs; - int i; + int64_t nmembs; + int i; TESTING("compound subset conversions"); @@ -884,24 +884,24 @@ test_compound_3(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - printf(" i=%d\n", i); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - printf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", - d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", + d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->e); + goto error; + } } /* Release resources */ @@ -927,19 +927,19 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_compound_4 + * Function: test_compound_4 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * smaller. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * smaller. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 * * Modifications: @@ -951,22 +951,22 @@ test_compound_4(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - short b; - int a, c[4]; - short d; - int e; + short b; + int a, c[4]; + short d; + int e; } *d_ptr; - const size_t nelmts = NTESTELEM; - const hsize_t four = 4; - unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; - hid_t st=-1, dt=-1; + const size_t nelmts = NTESTELEM; + const hsize_t four = 4; + unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; + hid_t st=-1, dt=-1; hid_t array_dt; - int64_t nmembs; - int i; + int64_t nmembs; + int i; TESTING("compound element shrinking & reordering"); @@ -1017,26 +1017,26 @@ test_compound_4(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - printf(" i=%d\n", i); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->d, d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->d, d_ptr->e); + goto error; + } } /* Release resources */ @@ -1062,20 +1062,20 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_compound_5 + * Function: test_compound_5 * - * Purpose: Many versions of HDF5 have a bug in the optimized compound + * Purpose: Many versions of HDF5 have a bug in the optimized compound * datatype conversion function, H5T_conv_struct_opt(), which * is triggered when the top-level type contains a struct * which must undergo a conversion. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 * * Modifications: @@ -1167,19 +1167,19 @@ test_compound_5(void) return retval; } - + /*------------------------------------------------------------------------- - * Function: test_compound_6 + * Function: test_compound_6 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * larger. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * larger. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, December 13, 2000 * * Modifications: @@ -1199,11 +1199,11 @@ test_compound_6(void) long d; } *d_ptr; - const size_t nelmts = NTESTELEM; - unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; - hid_t st=-1, dt=-1; - int64_t nmembs; - int i; + const size_t nelmts = NTESTELEM; + unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; + hid_t st=-1, dt=-1; + int64_t nmembs; + int i; TESTING("compound element growing"); @@ -1244,18 +1244,18 @@ test_compound_6(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->b != d_ptr->b || - s_ptr->d != d_ptr->d) { - H5_FAILED(); - printf(" i=%d\n", i); - printf(" src={b=%d, d=%d\n", + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->b != d_ptr->b || + s_ptr->d != d_ptr->d) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={b=%d, d=%d\n", (int)s_ptr->b, (int)s_ptr->d); - printf(" dst={b=%ld, d=%ld\n", + HDprintf(" dst={b=%ld, d=%ld\n", d_ptr->b, d_ptr->d); - goto error; - } + goto error; + } } /* Release resources */ @@ -1282,17 +1282,17 @@ error: } /*------------------------------------------------------------------------- - * Function: test_compound_7 + * Function: test_compound_7 * - * Purpose: Tests inserting fields into compound datatypes when the field + * Purpose: Tests inserting fields into compound datatypes when the field * overlaps the end of the compound datatype. Also, tests * increasing compound type size. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, December 18, 2001 * * Modifications: @@ -1325,43 +1325,43 @@ test_compound_7(void) if((tid1= H5Tcreate( H5T_COMPOUND, sizeof(struct s1))) < 0) { H5_FAILED(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(tid1,"a",HOFFSET(struct s1,a),H5T_NATIVE_INT) < 0) { H5_FAILED(); - printf("Can't insert field 'a'\n"); + HDprintf("Can't insert field 'a'\n"); goto error; } /* end if */ if(H5Tinsert(tid1,"b",HOFFSET(struct s1,b),H5T_NATIVE_FLOAT) < 0) { H5_FAILED(); - printf("Can't insert field 'b'\n"); + HDprintf("Can't insert field 'b'\n"); goto error; } /* end if */ if(H5Tinsert(tid1,"c",HOFFSET(struct s1,c),H5T_NATIVE_LONG) < 0) { H5_FAILED(); - printf("Can't insert field 'c'\n"); + HDprintf("Can't insert field 'c'\n"); goto error; } /* end if */ if(H5Tget_size(tid1)!=sizeof(struct s1)) { H5_FAILED(); - printf("Incorrect size for struct 1\n"); + HDprintf("Incorrect size for struct 1\n"); goto error; } /* end if */ if((tid2= H5Tcopy(tid1)) < 0) { H5_FAILED(); - printf("Can't copy datatype\n"); + HDprintf("Can't copy datatype\n"); goto error; } /* end if */ if(H5Tget_size(tid2)==sizeof(struct s2)) { H5_FAILED(); - printf("Incorrect size for struct 2\n"); + HDprintf("Incorrect size for struct 2\n"); goto error; } /* end if */ @@ -1371,7 +1371,7 @@ test_compound_7(void) } H5E_END_TRY; if(ret>=0) { H5_FAILED(); - printf("Inserted field 'd'?\n"); + HDprintf("Inserted field 'd'?\n"); goto error; } /* end if */ @@ -1381,33 +1381,33 @@ test_compound_7(void) } H5E_END_TRY; if(ret>=0) { H5_FAILED(); - printf("Shrunk compound type?\n"); + HDprintf("Shrunk compound type?\n"); goto error; } /* end if */ /* Increase compound type size and try inserting field again */ if(H5Tset_size(tid2, sizeof(struct s2)) < 0) { H5_FAILED(); - printf("Can't increase size for compound type\n"); + HDprintf("Can't increase size for compound type\n"); goto error; } /* end if */ if( H5Tinsert(tid2,"d",HOFFSET(struct s2,d),H5T_NATIVE_DOUBLE) < 0) { H5_FAILED(); - printf("Can't expand compound datatype\n"); + HDprintf("Can't expand compound datatype\n"); goto error; } /* end if */ if(H5Tget_size(tid2)!=sizeof(struct s2)) { H5_FAILED(); - printf("Incorrect size for struct 2\n"); + HDprintf("Incorrect size for struct 2\n"); goto error; } /* end if */ /* Release resources */ if (H5Tclose(tid1) < 0 || H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatypes\n"); + HDprintf("Can't close datatypes\n"); goto error; } /* end if */ @@ -1428,7 +1428,7 @@ error: return 1; } - + /*------------------------------------------------------------------------- * Function: test_compound_8 * @@ -1473,59 +1473,59 @@ test_compound_8(void) /* Create first compound datatype */ if((tid1 = H5Tcreate( H5T_COMPOUND, sizeof(struct s1))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(tid1,"a",HOFFSET(struct s1,a),H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'a'\n"); + HDprintf("Can't insert field 'a'\n"); goto error; } /* end if */ if(H5Tinsert(tid1,"b",HOFFSET(struct s1,b),H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'b'\n"); + HDprintf("Can't insert field 'b'\n"); goto error; } /* end if */ /* Make a copy of the type for later use */ if((tid1_copy = H5Tcopy(tid1)) < 0) { H5_FAILED(); AT(); - printf("Can't copy type #1\n"); + HDprintf("Can't copy type #1\n"); goto error; } /* end if */ /* Test H5Tpack for the first compound type */ if(H5Tpack(tid1) < 0) { H5_FAILED(); AT(); - printf("Can't pack the compound datatype\n"); + HDprintf("Can't pack the compound datatype\n"); goto error; } /* end if */ if(H5Tlock(tid1) < 0) { H5_FAILED(); AT(); - printf("Can't lock the compound datatype\n"); + HDprintf("Can't lock the compound datatype\n"); goto error; } /* end if */ /* If the type is already packed, packing a locked type is OK */ if(H5Tpack(tid1) < 0) { H5_FAILED(); AT(); - printf("Can't pack the compound datatype for second time\n"); + HDprintf("Can't pack the compound datatype for second time\n"); goto error; } /* end if */ /* Verify the size of packed compound type */ if((tsize = H5Tget_size(tid1)) == 0) { H5_FAILED(); AT(); - printf("Can't get size of the compound datatype\n"); + HDprintf("Can't get size of the compound datatype\n"); goto error; } /* end if */ if(tsize != (sizeof(char) + sizeof(int))) { H5_FAILED(); AT(); - printf("The size of the packed compound datatype is incorrect\n"); + HDprintf("The size of the packed compound datatype is incorrect\n"); goto error; } /* end if */ @@ -1535,61 +1535,61 @@ test_compound_8(void) /* Create second compound datatype */ if((tid2 = H5Tcreate( H5T_COMPOUND, sizeof(struct s2))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(tid2,"c",HOFFSET(struct s2,c),H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c'\n"); + HDprintf("Can't insert field 'c'\n"); goto error; } /* end if */ /* Insert the member of unpacked compound type */ if(H5Tinsert(tid2,"d",HOFFSET(struct s2,d),tid1_copy) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'd'\n"); + HDprintf("Can't insert field 'd'\n"); goto error; } /* end if */ /* Make a copy of the type for later */ if((tid3=H5Tcopy(tid2)) < 0) { H5_FAILED(); AT(); - printf("Can't copy type #2\n"); + HDprintf("Can't copy type #2\n"); goto error; } /* end if */ /* Make a copy of the type for later */ if((tid2_copy = H5Tcopy(tid2)) < 0) { H5_FAILED(); AT(); - printf("Can't copy type #2\n"); + HDprintf("Can't copy type #2\n"); goto error; } /* end if */ /* Test H5Tpack for the second compound type */ if(H5Tpack(tid2) < 0) { H5_FAILED(); AT(); - printf("Can't pack the compound datatype\n"); + HDprintf("Can't pack the compound datatype\n"); goto error; } /* end if */ if(H5Tlock(tid2) < 0) { H5_FAILED(); AT(); - printf("Can't lock the compound datatype\n"); + HDprintf("Can't lock the compound datatype\n"); goto error; } /* end if */ /* If the type is already packed, packing a locked type is OK */ if(H5Tpack(tid2) < 0) { H5_FAILED(); AT(); - printf("Can't pack the compound datatype for second time\n"); + HDprintf("Can't pack the compound datatype for second time\n"); goto error; } /* end if */ /* Lock unpacked type */ if(H5Tlock(tid3) < 0) { H5_FAILED(); AT(); - printf("Can't lock the compound datatype\n"); + HDprintf("Can't lock the compound datatype\n"); goto error; } /* end if */ @@ -1599,20 +1599,20 @@ test_compound_8(void) } H5E_END_TRY; if(ret>=0) { H5_FAILED(); AT(); - printf("Packing locked datatype worked?\n"); + HDprintf("Packing locked datatype worked?\n"); goto error; } /* end if */ /* Verify the size of packed compound type */ if((tsize = H5Tget_size(tid2)) == 0) { H5_FAILED(); AT(); - printf("Can't get size of the compound datatype\n"); + HDprintf("Can't get size of the compound datatype\n"); goto error; } /* end if */ if(tsize != (sizeof(char) + sizeof(char) + sizeof(int))) { H5_FAILED(); AT(); - printf("The size of the packed compound datatype is incorrect: tsize = %zu\n", tsize); + HDprintf("The size of the packed compound datatype is incorrect: tsize = %zu\n", tsize); goto error; } /* end if */ @@ -1622,46 +1622,46 @@ test_compound_8(void) /* Create an array type of compound type */ if((arr_tid = H5Tarray_create2(tid2_copy, 1, dims)) < 0) { H5_FAILED(); AT(); - printf("Can't create an array datatype\n"); + HDprintf("Can't create an array datatype\n"); goto error; } /* end if */ /* Test H5Tpack for the array type */ if(H5Tpack(arr_tid) < 0) { H5_FAILED(); AT(); - printf("Can't pack the array datatype\n"); + HDprintf("Can't pack the array datatype\n"); goto error; } /* end if */ /* Verify the size of packed compound type */ if((tsize = H5Tget_size(arr_tid)) == 0) { H5_FAILED(); AT(); - printf("Can't get size of the array datatype\n"); + HDprintf("Can't get size of the array datatype\n"); goto error; } /* end if */ if(tsize != ARRAY_DIM * (sizeof(char) + sizeof(char) + sizeof(int))) { H5_FAILED(); AT(); - printf("The size of the packed array datatype is incorrect\n"); + HDprintf("The size of the packed array datatype is incorrect\n"); goto error; } /* end if */ if(H5Tclose(tid1_copy) < 0) { H5_FAILED(); AT(); - printf("Can't close the compound datatype\n"); + HDprintf("Can't close the compound datatype\n"); goto error; } /* end if */ if(H5Tclose(tid2_copy) < 0) { H5_FAILED(); AT(); - printf("Can't close the compound datatype\n"); + HDprintf("Can't close the compound datatype\n"); goto error; } /* end if */ if(H5Tclose(arr_tid) < 0) { H5_FAILED(); AT(); - printf("Can't close the array datatype\n"); + HDprintf("Can't close the array datatype\n"); goto error; } /* end if */ @@ -1674,7 +1674,7 @@ test_compound_8(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_compound_9 * @@ -1721,51 +1721,51 @@ test_compound_9(void) h5_fixname(FILENAME[3], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create file!\n"); + HDprintf("Can't create file!\n"); goto error; } /* end if */ /* Create first compound datatype */ if((cmpd_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_w))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid, "i1", HOFFSET(struct cmpd_struct_w, i1), H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i1'\n"); + HDprintf("Can't insert field 'i1'\n"); goto error; } /* end if */ str_id = H5Tcopy(H5T_C_S1); if(H5Tset_size(str_id,H5T_VARIABLE) < 0) { H5_FAILED(); AT(); - printf("Can't set size for VL string\n"); + HDprintf("Can't set size for VL string\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid, "vl_string", HOFFSET(cmpd_struct_w, str), str_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i1'\n"); + HDprintf("Can't insert field 'i1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid, "i2", HOFFSET(struct cmpd_struct_w, i2), H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i2'\n"); + HDprintf("Can't insert field 'i2'\n"); goto error; } /* end if */ if(H5Tcommit2(file, "compound", cmpd_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); AT(); - printf("Can't commit datatype\n"); + HDprintf("Can't commit datatype\n"); goto error; } /* end if */ if(H5Tclose(cmpd_tid) < 0) { H5_FAILED(); AT(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ @@ -1774,44 +1774,44 @@ test_compound_9(void) if((dup_tid = H5Tcopy(cmpd_tid)) < 0) { H5_FAILED(); AT(); - printf("Can't copy datatype\n"); + HDprintf("Can't copy datatype\n"); goto error; } /* end if */ dim1[0] = 1; if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) { H5_FAILED(); AT(); - printf("Can't create space\n"); + HDprintf("Can't create space\n"); goto error; } /* end if */ if((dset_id = H5Dcreate2(file, "Dataset", dup_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create dataset\n"); + HDprintf("Can't create dataset\n"); goto error; } /* end if */ if(H5Dwrite(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) { H5_FAILED(); AT(); - printf("Can't write data\n"); + HDprintf("Can't write data\n"); goto error; } /* end if */ if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ if(rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(H5Dvlen_reclaim(dup_tid, space_id, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ rdata.str = NULL; @@ -1832,31 +1832,31 @@ test_compound_9(void) if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("cannot open file\n"); + HDprintf("cannot open file\n"); goto error; } /* end if */ if((dset_id = H5Dopen2(file, "Dataset", H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("cannot open dataset\n"); + HDprintf("cannot open dataset\n"); goto error; } /* end if */ if((space_id = H5Dget_space(dset_id)) < 0) { H5_FAILED(); AT(); - printf("Can't get space\n"); + HDprintf("Can't get space\n"); goto error; } /* end if */ if((cmpd_tid = H5Dget_type(dset_id)) < 0) { H5_FAILED(); AT(); - printf("cannot open dataset\n"); + HDprintf("cannot open dataset\n"); goto error; } /* end if */ if((dup_tid = H5Tcopy(cmpd_tid)) < 0) { H5_FAILED(); AT(); - printf("Can't copy datatype\n"); + HDprintf("Can't copy datatype\n"); goto error; } /* end if */ @@ -1865,19 +1865,19 @@ test_compound_9(void) if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || strcmp(rdata.str, wdata.str)) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(H5Dvlen_reclaim(dup_tid, space_id, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ rdata.str = NULL; @@ -1902,7 +1902,7 @@ test_compound_9(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_compound_10 * @@ -1960,84 +1960,84 @@ test_compound_10(void) h5_fixname(FILENAME[4], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create file!\n"); + HDprintf("Can't create file!\n"); goto error; } /* end if */ /* Create first compound datatype */ if((cmpd_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid,"i1",HOFFSET(struct cmpd_struct,i1),H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i1'\n"); + HDprintf("Can't insert field 'i1'\n"); goto error; } /* end if */ cstr_id = H5Tcopy(H5T_C_S1); if(H5Tset_size(cstr_id,H5T_VARIABLE) < 0) { H5_FAILED(); AT(); - printf("Can't set size for C string\n"); + HDprintf("Can't set size for C string\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid,"c_string",HOFFSET(cmpd_struct,str),cstr_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'str'\n"); + HDprintf("Can't insert field 'str'\n"); goto error; } /* end if */ /* Create vl-string datatype */ if((vlstr_id = H5Tvlen_create(H5T_NATIVE_CHAR)) < 0) { H5_FAILED(); AT(); - printf("Can't create VL string\n"); + HDprintf("Can't create VL string\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid, "vl_string",HOFFSET(cmpd_struct, text), vlstr_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'text'\n"); + HDprintf("Can't insert field 'text'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_tid,"i2",HOFFSET(struct cmpd_struct,i2),H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i2'\n"); + HDprintf("Can't insert field 'i2'\n"); goto error; } /* end if */ /* Create the array datatype for c_string data */ if((arr_tid = H5Tarray_create2(cmpd_tid, 1, arr_dim)) < 0) { H5_FAILED(); AT(); - printf("Can't create array type\n"); + HDprintf("Can't create array type\n"); goto error; } /* end if */ dim1[0] = 1; if((space_id = H5Screate_simple(1,dim1,NULL)) < 0) { H5_FAILED(); AT(); - printf("Can't create space\n"); + HDprintf("Can't create space\n"); goto error; } /* end if */ if((dset_id = H5Dcreate2(file, "Dataset", arr_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create dataset\n"); + HDprintf("Can't create dataset\n"); goto error; } /* end if */ if(H5Dwrite(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) { H5_FAILED(); AT(); - printf("Can't write data\n"); + HDprintf("Can't write data\n"); goto error; } /* end if */ if(H5Dread(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ @@ -2045,13 +2045,13 @@ test_compound_10(void) if(rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 || HDstrcmp(rdata[i].str, wdata[i].str)) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(rdata[i].text.len!=wdata[i].text.len) { H5_FAILED(); AT(); - printf("incorrect VL length\n"); + HDprintf("incorrect VL length\n"); goto error; } /* end if */ @@ -2059,18 +2059,18 @@ test_compound_10(void) t2 = wdata[i].text.p; if(strcmp((char*)t1, (char*)t2)) { H5_FAILED(); AT(); - printf("incorrect VL read data\n"); + HDprintf("incorrect VL read data\n"); goto error; } } /* end for */ if(H5Dvlen_reclaim(arr_tid, space_id, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ if(H5Dvlen_reclaim(arr_tid, space_id, H5P_DEFAULT, &wdata) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ @@ -2096,7 +2096,7 @@ test_compound_10(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_compound_11 * @@ -2181,7 +2181,7 @@ test_compound_11(void) ((big_t *)buf)[u].i1 = (int)(u * 3); ((big_t *)buf)[u].i2 = (int)(u * 5); ((big_t *)buf)[u].s1 = (char *)HDmalloc((size_t)32); - sprintf(((big_t *)buf)[u].s1, "%u", (unsigned)u); + HDsprintf(((big_t *)buf)[u].s1, "%u", (unsigned)u); } /* end for */ /* Make copy of buffer before conversion */ @@ -2190,7 +2190,7 @@ test_compound_11(void) dim[0] = NTESTELEM; if((space_id = H5Screate_simple(1, dim, NULL)) < 0) { H5_FAILED(); AT(); - printf("Can't create space\n"); + HDprintf("Can't create space\n"); goto error; } /* end if */ @@ -2206,29 +2206,29 @@ test_compound_11(void) /* Verify converted buffer is correct */ for(u=0; u<NTESTELEM; u++) { if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) { - printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1); TEST_ERROR } /* end if */ if(((big_t *)buf_orig)[u].i1!=((little_t *)buf)[u].i1) { - printf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].i1,(unsigned)u,((little_t *)buf)[u].i1); TEST_ERROR } /* end if */ if(((big_t *)buf_orig)[u].s1==NULL || ((little_t *)buf)[u].s1==NULL) { - printf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ else if(HDstrcmp(((big_t *)buf_orig)[u].s1,((little_t *)buf)[u].s1)) { - printf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ } /* end for */ if(H5Dvlen_reclaim(little_tid2, space_id, H5P_DEFAULT, buf) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim data\n"); + HDprintf("Can't reclaim data\n"); goto error; } /* end if */ @@ -2250,29 +2250,29 @@ test_compound_11(void) /* Verify converted buffer is correct */ for(u=0; u<NTESTELEM; u++) { if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) { - printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1); TEST_ERROR } /* end if */ if(((big_t *)buf_orig)[u].i1!=((little_t *)buf)[u].i1) { - printf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].i1,(unsigned)u,((little_t *)buf)[u].i1); TEST_ERROR } /* end if */ if(((big_t *)buf_orig)[u].s1==NULL || ((little_t *)buf)[u].s1==NULL) { - printf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ else if(HDstrcmp(((big_t *)buf_orig)[u].s1,((little_t *)buf)[u].s1)) { - printf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ } /* end for */ if(H5Dvlen_reclaim(little_tid, space_id, H5P_DEFAULT, buf) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim data\n"); + HDprintf("Can't reclaim data\n"); goto error; } /* end if */ @@ -2288,29 +2288,29 @@ test_compound_11(void) /* Verify converted buffer is correct */ for(u=0; u<NTESTELEM; u++) { if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) { - printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1); TEST_ERROR } /* end if */ if(((big_t *)buf_orig)[u].i1!=((little_t *)buf)[u].i1) { - printf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].i1,(unsigned)u,((little_t *)buf)[u].i1); TEST_ERROR } /* end if */ if(((big_t *)buf_orig)[u].s1==NULL || ((little_t *)buf)[u].s1==NULL) { - printf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ else if(HDstrcmp(((big_t *)buf_orig)[u].s1,((little_t *)buf)[u].s1)) { - printf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__, + HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__, (unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ } /* end for */ if(H5Dvlen_reclaim(little_tid, space_id, H5P_DEFAULT, buf) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim data\n"); + HDprintf("Can't reclaim data\n"); goto error; } /* end if */ @@ -2339,7 +2339,7 @@ error: return retval; } - + /*------------------------------------------------------------------------- * Function: test_compound_12 * @@ -2381,14 +2381,14 @@ test_compound_12(void) size+=tmp_size; if (H5Tset_size(complex_id, size) < 0) goto error; if (H5Tinsert(complex_id, "real", offset, - H5T_NATIVE_DOUBLE) < 0) goto error; + H5T_NATIVE_DOUBLE) < 0) goto error; offset = size; if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error; size+=tmp_size; if (H5Tset_size(complex_id, size) < 0) goto error; if (H5Tinsert(complex_id, "imaginary", offset, - H5T_NATIVE_DOUBLE) < 0) goto error; + H5T_NATIVE_DOUBLE) < 0) goto error; /* Increase and decrease the size. */ if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error; @@ -2422,7 +2422,7 @@ test_compound_12(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_compound_13 * @@ -2524,7 +2524,7 @@ error: return 1; } /* end test_compound_13() */ - + /*------------------------------------------------------------------------- * Function: test_compound_14 * @@ -2596,230 +2596,230 @@ test_compound_14(void) h5_fixname(FILENAME[3], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create file!\n"); + HDprintf("Can't create file!\n"); goto error; } /* end if */ /* Create memory compound datatype 1 */ if((cmpd_m1_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_1_w))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m1_tid,"c1",HOFFSET(struct cmpd_struct_1_w, c1), H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c1'\n"); + HDprintf("Can't insert field 'c1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m1_tid,"c2",HOFFSET(struct cmpd_struct_1_w, c2), H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c2'\n"); + HDprintf("Can't insert field 'c2'\n"); goto error; } /* end if */ str_id = H5Tcopy(H5T_C_S1); if(H5Tset_size(str_id,H5T_VARIABLE) < 0) { H5_FAILED(); AT(); - printf("Can't set size for VL string\n"); + HDprintf("Can't set size for VL string\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m1_tid, "vl_string", HOFFSET(cmpd_struct_1_w, str), str_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'vl_string'\n"); + HDprintf("Can't insert field 'vl_string'\n"); goto error; } /* end if */ /* Create file compound datatype 1 */ if((cmpd_f1_tid = H5Tcreate( H5T_COMPOUND, 8 + 1 + sizeof(hvl_t))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f1_tid,"c1",(size_t)0,H5T_STD_I64BE) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c1'\n"); + HDprintf("Can't insert field 'c1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f1_tid,"c2",(size_t)8,H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c2'\n"); + HDprintf("Can't insert field 'c2'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f1_tid, "vl_string",(size_t)(8 + 1), str_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'vl_string'\n"); + HDprintf("Can't insert field 'vl_string'\n"); goto error; } /* end if */ /* Create memory compound datatype 2 */ if((cmpd_m2_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_2_w))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid,"c1",HOFFSET(struct cmpd_struct_2_w, c1), H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c1'\n"); + HDprintf("Can't insert field 'c1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid,"c2",HOFFSET(struct cmpd_struct_2_w, c2), H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c2'\n"); + HDprintf("Can't insert field 'c2'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid, "vl_string", HOFFSET(cmpd_struct_2_w, str), str_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'vl_string'\n"); + HDprintf("Can't insert field 'vl_string'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid,"l1",HOFFSET(struct cmpd_struct_2_w, l1), H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l1'\n"); + HDprintf("Can't insert field 'l1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid,"l2",HOFFSET(struct cmpd_struct_2_w, l2), H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l2'\n"); + HDprintf("Can't insert field 'l2'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid,"l3",HOFFSET(struct cmpd_struct_2_w, l3), H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l3'\n"); + HDprintf("Can't insert field 'l3'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m2_tid,"l4",HOFFSET(struct cmpd_struct_2_w, l4), H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l4'\n"); + HDprintf("Can't insert field 'l4'\n"); goto error; } /* end if */ /* Create file compound datatype 2 */ if((cmpd_f2_tid = H5Tcreate( H5T_COMPOUND, 8 + 1 + sizeof(hvl_t) + 4*sizeof(long))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid,"c1",(size_t)0,H5T_STD_I64BE) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c1'\n"); + HDprintf("Can't insert field 'c1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid,"c2",(size_t)8,H5T_NATIVE_CHAR) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'c2'\n"); + HDprintf("Can't insert field 'c2'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid, "vl_string", (size_t)(8 + 1), str_id) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'vl_string'\n"); + HDprintf("Can't insert field 'vl_string'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid,"l1",8 + 1 + sizeof(hvl_t),H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l1'\n"); + HDprintf("Can't insert field 'l1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid,"l2",8 + 1 + sizeof(hvl_t) + sizeof(long),H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l2'\n"); + HDprintf("Can't insert field 'l2'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid,"l3",8 + 1 + sizeof(hvl_t) + 2*sizeof(long),H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l3'\n"); + HDprintf("Can't insert field 'l3'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f2_tid,"l4",8 + 1 + sizeof(hvl_t) + 3*sizeof(long),H5T_NATIVE_LONG) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'l4'\n"); + HDprintf("Can't insert field 'l4'\n"); goto error; } /* end if */ dim1[0] = 1; if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) { H5_FAILED(); AT(); - printf("Can't create space\n"); + HDprintf("Can't create space\n"); goto error; } /* end if */ if((dset1_id = H5Dcreate2(file, "Dataset1", cmpd_f1_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create dataset\n"); + HDprintf("Can't create dataset\n"); goto error; } /* end if */ if((dset2_id = H5Dcreate2(file, "Dataset2", cmpd_f2_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create dataset\n"); + HDprintf("Can't create dataset\n"); goto error; } /* end if */ if(H5Dwrite(dset1_id, cmpd_m1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata1) < 0) { H5_FAILED(); AT(); - printf("Can't write data\n"); + HDprintf("Can't write data\n"); goto error; } /* end if */ if(H5Dwrite(dset2_id, cmpd_m2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2) < 0) { H5_FAILED(); AT(); - printf("Can't write data\n"); + HDprintf("Can't write data\n"); goto error; } /* end if */ if(H5Dread(dset1_id, cmpd_m1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata1) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ if(H5Dread(dset2_id, cmpd_m2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata2) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ if(rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) || rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(H5Dvlen_reclaim(cmpd_m1_tid, space_id, H5P_DEFAULT, &rdata1) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ rdata1.str = NULL; if(H5Dvlen_reclaim(cmpd_m2_tid, space_id, H5P_DEFAULT, &rdata2) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ rdata2.str = NULL; @@ -2841,25 +2841,25 @@ test_compound_14(void) if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("cannot open file\n"); + HDprintf("cannot open file\n"); goto error; } /* end if */ if((dset1_id = H5Dopen2(file, "Dataset1", H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("cannot open dataset\n"); + HDprintf("cannot open dataset\n"); goto error; } /* end if */ if((dset2_id = H5Dopen2(file, "Dataset2", H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("cannot open dataset\n"); + HDprintf("cannot open dataset\n"); goto error; } /* end if */ if((space_id = H5Dget_space(dset2_id)) < 0) { H5_FAILED(); AT(); - printf("Can't get space\n"); + HDprintf("Can't get space\n"); goto error; } /* end if */ @@ -2875,38 +2875,38 @@ test_compound_14(void) if(H5Dread(dset1_id, cmpd_m1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata1) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ if(H5Dread(dset2_id, cmpd_m2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata2) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ if(rdata1.c1!=wdata1.c1 || rdata1.c2!=wdata1.c2 || strcmp(rdata1.str, wdata1.str)) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) || rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ if(H5Dvlen_reclaim(cmpd_m1_tid, space_id, H5P_DEFAULT, &rdata1) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ rdata1.str = NULL; if(H5Dvlen_reclaim(cmpd_m2_tid, space_id, H5P_DEFAULT, &rdata2) < 0) { H5_FAILED(); AT(); - printf("Can't reclaim read data\n"); + HDprintf("Can't reclaim read data\n"); goto error; } /* end if */ rdata2.str = NULL; @@ -2931,7 +2931,7 @@ test_compound_14(void) return 1; } /* end test_compound_14() */ - + /*------------------------------------------------------------------------- * Function: test_compound_15 * @@ -2974,39 +2974,39 @@ test_compound_15(void) h5_fixname(FILENAME[3], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create file!\n"); + HDprintf("Can't create file!\n"); goto error; } /* end if */ /* Create file compound datatype */ if((cmpd_f_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f_tid,"i1",HOFFSET(struct cmpd_struct,i1),H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i1'\n"); + HDprintf("Can't insert field 'i1'\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_f_tid,"i2",HOFFSET(struct cmpd_struct,i2),H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i2'\n"); + HDprintf("Can't insert field 'i2'\n"); goto error; } /* end if */ /* Create memory compound datatype */ if((cmpd_m_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) { H5_FAILED(); AT(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(cmpd_m_tid,"i1",(size_t)0,H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); - printf("Can't insert field 'i1'\n"); + HDprintf("Can't insert field 'i1'\n"); goto error; } /* end if */ @@ -3014,19 +3014,19 @@ test_compound_15(void) dim1[0] = 1; if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) { H5_FAILED(); AT(); - printf("Can't create space\n"); + HDprintf("Can't create space\n"); goto error; } /* end if */ if((dset_id = H5Dcreate2(file, "Dataset", cmpd_f_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); - printf("Can't create dataset\n"); + HDprintf("Can't create dataset\n"); goto error; } /* end if */ if(H5Dwrite(dset_id, cmpd_f_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata1) < 0) { H5_FAILED(); AT(); - printf("Can't write data\n"); + HDprintf("Can't write data\n"); goto error; } /* end if */ @@ -3034,21 +3034,21 @@ test_compound_15(void) * element of wdata2 to be written. */ if(H5Dwrite(dset_id, cmpd_m_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2) < 0) { H5_FAILED(); AT(); - printf("Can't write data\n"); + HDprintf("Can't write data\n"); goto error; } /* end if */ /* Read data */ if(H5Dread(dset_id, cmpd_f_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ /* Check for correctness of read data */ if(rdata.i1 != wdata2[0] || rdata.i2 != wdata1.i2) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ @@ -3060,14 +3060,14 @@ test_compound_15(void) /* Read data */ if(H5Dread(dset_id, cmpd_m_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); - printf("Can't read data\n"); + HDprintf("Can't read data\n"); goto error; } /* end if */ /* Check for correctness of read data */ if(rdata.i1 != wdata2[0] || rdata.i2 != wdata2[1]) { H5_FAILED(); AT(); - printf("incorrect read data\n"); + HDprintf("incorrect read data\n"); goto error; } /* end if */ @@ -3090,7 +3090,7 @@ test_compound_15(void) return 1; } /* end test_compound_15() */ - + /*------------------------------------------------------------------------- * Function: test_compound_16 * @@ -3155,7 +3155,7 @@ test_compound_16(void) /* Check behavior of H5Fget_obj_count */ if((obj_count = H5Fget_obj_count(file, H5F_OBJ_DATATYPE)) != 1) { H5_FAILED(); AT(); - printf(" H5Fget_obj_count returned: %zd; expected: 1\n", obj_count); + HDprintf(" H5Fget_obj_count returned: %zd; expected: 1\n", obj_count); goto error; } @@ -3163,7 +3163,7 @@ test_compound_16(void) if(H5Fget_obj_ids(file, H5F_OBJ_DATATYPE, (size_t)2, open_dtypes) < 0) TEST_ERROR if(open_dtypes[1]) { H5_FAILED(); AT(); - printf(" H5Fget_obj_ids returned as second id: %lld; expected: 0\n", (long long)open_dtypes[1]); + HDprintf(" H5Fget_obj_ids returned as second id: %lld; expected: 0\n", (long long)open_dtypes[1]); goto error; } @@ -3182,7 +3182,7 @@ error: return 1; } /* end test_compound_16() */ - + /*------------------------------------------------------------------------- * Function: test_compound_17 * @@ -3234,7 +3234,7 @@ test_compound_17(void) if(H5Tpack(tmp_dt) < 0) TEST_ERROR if(2 != H5Tget_size(tmp_dt)) { H5_FAILED(); AT(); - printf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt)); + HDprintf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt)); goto error; } if(H5Tclose(tmp_dt) < 0) TEST_ERROR @@ -3244,7 +3244,7 @@ test_compound_17(void) if(H5Tpack(tmp_dt) < 0) TEST_ERROR if(4 != H5Tget_size(tmp_dt)) { H5_FAILED(); AT(); - printf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt)); + HDprintf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt)); goto error; } if(H5Tclose(tmp_dt) < 0) TEST_ERROR @@ -3278,7 +3278,7 @@ test_compound_17(void) if(H5Tpack(tmp_dt) < 0) TEST_ERROR if(2 != H5Tget_size(tmp_dt)) { H5_FAILED(); AT(); - printf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt)); + HDprintf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt)); goto error; } if(H5Tclose(tmp_dt) < 0) TEST_ERROR @@ -3288,7 +3288,7 @@ test_compound_17(void) if(H5Tpack(tmp_dt) < 0) TEST_ERROR if(4 != H5Tget_size(tmp_dt)) { H5_FAILED(); AT(); - printf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt)); + HDprintf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt)); goto error; } if(H5Tclose(tmp_dt) < 0) TEST_ERROR @@ -3305,7 +3305,7 @@ error: return 1; } /* end test_compound_17() */ - + /*------------------------------------------------------------------------- * Function: test_compound_18 * @@ -3371,7 +3371,7 @@ test_compound_18(void) FAIL_PUTS_ERROR("created attribute with bad compound datatype") } /* end if */ - /* Commit the datatype */ + /* Commit the datatype */ H5E_BEGIN_TRY { ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; @@ -3431,7 +3431,7 @@ error: return 1; } /* end test_compound_18() */ - + /*------------------------------------------------------------------------- * Function: test_query * @@ -3476,107 +3476,107 @@ test_query(void) /* Create a compound datatype */ if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) { H5_FAILED(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "a", HOFFSET(struct s1, a), H5T_NATIVE_INT) < 0) { H5_FAILED(); - printf("Can't insert field 'a'\n"); + HDprintf("Can't insert field 'a'\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "b", HOFFSET(struct s1, b), H5T_NATIVE_FLOAT) < 0) { H5_FAILED(); - printf("Can't insert field 'b'\n"); + HDprintf("Can't insert field 'b'\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "c", HOFFSET(struct s1, c), H5T_NATIVE_LONG) < 0) { H5_FAILED(); - printf("Can't insert field 'c'\n"); + HDprintf("Can't insert field 'c'\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "d", HOFFSET(struct s1, d), H5T_NATIVE_DOUBLE) < 0) { H5_FAILED(); - printf("Can't insert field 'd'\n"); + HDprintf("Can't insert field 'd'\n"); goto error; } /* end if */ /* Create a enumerate datatype */ if((tid2=H5Tcreate(H5T_ENUM, sizeof(short))) < 0) { H5_FAILED(); - printf("Can't create enumerate type\n"); + HDprintf("Can't create enumerate type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "RED", (enum_val=10,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "GREEN", (enum_val=11,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "BLUE", (enum_val=12,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "ORANGE", (enum_val=13,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "YELLOW", (enum_val=14,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ /* Query member number and member index by name, for compound type. */ if(H5Tget_nmembers(tid1)!=4) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(tid1, "c")!=2) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ /* Query member number and member index by member name, for enumeration type. */ if(H5Tget_nmembers(tid2) != 5) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(tid2, "ORANGE") != 3) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ /* Commit compound datatype and close it */ if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit compound datatype\n"); + HDprintf("Can't commit compound datatype\n"); goto error; } /* end if */ if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ /* Commit enumeration datatype and close it */ if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit compound datatype\n"); + HDprintf("Can't commit compound datatype\n"); goto error; } /* end if */ if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ @@ -3589,48 +3589,48 @@ test_query(void) /* Query member number and member index by name, for compound type */ if(H5Tget_nmembers(tid1) != 4) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(tid1, "c") != 2) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ /* Query member number and member index by member name, for enumeration type */ if(H5Tget_nmembers(tid2)!=5) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(tid2, "ORANGE")!=3) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ /* Query member value by member name, for enumeration type */ if(H5Tenum_valueof (tid2, "ORANGE", &enum_val) < 0) { H5_FAILED(); - printf("Can't get value for enumerate member\n"); + HDprintf("Can't get value for enumerate member\n"); goto error; } /* end if */ if(enum_val!=13) { H5_FAILED(); - printf("Incorrect value for enum member\n"); + HDprintf("Incorrect value for enum member\n"); goto error; } /* end if */ /* Query member value by member index, for enumeration type */ if(H5Tget_member_value (tid2, 2, &enum_val) < 0) { H5_FAILED(); - printf("Can't get value for enum member\n"); + HDprintf("Can't get value for enum member\n"); goto error; } /* end if */ if(enum_val!=12) { H5_FAILED(); - printf("Incorrect value for enum member\n"); + HDprintf("Incorrect value for enum member\n"); goto error; } /* end if */ @@ -3638,30 +3638,30 @@ test_query(void) enum_val = 14; if(H5Tenum_nameof(tid2, &enum_val, enum_name, (size_t)16) < 0) { H5_FAILED(); - printf("Can't get name for enum member\n"); + HDprintf("Can't get name for enum member\n"); goto error; } /* end if */ if(strcmp("YELLOW", enum_name)) { H5_FAILED(); - printf("Incorrect name for enum member\n"); + HDprintf("Incorrect name for enum member\n"); goto error; } /* end if */ /* Close datatype and file */ if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Fclose(file) < 0) { H5_FAILED(); - printf("Can't close file\n"); + HDprintf("Can't close file\n"); goto error; } /* end if */ @@ -3677,17 +3677,17 @@ test_query(void) return 1; } - + /*------------------------------------------------------------------------- - * Function: test_transient + * Function: test_transient * - * Purpose: Tests transient datatypes. + * Purpose: Tests transient datatypes. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 4, 1998 * * Modifications: @@ -3697,36 +3697,36 @@ test_query(void) static int test_transient (hid_t fapl) { - static hsize_t ds_size[2] = {10, 20}; - hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1; - char filename[1024]; - hid_t ret_id; /* Generic hid_t return value */ - herr_t status; + static hsize_t ds_size[2] = {10, 20}; + hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1; + char filename[1024]; + hid_t ret_id; /* Generic hid_t return value */ + herr_t status; TESTING("transient datatypes"); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { - goto error; + goto error; } if ((space = H5Screate_simple (2, ds_size, ds_size)) < 0) goto error; /* Predefined types cannot be modified or closed */ H5E_BEGIN_TRY { - status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256); + status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - HDputs (" Predefined types should not be modifiable!"); - goto error; + H5_FAILED(); + HDputs (" Predefined types should not be modifiable!"); + goto error; } H5E_BEGIN_TRY { - status = H5Tclose (H5T_NATIVE_INT); + status = H5Tclose (H5T_NATIVE_INT); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - HDputs (" Predefined types should not be closable!"); - goto error; + H5_FAILED(); + HDputs (" Predefined types should not be closable!"); + goto error; } /* Copying a predefined type results in a modifiable copy */ @@ -3735,29 +3735,29 @@ test_transient (hid_t fapl) /* It should not be possible to create an attribute for a transient type */ H5E_BEGIN_TRY { - ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); + ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if (ret_id>=0) { - H5_FAILED(); - HDputs (" Attributes should not be allowed for transient types!"); - goto error; + H5_FAILED(); + HDputs (" Attributes should not be allowed for transient types!"); + goto error; } /* Create a dataset from a transient datatype */ if(H5Tclose(type) < 0) goto error; if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) goto error; if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + goto error; /* The type returned from a dataset should not be modifiable */ if((t2 = H5Dget_type(dset)) < 0) goto error; H5E_BEGIN_TRY { - status = H5Tset_precision(t2, (size_t)256); + status = H5Tset_precision(t2, (size_t)256); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs (" Dataset datatypes should not be modifiable!"); - goto error; + H5_FAILED(); + HDputs (" Dataset datatypes should not be modifiable!"); + goto error; } if(H5Tclose(t2) < 0) goto error; @@ -3769,12 +3769,12 @@ test_transient (hid_t fapl) if((dset = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0) goto error; if((t2 = H5Dget_type(dset)) < 0) goto error; H5E_BEGIN_TRY { - status = H5Tset_precision(t2, (size_t)256); + status = H5Tset_precision(t2, (size_t)256); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs (" Dataset datatypes should not be modifiable!"); - goto error; + H5_FAILED(); + HDputs (" Dataset datatypes should not be modifiable!"); + goto error; } if(H5Tclose(t2) < 0) goto error; @@ -3797,26 +3797,26 @@ test_transient (hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose (t2); - H5Tclose (type); - H5Sclose (space); - H5Dclose (dset); - H5Fclose (file); + H5Tclose (t2); + H5Tclose (type); + H5Sclose (space); + H5Dclose (dset); + H5Fclose (file); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- - * Function: test_named + * Function: test_named * - * Purpose: Tests named datatypes. + * Purpose: Tests named datatypes. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, June 1, 1998 * * Modifications: @@ -3826,29 +3826,29 @@ test_transient (hid_t fapl) static int test_named (hid_t fapl) { - hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1, t3=-1, attr1=-1; - herr_t status; - static hsize_t ds_size[2] = {10, 20}; - size_t i,j; - unsigned attr_data[10][20]; - char filename[1024]; + hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1, t3=-1, attr1=-1; + herr_t status; + static hsize_t ds_size[2] = {10, 20}; + size_t i,j; + unsigned attr_data[10][20]; + char filename[1024]; TESTING("named datatypes"); h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if ((file=H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { - goto error; + goto error; } if ((space = H5Screate_simple (2, ds_size, ds_size)) < 0) goto error; /* Predefined types cannot be committed */ H5E_BEGIN_TRY { - status = H5Tcommit2(file, "test_named_1 (should not exist)", H5T_NATIVE_INT, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Tcommit2(file, "test_named_1 (should not exist)", H5T_NATIVE_INT, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs (" Predefined types should not be committable!"); - goto error; + H5_FAILED(); + HDputs (" Predefined types should not be committable!"); + goto error; } /* Copy a predefined datatype and commit the copy */ @@ -3856,34 +3856,34 @@ test_named (hid_t fapl) if(H5Tcommit2(file, "native-int", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) goto error; if((status = H5Tcommitted(type)) < 0) goto error; if(0 == status) { - H5_FAILED(); - HDputs (" H5Tcommitted() returned false!"); - goto error; + H5_FAILED(); + HDputs (" H5Tcommitted() returned false!"); + goto error; } /* We should not be able to modify a type after it has been committed. */ H5E_BEGIN_TRY { - status = H5Tset_precision (type, (size_t)256); + status = H5Tset_precision (type, (size_t)256); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - HDputs (" Committed type is not constant!"); - goto error; + H5_FAILED(); + HDputs (" Committed type is not constant!"); + goto error; } /* We should not be able to re-commit a committed type */ H5E_BEGIN_TRY { - status = H5Tcommit2(file, "test_named_2 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Tcommit2(file, "test_named_2 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs (" Committed types should not be recommitted!"); - goto error; + H5_FAILED(); + HDputs (" Committed types should not be recommitted!"); + goto error; } /* It should be possible to define an attribute for the named type */ if((attr1 = H5Acreate2(type, "attr1", H5T_NATIVE_UCHAR, space, - H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < (size_t)ds_size[0]; i++) for(j = 0; j < (size_t)ds_size[1]; j++) attr_data[i][j] = (unsigned)(i * ds_size[1] + j); @@ -3897,9 +3897,9 @@ test_named (hid_t fapl) if((t2 = H5Tcopy(type)) < 0) goto error; if((status = H5Tcommitted(t2)) < 0) goto error; if(status) { - H5_FAILED(); - HDputs (" Copying a named type should result in a transient type!"); - goto error; + H5_FAILED(); + HDputs (" Copying a named type should result in a transient type!"); + goto error; } if(H5Tset_precision(t2, (size_t)256) < 0) goto error; if(H5Tclose(t2) < 0) goto error; @@ -3912,22 +3912,22 @@ test_named (hid_t fapl) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) goto error; if(!status) { - H5_FAILED(); - HDputs (" Opened named types should be named types!"); - goto error; + H5_FAILED(); + HDputs (" Opened named types should be named types!"); + goto error; } /* Create a dataset that uses the named type */ if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + goto error; /* Get the dataset's datatype and make sure it's a named type */ if((t2 = H5Dget_type(dset)) < 0) goto error; if((status = H5Tcommitted(t2)) < 0) goto error; if(!status) { - H5_FAILED(); - HDputs (" Dataset type should be a named type!"); - goto error; + H5_FAILED(); + HDputs (" Dataset type should be a named type!"); + goto error; } /* Close the dataset, then close its type, then reopen the dataset */ @@ -3939,9 +3939,9 @@ test_named (hid_t fapl) if((t2 = H5Dget_type(dset)) < 0) goto error; if((status = H5Tcommitted(t2)) < 0) goto error; if(!status) { - H5_FAILED(); - HDputs (" Dataset type should be a named type!"); - goto error; + H5_FAILED(); + HDputs (" Dataset type should be a named type!"); + goto error; } /* @@ -3958,9 +3958,9 @@ test_named (hid_t fapl) if((t2 = H5Dget_type(dset)) < 0) goto error; if((status = H5Tcommitted(t2)) < 0) goto error; if(!status) { - H5_FAILED(); - HDputs (" Dataset type should be a named type!"); - goto error; + H5_FAILED(); + HDputs (" Dataset type should be a named type!"); + goto error; } if(H5Tclose(t2) < 0) goto error; @@ -3979,17 +3979,17 @@ test_named (hid_t fapl) if((t2 = H5Tcopy(type)) < 0) goto error; if((status = H5Tcommitted(t2)) < 0) goto error; if(status) { - H5_FAILED(); - HDputs (" Copied type should not be a named type!"); - goto error; + H5_FAILED(); + HDputs (" Copied type should not be a named type!"); + goto error; } if((dset = H5Dcreate2(file, "dset3", t2, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if((t3 = H5Dget_type(dset)) < 0) goto error; if((status = H5Tcommitted(t3)) < 0) goto error; if(status) { - H5_FAILED(); - HDputs (" Datatype from dataset using copied type should not be a named type!"); - goto error; + H5_FAILED(); + HDputs (" Datatype from dataset using copied type should not be a named type!"); + goto error; } if(H5Tclose(t3) < 0) goto error; if(H5Dclose(dset) < 0) goto error; @@ -4034,26 +4034,26 @@ test_named (hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(t3); - H5Tclose(t2); - H5Tclose(type); - H5Sclose(space); - H5Dclose(dset); - H5Fclose(file); + H5Tclose(t3); + H5Tclose(t2); + H5Tclose(type); + H5Sclose(space); + H5Dclose(dset); + H5Fclose(file); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- - * Function: mkstr + * Function: mkstr * - * Purpose: Create a new string datatype + * Purpose: Create a new string datatype * - * Return: Success: New type - * Failure: -1 + * Return: Success: New type + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 10, 1998 * *------------------------------------------------------------------------- @@ -4061,7 +4061,7 @@ error: static hid_t mkstr(size_t len, H5T_str_t strpad) { - hid_t t; + hid_t t; if((t = H5Tcopy(H5T_C_S1)) < 0) return -1; @@ -4073,16 +4073,16 @@ mkstr(size_t len, H5T_str_t strpad) return t; } - + /*------------------------------------------------------------------------- - * Function: test_str_create + * Function: test_str_create * - * Purpose: Test string type creation using H5Tcreate + * Purpose: Test string type creation using H5Tcreate * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 19 May 2011 * *------------------------------------------------------------------------- @@ -4123,10 +4123,10 @@ test_str_create(void) if(!H5Tequal(vlen_str1, vlen_str2)) goto error; if((is_vl_str = H5Tis_variable_str(vlen_str1)) < 0) goto error; - if(!is_vl_str) goto error; + if(!is_vl_str) goto error; if((is_vl_str = H5Tis_variable_str(vlen_str2)) < 0) goto error; - if(!is_vl_str) goto error; + if(!is_vl_str) goto error; if(H5Tclose(vlen_str1) < 0) goto error; if(H5Tclose(vlen_str2) < 0) goto error; @@ -4139,16 +4139,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_conv_str_1 + * Function: test_conv_str_1 * - * Purpose: Test string conversions + * Purpose: Test string conversions * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 10, 1998 * *------------------------------------------------------------------------- @@ -4156,8 +4156,8 @@ error: static int test_conv_str_1(void) { - char *buf = NULL; - hid_t src_type = -1; + char *buf = NULL; + hid_t src_type = -1; hid_t dst_type = -1; TESTING("string conversions"); @@ -4172,15 +4172,15 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Truncated C-string test failed"); - goto error; + H5_FAILED(); + HDputs(" Truncated C-string test failed"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Extended C-string test failed"); - goto error; + H5_FAILED(); + HDputs(" Extended C-string test failed"); + goto error; } HDfree(buf); buf = NULL; @@ -4196,15 +4196,15 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) { - H5_FAILED(); - HDputs(" Truncated C buffer test failed"); - goto error; + H5_FAILED(); + HDputs(" Truncated C buffer test failed"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Extended C buffer test failed"); - goto error; + H5_FAILED(); + HDputs(" Extended C buffer test failed"); + goto error; } HDfree(buf); buf = NULL; @@ -4220,15 +4220,15 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) { - H5_FAILED(); - HDputs(" Truncated Fortran-string test failed"); - goto error; + H5_FAILED(); + HDputs(" Truncated Fortran-string test failed"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcde abcde ", (size_t)20)) { - H5_FAILED(); - HDputs(" Extended Fortran-string test failed"); - goto error; + H5_FAILED(); + HDputs(" Extended Fortran-string test failed"); + goto error; } HDfree(buf); buf = NULL; @@ -4247,25 +4247,25 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { - H5_FAILED(); - HDputs(" Non-terminated string test 1"); - goto error; + H5_FAILED(); + HDputs(" Non-terminated string test 1"); + goto error; } H5Tclose(dst_type); if((dst_type = mkstr((size_t)5, H5T_STR_NULLTERM)) < 0) goto error; HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20)) { - H5_FAILED(); - HDputs(" Non-terminated string test 2"); - goto error; + H5_FAILED(); + HDputs(" Non-terminated string test 2"); + goto error; } HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", (size_t)20); if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Non-terminated string test 2"); - goto error; + H5_FAILED(); + HDputs(" Non-terminated string test 2"); + goto error; } HDfree(buf); buf = NULL; @@ -4281,30 +4281,30 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20)) { - H5_FAILED(); - HDputs(" C string to Fortran test 1"); - goto error; + H5_FAILED(); + HDputs(" C string to Fortran test 1"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Fortran to C string test 1"); - goto error; + H5_FAILED(); + HDputs(" Fortran to C string test 1"); + goto error; } if (H5Tclose(dst_type) < 0) goto error; if((dst_type = mkstr((size_t)5, H5T_STR_SPACEPAD)) < 0) goto error; HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" C string to Fortran test 2"); - goto error; + H5_FAILED(); + HDputs(" C string to Fortran test 2"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Fortran to C string test 2"); - goto error; + H5_FAILED(); + HDputs(" Fortran to C string test 2"); + goto error; } if (H5Tclose(src_type) < 0) goto error; if (H5Tclose(dst_type) < 0) goto error; @@ -4313,15 +4313,15 @@ test_conv_str_1(void) HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) { - H5_FAILED(); - HDputs(" C string to Fortran test 3"); - goto error; + H5_FAILED(); + HDputs(" C string to Fortran test 3"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) { - H5_FAILED(); - HDputs(" Fortran to C string test 3"); - goto error; + H5_FAILED(); + HDputs(" Fortran to C string test 3"); + goto error; } HDfree(buf); buf = NULL; @@ -4337,30 +4337,30 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { - H5_FAILED(); - HDputs(" C buffer to Fortran test 1"); - goto error; + H5_FAILED(); + HDputs(" C buffer to Fortran test 1"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { - H5_FAILED(); - HDputs(" Fortran to C buffer test 1"); - goto error; + H5_FAILED(); + HDputs(" Fortran to C buffer test 1"); + goto error; } if (H5Tclose(dst_type) < 0) goto error; if((dst_type = mkstr((size_t)5, H5T_STR_SPACEPAD)) < 0) goto error; HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" C buffer to Fortran test 2"); - goto error; + H5_FAILED(); + HDputs(" C buffer to Fortran test 2"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { - H5_FAILED(); - HDputs(" Fortran to C buffer test 2"); - goto error; + H5_FAILED(); + HDputs(" Fortran to C buffer test 2"); + goto error; } if (H5Tclose(src_type) < 0) goto error; if (H5Tclose(dst_type) < 0) goto error; @@ -4369,15 +4369,15 @@ test_conv_str_1(void) HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) { - H5_FAILED(); - HDputs(" C buffer to Fortran test 3"); - goto error; + H5_FAILED(); + HDputs(" C buffer to Fortran test 3"); + goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) { - H5_FAILED(); - HDputs(" Fortran to C buffer test 3"); - goto error; + H5_FAILED(); + HDputs(" Fortran to C buffer test 3"); + goto error; } if(H5Tclose(src_type) < 0) goto error; if(H5Tclose(dst_type) < 0) goto error; @@ -4393,7 +4393,7 @@ test_conv_str_1(void) error: H5E_BEGIN_TRY { - H5Tclose(src_type); + H5Tclose(src_type); H5Tclose(dst_type); } H5E_END_TRY; @@ -4408,16 +4408,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_conv_str_2 + * Function: test_conv_str_2 * - * Purpose: Tests C-to-Fortran and Fortran-to-C string conversion speed. + * Purpose: Tests C-to-Fortran and Fortran-to-C string conversion speed. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 10, 1998 * *------------------------------------------------------------------------- @@ -4425,12 +4425,12 @@ error: static int test_conv_str_2(void) { - char *buf = NULL, s[80]; - hid_t c_type = -1; - hid_t f_type = -1; - const size_t nelmts = NTESTELEM; - size_t i, j, nchars; - int ret_value = 1; + char *buf = NULL, s[80]; + hid_t c_type = -1; + hid_t f_type = -1; + const size_t nelmts = NTESTELEM; + size_t i, j, nchars; + int ret_value = 1; /* * Initialize types and buffer. @@ -4439,16 +4439,16 @@ test_conv_str_2(void) if((f_type = mkstr((size_t)8, H5T_STR_SPACEPAD)) < 0) goto error; if(NULL == (buf = (char*)HDcalloc(nelmts, (size_t)8))) goto error; for(i = 0; i < nelmts; i++) { - nchars = (size_t)(HDrand() % 8); - for(j = 0; j < nchars; j++) - buf[i * 8 + j] = (char)('a' + HDrand() % 26); - while(j < nchars) + nchars = (size_t)(HDrand() % 8); + for(j = 0; j < nchars; j++) + buf[i * 8 + j] = (char)('a' + HDrand() % 26); + while(j < nchars) buf[i * 8 + j++] = '\0'; } /* end for */ /* Do the conversions */ - sprintf(s, "Testing random string conversion speed"); - printf("%-70s", s); + HDsprintf(s, "Testing random string conversion speed"); + HDprintf("%-70s", s); HDfflush(stdout); if(H5Tconvert(c_type, f_type, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error; @@ -4475,17 +4475,17 @@ error: return ret_value; } - + /*------------------------------------------------------------------------- - * Function: test_conv_str_3 + * Function: test_conv_str_3 * - * Purpose: Tests some functions that are or aren't supposed to work + * Purpose: Tests some functions that are or aren't supposed to work * for string type. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, April 4, 2006 * *------------------------------------------------------------------------- @@ -4493,12 +4493,12 @@ error: static int test_conv_str_3(void) { - char *buf=NULL; - hid_t type = -1; - hid_t super = -1; - const size_t nelmts = NTESTELEM; - size_t i, j, nchars; - int ret_value = 1; + char *buf=NULL; + hid_t type = -1; + hid_t super = -1; + const size_t nelmts = NTESTELEM; + size_t i, j, nchars; + int ret_value = 1; size_t size; H5T_pad_t inpad; H5T_sign_t sign; @@ -4514,10 +4514,10 @@ test_conv_str_3(void) if(NULL == (buf = (char*)HDcalloc(nelmts, (size_t)8))) FAIL_PUTS_ERROR("Allocation failed."); for(i = 0; i < nelmts; i++) { - nchars = (size_t)(HDrand() % 8); - for(j = 0; j < nchars; j++) - buf[i * 8 + j] = (char)('a' + HDrand() % 26); - while(j < nchars) + nchars = (size_t)(HDrand() % 8); + for(j = 0; j < nchars; j++) + buf[i * 8 + j] = (char)('a' + HDrand() % 26); + while(j < nchars) buf[i * 8 + j++] = '\0'; } /* end for */ @@ -4580,7 +4580,7 @@ error: H5Tclose(super); } H5E_END_TRY; - if(buf) + if(buf) HDfree(buf); if(tag) H5free_memory(tag); /* Technically allocated by API call */ @@ -4593,17 +4593,17 @@ error: return ret_value; /* Number of errors */ } - + /*------------------------------------------------------------------------- - * Function: test_conv_enum_1 + * Function: test_conv_enum_1 * - * Purpose: Test conversion speed for enum datatypes + * Purpose: Test conversion speed for enum datatypes * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, January 5, 1999 * * Modifications: @@ -4614,11 +4614,11 @@ static int test_conv_enum_1(void) { const size_t nelmts=NTESTELEM; - int i, val, *buf=NULL; - hid_t t1 = -1; - hid_t t2 = -1; - char s[80]; - int ret_value = 1; + int i, val, *buf=NULL; + hid_t t1 = -1; + hid_t t2 = -1; + char s[80]; + int ret_value = 1; size_t u; /* Build the datatypes */ @@ -4626,9 +4626,9 @@ test_conv_enum_1(void) if((t2 = H5Tenum_create(H5T_NATIVE_INT)) < 0) goto error; s[1] = '\0'; for(i = 0; i < 26; i++) { - s[0] = (char)('A' + i); - H5Tenum_insert(t1, s, &i); - H5Tenum_insert(t2, s, (val = i * 1000 + i, &val)); + s[0] = (char)('A' + i); + H5Tenum_insert(t1, s, &i); + H5Tenum_insert(t2, s, (val = i * 1000 + i, &val)); } /* end for */ /* Initialize the buffer */ @@ -4638,14 +4638,14 @@ test_conv_enum_1(void) buf[u] = HDrand() % 26; /* Conversions */ - sprintf(s, "Testing random enum conversion O(N)"); - printf("%-70s", s); + HDsprintf(s, "Testing random enum conversion O(N)"); + HDprintf("%-70s", s); HDfflush(stdout); if(H5Tconvert(t1, t2, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error; PASSED(); - sprintf(s, "Testing random enum conversion O(N log N)"); - printf("%-70s", s); + HDsprintf(s, "Testing random enum conversion O(N log N)"); + HDprintf("%-70s", s); HDfflush(stdout); if(H5Tconvert(t2, t1, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error; PASSED(); @@ -4669,7 +4669,7 @@ error: return ret_value; } - + /*------------------------------------------------------------------------- * Function: test_conv_enum_2 * @@ -4695,7 +4695,7 @@ test_conv_enum_2(void) "PURPLE", "ORANGE", "WHITE" }; - + TESTING("non-native enumeration type conversion"); /* Source enum type */ @@ -4731,7 +4731,7 @@ test_conv_enum_2(void) if (data[i] != i%8) { if (!nerrors++) { H5_FAILED(); - printf("element %d is %d but should have been %d\n", + HDprintf("element %d is %d but should have been %d\n", i, data[i], i%8); } } @@ -4745,7 +4745,7 @@ test_conv_enum_2(void) /* Failure */ if (nerrors) { - printf("total of %d conversion errors out of %d elements for enums\n", + HDprintf("total of %d conversion errors out of %d elements for enums\n", nerrors, NTESTELEM); return 1; } @@ -4754,17 +4754,17 @@ test_conv_enum_2(void) return 0; } - + /*------------------------------------------------------------------------- - * Function: test_conv_bitfield + * Function: test_conv_bitfield * - * Purpose: Test bitfield conversions. + * Purpose: Test bitfield conversions. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 20, 1999 * * Modifications: @@ -4774,8 +4774,8 @@ test_conv_enum_2(void) static int test_conv_bitfield(void) { - unsigned char buf[4]; - hid_t st=-1, dt=-1; + unsigned char buf[4]; + hid_t st=-1, dt=-1; TESTING("bitfield conversions"); @@ -4790,10 +4790,10 @@ test_conv_bitfield(void) buf[2] = buf[3] = 0x55; /*irrelevant*/ if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0xAA || buf[1]!=0xAA || buf[2]!=0 || buf[3]!=0) { - H5_FAILED(); - printf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + printf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", + buf[3], buf[2], buf[1], buf[0]); + goto error; } /* @@ -4809,10 +4809,10 @@ test_conv_bitfield(void) buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0; if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0 || buf[1]!=0xA8 || buf[2]!=0x2A || buf[3]!=0) { - H5_FAILED(); - printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", + buf[3], buf[2], buf[1], buf[0]); + goto error; } /* @@ -4823,10 +4823,10 @@ test_conv_bitfield(void) buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0; if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0xff || buf[1]!=0xAB || buf[2]!=0xEA || buf[3]!=0xff) { - H5_FAILED(); - printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", + buf[3], buf[2], buf[1], buf[0]); + goto error; } H5Tclose(st); @@ -4851,18 +4851,18 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_bitfield_funcs + * Function: test_bitfield_funcs * - * Purpose: Test some datatype functions that are and aren't supposed + * Purpose: Test some datatype functions that are and aren't supposed * work for bitfield type. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 5, 2006 * * Modifications: @@ -4872,7 +4872,7 @@ error: static int test_bitfield_funcs(void) { - hid_t type=-1, ntype=-1, super=-1; + hid_t type=-1, ntype=-1, super=-1; size_t size; char* tag=0; H5T_pad_t inpad; @@ -4905,7 +4905,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if (size>0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4914,7 +4914,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if (inpad>-1) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4923,7 +4923,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if (cset>-1) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4932,7 +4932,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if (strpad>-1) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4941,7 +4941,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if(ret>=0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4950,7 +4950,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if (tag) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4959,7 +4959,7 @@ test_bitfield_funcs(void) } H5E_END_TRY; if (super>=0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -4980,17 +4980,17 @@ error: return retval; } - + /*------------------------------------------------------------------------- - * Function: convert_opaque + * Function: convert_opaque * - * Purpose: A fake opaque conversion functions + * Purpose: A fake opaque conversion functions * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, June 4, 1999 * * Modifications: @@ -4999,25 +4999,25 @@ error: */ static herr_t convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cdata, - size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, + size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *_buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid) + void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid) { if (H5T_CONV_CONV==cdata->command) num_opaque_conversions_g++; return 0; } - + /*------------------------------------------------------------------------- - * Function: test_opaque + * Function: test_opaque * - * Purpose: Driver function to test opaque datatypes + * Purpose: Driver function to test opaque datatypes * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * June 2, 2004 * * Modifications: @@ -5050,17 +5050,17 @@ test_opaque(void) return num_errors; } - + /*------------------------------------------------------------------------- - * Function: opaque_check + * Function: opaque_check * - * Purpose: Test opaque datatypes + * Purpose: Test opaque datatypes * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 20, 1999 * *------------------------------------------------------------------------- @@ -5069,10 +5069,10 @@ static int opaque_check(int tag_it) { #define OPAQUE_NELMTS 1000 - hid_t st=-1, dt=-1; - herr_t status; - char buf[1]; /*not really used*/ - int saved; + hid_t st=-1, dt=-1; + herr_t status; + char buf[1]; /*not really used*/ + int saved; saved = num_opaque_conversions_g = 0; @@ -5088,29 +5088,29 @@ opaque_check(int tag_it) /* Make sure that we can't convert between the types yet */ H5E_BEGIN_TRY { - status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); + status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - printf(" opaque conversion should have failed but succeeded\n"); - goto error; + H5_FAILED(); + printf(" opaque conversion should have failed but succeeded\n"); + goto error; } /* Register a conversion function */ if (H5Tregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0) - goto error; + goto error; /* Try the conversion again, this time it should work */ if (H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT) < 0) goto error; if (saved+1 != num_opaque_conversions_g) { - H5_FAILED(); - printf(" unexpected number of opaque conversions\n"); - goto error; + H5_FAILED(); + printf(" unexpected number of opaque conversions\n"); + goto error; } /* Unregister conversion function */ if (H5Tunregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0) - goto error; + goto error; H5Tclose(st); H5Tclose(dt); @@ -5123,16 +5123,16 @@ opaque_check(int tag_it) return 1; } - + /*------------------------------------------------------------------------- - * Function: opaque_long + * Function: opaque_long * - * Purpose: Test named (committed) opaque datatypes w/very long tags + * Purpose: Test named (committed) opaque datatypes w/very long tags * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 14, 2005 * *------------------------------------------------------------------------- @@ -5140,8 +5140,8 @@ opaque_check(int tag_it) static int opaque_long(void) { - char *long_tag = NULL; - hid_t dt = -1; + char *long_tag = NULL; + hid_t dt = -1; herr_t ret; /* Build opaque type */ @@ -5154,7 +5154,7 @@ opaque_long(void) /* Set opaque type's tag */ H5E_BEGIN_TRY { - ret = H5Tset_tag(dt, long_tag); + ret = H5Tset_tag(dt, long_tag); } H5E_END_TRY; if(ret != FAIL) TEST_ERROR @@ -5175,18 +5175,18 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: opaque_funcs + * Function: opaque_funcs * - * Purpose: Test some type functions that are and aren't supposed to + * Purpose: Test some type functions that are and aren't supposed to * work with opaque type. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 5, 2006 * * Modifications: @@ -5196,7 +5196,7 @@ error: static int opaque_funcs(void) { - hid_t type = -1, super=-1; + hid_t type = -1, super=-1; size_t size; H5T_pad_t inpad; H5T_cset_t cset; @@ -5214,7 +5214,7 @@ opaque_funcs(void) ret=H5Tset_precision(type, (size_t)32); } H5E_END_TRY; if (ret>=0) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5222,7 +5222,7 @@ opaque_funcs(void) ret=H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE); } H5E_END_TRY; if (ret>=0) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5230,7 +5230,7 @@ opaque_funcs(void) size=H5Tget_ebias(type); } H5E_END_TRY; if (size>0) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5238,7 +5238,7 @@ opaque_funcs(void) inpad=H5Tget_inpad(type); } H5E_END_TRY; if (inpad>-1) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5246,7 +5246,7 @@ opaque_funcs(void) cset=H5Tget_cset(type); } H5E_END_TRY; if (cset>-1) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5254,7 +5254,7 @@ opaque_funcs(void) strpad=H5Tget_strpad(type); } H5E_END_TRY; if (strpad>-1) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5262,7 +5262,7 @@ opaque_funcs(void) ret=H5Tset_offset(type, (size_t)16); } H5E_END_TRY; if (ret>=0) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5270,7 +5270,7 @@ opaque_funcs(void) sign = H5Tget_sign(type); } H5E_END_TRY; if (sign>-1) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5278,7 +5278,7 @@ opaque_funcs(void) super = H5Tget_super(type); } H5E_END_TRY; if (super>=0) { - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); TEST_ERROR } /* end if */ @@ -5291,7 +5291,7 @@ opaque_funcs(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_encode * @@ -5332,7 +5332,7 @@ test_encode(void) size_t enum_buf_size = 0; size_t vlstr_buf_size = 0; unsigned char *cmpd_buf=NULL, *enum_buf=NULL, *vlstr_buf=NULL; - hid_t ret_id; + hid_t ret_id; herr_t ret; TESTING("functions of encoding and decoding datatypes"); @@ -5349,71 +5349,71 @@ test_encode(void) /* Create a compound datatype */ if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) { H5_FAILED(); - printf("Can't create datatype!\n"); + HDprintf("Can't create datatype!\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "a", HOFFSET(struct s1, a), H5T_NATIVE_INT) < 0) { H5_FAILED(); - printf("Can't insert field 'a'\n"); + HDprintf("Can't insert field 'a'\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "b", HOFFSET(struct s1, b), H5T_NATIVE_FLOAT) < 0) { H5_FAILED(); - printf("Can't insert field 'b'\n"); + HDprintf("Can't insert field 'b'\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "c", HOFFSET(struct s1, c), H5T_NATIVE_LONG) < 0) { H5_FAILED(); - printf("Can't insert field 'c'\n"); + HDprintf("Can't insert field 'c'\n"); goto error; } /* end if */ if(H5Tinsert(tid1, "d", HOFFSET(struct s1, d), H5T_NATIVE_DOUBLE) < 0) { H5_FAILED(); - printf("Can't insert field 'd'\n"); + HDprintf("Can't insert field 'd'\n"); goto error; } /* end if */ /* Create a enumerate datatype */ if((tid2=H5Tcreate(H5T_ENUM, sizeof(short))) < 0) { H5_FAILED(); - printf("Can't create enumerate type\n"); + HDprintf("Can't create enumerate type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "RED", (enum_val=0,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "GREEN", (enum_val=1,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "BLUE", (enum_val=2,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "ORANGE", (enum_val=3,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ if(H5Tenum_insert(tid2, "YELLOW", (enum_val=4,&enum_val)) < 0) { H5_FAILED(); - printf("Can't insert field into enumeration type\n"); + HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ /* Create a variable-length string type */ if((tid3 = H5Tcopy(H5T_C_S1)) < 0) { H5_FAILED(); - printf("Can't copy a string type\n"); + HDprintf("Can't copy a string type\n"); goto error; } /* end if */ if(H5Tset_size(tid3, H5T_VARIABLE) < 0) { H5_FAILED(); - printf("Can't the string type to be variable-length\n"); + HDprintf("Can't the string type to be variable-length\n"); goto error; } /* end if */ @@ -5424,7 +5424,7 @@ test_encode(void) /* Encode compound type in a buffer */ if(H5Tencode(tid1, NULL, &cmpd_buf_size) < 0) { H5_FAILED(); - printf("Can't encode compound type\n"); + HDprintf("Can't encode compound type\n"); goto error; } /* end if */ @@ -5433,17 +5433,17 @@ test_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret_id = H5Tdecode(cmpd_buf); + ret_id = H5Tdecode(cmpd_buf); } H5E_END_TRY; if(ret_id!=FAIL) { H5_FAILED(); - printf("Decoded bogus buffer!\n"); + HDprintf("Decoded bogus buffer!\n"); goto error; } if(H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) { H5_FAILED(); - printf("Can't encode compound type\n"); + HDprintf("Can't encode compound type\n"); goto error; } /* end if */ @@ -5454,19 +5454,19 @@ test_encode(void) /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid1, tid1)<=0) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ /* Query member number and member index by name, for compound type. */ if(H5Tget_nmembers(decoded_tid1)!=4) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(decoded_tid1, "c")!=2) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ @@ -5474,7 +5474,7 @@ test_encode(void) /* Encode enumerate type in a buffer */ if(H5Tencode(tid2, NULL, &enum_buf_size) < 0) { H5_FAILED(); - printf("Can't encode enumerate type\n"); + HDprintf("Can't encode enumerate type\n"); goto error; } /* end if */ @@ -5483,33 +5483,33 @@ test_encode(void) if(H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) { H5_FAILED(); - printf("Can't encode enumerate type\n"); + HDprintf("Can't encode enumerate type\n"); goto error; } /* end if */ /* Decode from the enumerate buffer and return an object handle */ if((decoded_tid2=H5Tdecode(enum_buf)) < 0) { H5_FAILED(); - printf("Can't decode enumerate type\n"); + HDprintf("Can't decode enumerate type\n"); goto error; } /* end if */ /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid2, tid2)<=0) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ /* Query member number and member index by name, for enumeration type. */ if(H5Tget_nmembers(decoded_tid2)!=5) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(decoded_tid2, "ORANGE") != 3) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ @@ -5517,7 +5517,7 @@ test_encode(void) /* Encode VL string type in a buffer */ if(H5Tencode(tid3, NULL, &vlstr_buf_size) < 0) { H5_FAILED(); - printf("Can't encode VL string type\n"); + HDprintf("Can't encode VL string type\n"); goto error; } /* end if */ @@ -5526,26 +5526,26 @@ test_encode(void) if(H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) { H5_FAILED(); - printf("Can't encode VL string type\n"); + HDprintf("Can't encode VL string type\n"); goto error; } /* end if */ /* Decode from the VL string buffer and return an object handle */ if((decoded_tid3=H5Tdecode(vlstr_buf)) < 0) { H5_FAILED(); - printf("Can't decode VL string type\n"); + HDprintf("Can't decode VL string type\n"); goto error; } /* end if */ /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid3, tid3)<=0) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ if(!H5Tis_variable_str(decoded_tid3)) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ @@ -5556,17 +5556,17 @@ test_encode(void) /* Commit compound datatype and close it */ if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit compound datatype\n"); + HDprintf("Can't commit compound datatype\n"); goto error; } /* end if */ if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Tclose(decoded_tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ HDfree(cmpd_buf); @@ -5575,17 +5575,17 @@ test_encode(void) /* Commit enumeration datatype and close it */ if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit compound datatype\n"); + HDprintf("Can't commit compound datatype\n"); goto error; } /* end if */ if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Tclose(decoded_tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ HDfree(enum_buf); @@ -5594,17 +5594,17 @@ test_encode(void) /* Commit enumeration datatype and close it */ if(H5Tcommit2(file, vlstr_type, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit vl string datatype\n"); + HDprintf("Can't commit vl string datatype\n"); goto error; } /* end if */ if(H5Tclose(tid3) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Tclose(decoded_tid3) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ HDfree(vlstr_buf); @@ -5625,7 +5625,7 @@ test_encode(void) /* Encode compound type in a buffer */ if(H5Tencode(tid1, NULL, &cmpd_buf_size) < 0) { H5_FAILED(); - printf("Can't encode compound type\n"); + HDprintf("Can't encode compound type\n"); goto error; } /* end if */ @@ -5634,7 +5634,7 @@ test_encode(void) if(H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) { H5_FAILED(); - printf("Can't encode compound type\n"); + HDprintf("Can't encode compound type\n"); goto error; } /* end if */ @@ -5645,26 +5645,26 @@ test_encode(void) /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid1, tid1)<=0) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ /* Query member number and member index by name, for compound type. */ if(H5Tget_nmembers(decoded_tid1)!=4) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(decoded_tid1, "c")!=2) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ /* Encode enumerate type in a buffer */ if(H5Tencode(tid2, NULL, &enum_buf_size) < 0) { H5_FAILED(); - printf("Can't encode enumerate type\n"); + HDprintf("Can't encode enumerate type\n"); goto error; } /* end if */ @@ -5673,40 +5673,40 @@ test_encode(void) if(H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) { H5_FAILED(); - printf("Can't encode enumerate type\n"); + HDprintf("Can't encode enumerate type\n"); goto error; } /* end if */ /* Decode from the enumerate buffer and return an object handle */ if((decoded_tid2=H5Tdecode(enum_buf)) < 0) { H5_FAILED(); - printf("Can't decode enumerate type\n"); + HDprintf("Can't decode enumerate type\n"); goto error; } /* end if */ /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid2, tid2)<=0) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ /* Query member number and member index by name, for enumeration type. */ if(H5Tget_nmembers(decoded_tid2)!=5) { H5_FAILED(); - printf("Can't get member number\n"); + HDprintf("Can't get member number\n"); goto error; } /* end if */ if(H5Tget_member_index(decoded_tid2, "ORANGE")!=3) { H5_FAILED(); - printf("Can't get correct index number\n"); + HDprintf("Can't get correct index number\n"); goto error; } /* end if */ /* Encode VL string type in a buffer */ if(H5Tencode(tid3, NULL, &vlstr_buf_size) < 0) { H5_FAILED(); - printf("Can't encode VL string type\n"); + HDprintf("Can't encode VL string type\n"); goto error; } /* end if */ @@ -5715,14 +5715,14 @@ test_encode(void) if(H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) { H5_FAILED(); - printf("Can't encode VL string type\n"); + HDprintf("Can't encode VL string type\n"); goto error; } /* end if */ /* Decode from the VL string buffer and return an object handle */ if((decoded_tid3=H5Tdecode(vlstr_buf)) < 0) { H5_FAILED(); - printf("Can't decode VL string type\n"); + HDprintf("Can't decode VL string type\n"); goto error; } /* end if */ HDfree(vlstr_buf); @@ -5730,12 +5730,12 @@ test_encode(void) /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid3, tid3)<=0) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ if(!H5Tis_variable_str(decoded_tid3)) { H5_FAILED(); - printf("Datatype wasn't encoded & decoded identically\n"); + HDprintf("Datatype wasn't encoded & decoded identically\n"); goto error; } /* end if */ @@ -5745,69 +5745,69 @@ test_encode(void) */ /* Make sure the reference counts for the decoded datatypes are one. */ - if(H5Iget_ref(decoded_tid1) != 1) { + if(H5Iget_ref(decoded_tid1) != 1) { H5_FAILED(); - printf("Decoded datatype has incorrect reference count\n"); + HDprintf("Decoded datatype has incorrect reference count\n"); goto error; } /* end if */ - if(H5Iget_ref(decoded_tid2) != 1) { + if(H5Iget_ref(decoded_tid2) != 1) { H5_FAILED(); - printf("Decoded datatype has incorrect reference count\n"); + HDprintf("Decoded datatype has incorrect reference count\n"); goto error; } /* end if */ - if(H5Iget_ref(decoded_tid3) != 1) { + if(H5Iget_ref(decoded_tid3) != 1) { H5_FAILED(); - printf("Decoded datatype has incorrect reference count\n"); + HDprintf("Decoded datatype has incorrect reference count\n"); goto error; } /* end if */ - /* Make sure the reference counts for the decoded datatypes can be + /* Make sure the reference counts for the decoded datatypes can be * decremented and the datatypes are closed. */ - if(H5Idec_ref(decoded_tid1) != 0) { + if(H5Idec_ref(decoded_tid1) != 0) { H5_FAILED(); - printf("Decoded datatype can't close\n"); + HDprintf("Decoded datatype can't close\n"); goto error; } /* end if */ - if(H5Idec_ref(decoded_tid2) != 0) { + if(H5Idec_ref(decoded_tid2) != 0) { H5_FAILED(); - printf("Decoded datatype can't close\n"); + HDprintf("Decoded datatype can't close\n"); goto error; } /* end if */ - if(H5Idec_ref(decoded_tid3) != 0) { + if(H5Idec_ref(decoded_tid3) != 0) { H5_FAILED(); - printf("Decoded datatype can't close\n"); + HDprintf("Decoded datatype can't close\n"); goto error; } /* end if */ /* Make sure the decoded datatypes are already closed. */ H5E_BEGIN_TRY { - ret = H5Tclose(decoded_tid1); + ret = H5Tclose(decoded_tid1); } H5E_END_TRY; if(ret!=FAIL) { H5_FAILED(); - printf("Decoded datatype should have been closed\n"); + HDprintf("Decoded datatype should have been closed\n"); goto error; } H5E_BEGIN_TRY { - ret = H5Tclose(decoded_tid2); + ret = H5Tclose(decoded_tid2); } H5E_END_TRY; if(ret!=FAIL) { H5_FAILED(); - printf("Decoded datatype should have been closed\n"); + HDprintf("Decoded datatype should have been closed\n"); goto error; } H5E_BEGIN_TRY { - ret = H5Tclose(decoded_tid3); + ret = H5Tclose(decoded_tid3); } H5E_END_TRY; if(ret!=FAIL) { H5_FAILED(); - printf("Decoded datatype should have been closed\n"); + HDprintf("Decoded datatype should have been closed\n"); goto error; } @@ -5818,23 +5818,23 @@ test_encode(void) /* Close datatype and file */ if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Tclose(tid3) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } /* end if */ if(H5Fclose(file) < 0) { H5_FAILED(); - printf("Can't close file\n"); + HDprintf("Can't close file\n"); goto error; } /* end if */ @@ -5857,7 +5857,7 @@ test_encode(void) return 1; } - + /*------------------------------------------------------------------------- * Function: test_latest * @@ -5884,7 +5884,7 @@ test_latest(void) hid_t file = (-1); /* File ID */ hid_t tid1 = (-1), tid2 = (-1); /* Datatype ID */ hid_t fapl = (-1); /* File access property list */ - H5O_info_t oi; /* Stat buffer for committed datatype */ + H5O_info_t oi; /* Stat buffer for committed datatype */ hsize_t old_dtype_oh_size; /* Size of object header with "old" format */ hsize_t new_dtype_oh_size; /* Size of object header with "new" format */ char filename[1024]; /* Buffer for filename */ @@ -6075,7 +6075,7 @@ conv_except(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 return(H5T_CONV_UNHANDLED); } - + /*------------------------------------------------------------------------- * Function: test_int_float_except * @@ -6218,7 +6218,7 @@ error: #endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ } /* end test_int_float_except() */ - + /*------------------------------------------------------------------------- * Function: test_set_order * @@ -6379,11 +6379,11 @@ error: return 1; } /* end test_set_order() */ - + /*------------------------------------------------------------------------- * Function: test_set_order_compound * - * Purpose: Tests H5Tset_order/H5Tget_order for complicated compound + * Purpose: Tests H5Tset_order/H5Tget_order for complicated compound * type. * * Return: Success: 0 @@ -6415,13 +6415,13 @@ test_set_order_compound(hid_t fapl) hid_t cmpd = -1, memb_cmpd = -1, memb_array1 = -1, memb_array2 = -1, cmpd_array = -1; hid_t vl_id = -1; hsize_t dims[2] = {3, 4}; /* Array dimenstions */ - char filename[1024]; + char filename[1024]; herr_t ret; /* Generic return value */ TESTING("H5Tset/get_order for compound type"); if((memb_cmpd = H5Tcreate(H5T_COMPOUND, sizeof(atomic_cmpd))) < 0) FAIL_STACK_ERROR - if(H5Tinsert(memb_cmpd, "i", HOFFSET(atomic_cmpd, i), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR + if(H5Tinsert(memb_cmpd, "i", HOFFSET(atomic_cmpd, i), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR if(H5Tinsert(memb_cmpd, "c", HOFFSET(atomic_cmpd, c), H5T_NATIVE_CHAR) < 0) FAIL_STACK_ERROR if(H5Tinsert(memb_cmpd, "s", HOFFSET(atomic_cmpd, s), H5T_NATIVE_SHORT) < 0) FAIL_STACK_ERROR if(H5Tinsert(memb_cmpd, "f", HOFFSET(atomic_cmpd, f), H5T_NATIVE_FLOAT) < 0) FAIL_STACK_ERROR @@ -6441,19 +6441,19 @@ test_set_order_compound(hid_t fapl) /* Create a compound type using the types above. */ if((cmpd = H5Tcreate(H5T_COMPOUND, sizeof(complex_cmpd))) < 0) FAIL_STACK_ERROR - if(H5Tinsert(cmpd, "a", HOFFSET(complex_cmpd, a), memb_cmpd) < 0) FAIL_STACK_ERROR - if(H5Tinsert(cmpd, "vl_type", HOFFSET(complex_cmpd, vl), vl_id) < 0) FAIL_STACK_ERROR - if(H5Tinsert(cmpd, "b", HOFFSET(complex_cmpd, b), memb_array1) < 0) FAIL_STACK_ERROR - if(H5Tinsert(cmpd, "d", HOFFSET(complex_cmpd, d), memb_array2) < 0) FAIL_STACK_ERROR + if(H5Tinsert(cmpd, "a", HOFFSET(complex_cmpd, a), memb_cmpd) < 0) FAIL_STACK_ERROR + if(H5Tinsert(cmpd, "vl_type", HOFFSET(complex_cmpd, vl), vl_id) < 0) FAIL_STACK_ERROR + if(H5Tinsert(cmpd, "b", HOFFSET(complex_cmpd, b), memb_array1) < 0) FAIL_STACK_ERROR + if(H5Tinsert(cmpd, "d", HOFFSET(complex_cmpd, d), memb_array2) < 0) FAIL_STACK_ERROR /* The order should be mixed now. */ - if(H5Tget_order(cmpd) != H5T_ORDER_MIXED) FAIL_STACK_ERROR + if(H5Tget_order(cmpd) != H5T_ORDER_MIXED) FAIL_STACK_ERROR /* Create an array of the compound type above */ cmpd_array = H5Tarray_create2(cmpd, 2, dims); /* The order of the array type should be the same as the compound type */ - if(H5Tget_order(cmpd_array) != H5T_ORDER_MIXED) FAIL_STACK_ERROR + if(H5Tget_order(cmpd_array) != H5T_ORDER_MIXED) FAIL_STACK_ERROR /* Verify that the order can't be 'none'. */ H5E_BEGIN_TRY @@ -6471,13 +6471,13 @@ test_set_order_compound(hid_t fapl) if(H5Tset_order(cmpd, H5T_ORDER_BE) < 0) FAIL_STACK_ERROR /* Verify that the order of the compound type is big-endian */ - if(H5Tget_order(cmpd) != H5T_ORDER_BE) FAIL_STACK_ERROR + if(H5Tget_order(cmpd) != H5T_ORDER_BE) FAIL_STACK_ERROR /* Change the order of the array type to little-endian*/ if(H5Tset_order(cmpd_array, H5T_ORDER_LE) < 0) FAIL_STACK_ERROR /* Verify that the order of the array type is little-endian */ - if(H5Tget_order(cmpd_array) != H5T_ORDER_LE) FAIL_STACK_ERROR + if(H5Tget_order(cmpd_array) != H5T_ORDER_LE) FAIL_STACK_ERROR /* Create file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); @@ -6512,23 +6512,23 @@ error: H5Tclose(vl_id); H5Tclose(cmpd); H5Tclose(cmpd_array); - H5Fclose(file); + H5Fclose(file); H5E_END_TRY; return 1; } /* end test_set_order_compound() */ - + /*------------------------------------------------------------------------- - * Function: test_named_indirect_reopen + * Function: test_named_indirect_reopen * - * Purpose: Tests that open named datatypes can be reopened indirectly + * Purpose: Tests that open named datatypes can be reopened indirectly * through H5Dget_type without causing problems. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, June 4, 2009 * * Modifications: @@ -6538,13 +6538,13 @@ error: static int test_named_indirect_reopen(hid_t fapl) { - hid_t file=-1, type=-1, reopened_type=-1, strtype=-1, dset=-1, space=-1; - static hsize_t dims[1] = {3}; + hid_t file=-1, type=-1, reopened_type=-1, strtype=-1, dset=-1, space=-1; + static hsize_t dims[1] = {3}; size_t dt_size; int enum_value; const char *tag = "opaque_tag"; char *tag_ret = NULL; - char filename[1024]; + char filename[1024]; TESTING("indirectly reopening committed datatypes"); @@ -6708,12 +6708,12 @@ test_named_indirect_reopen(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Tclose(strtype); - H5Tclose(reopened_type); - H5Sclose(space); - H5Dclose(dset); - H5Fclose(file); + H5Tclose(type); + H5Tclose(strtype); + H5Tclose(reopened_type); + H5Sclose(space); + H5Dclose(dset); + H5Fclose(file); } H5E_END_TRY; if(tag_ret) H5free_memory(tag_ret); @@ -6824,17 +6824,17 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, HDassert(status >= 0); } /* end create_del_obj_named_test_file() */ - + /*------------------------------------------------------------------------- - * Function: test_delete_obj_named + * Function: test_delete_obj_named * - * Purpose: Tests that delete objects that use named datatypes through + * Purpose: Tests that delete objects that use named datatypes through * different file IDs * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 18, 2011 * *------------------------------------------------------------------------- @@ -6912,27 +6912,27 @@ test_delete_obj_named(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(attr); - H5Dclose(dset); - H5Pclose(fapl2); - H5Fclose(filea1); - H5Fclose(filea2); - H5Fclose(fileb); + H5Tclose(attr); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); } H5E_END_TRY; return 1; } /* end test_delete_obj_named() */ - + /*------------------------------------------------------------------------- - * Function: test_delete_obj_named_fileid + * Function: test_delete_obj_named_fileid * - * Purpose: Tests that objects that use named datatypes through + * Purpose: Tests that objects that use named datatypes through * different file IDs get the correct file IDs * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 28, 2011 * *------------------------------------------------------------------------- @@ -7075,29 +7075,29 @@ test_delete_obj_named_fileid(hid_t fapl) error: H5E_BEGIN_TRY { - H5Aclose(attr); - H5Tclose(type); - H5Dclose(dset); - H5Pclose(fapl2); - H5Fclose(filea1); - H5Fclose(filea2); - H5Fclose(fileb); - H5Fclose(attr_fid); - H5Fclose(type_fid); + H5Aclose(attr); + H5Tclose(type); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); + H5Fclose(attr_fid); + H5Fclose(type_fid); } H5E_END_TRY; return 1; } /* end test_delete_obj_named_fileid() */ - + /*------------------------------------------------------------------------- - * Function: test_deprec + * Function: test_deprec * - * Purpose: Tests deprecated API routines for datatypes. + * Purpose: Tests deprecated API routines for datatypes. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 27, 2007 * *------------------------------------------------------------------------- @@ -7106,17 +7106,17 @@ error: static int test_deprec(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t type = -1; /* Datatype ID */ + hid_t file = -1; /* File ID */ + hid_t type = -1; /* Datatype ID */ unsigned rank = 2; /* Rank for array datatype */ hsize_t dims[2] = {3, 3}; /* Dimensions for array datatype */ int perm[2] = {0, 1}; /* Dimensions permutations for array datatype */ hsize_t rdims[2]= {0, 0}; /* Dimensions for querying array datatype */ int rperm[2] = {-2, -2}; /* Dimensions permutations for array datatype */ hbool_t dim_mismatch; /* Whether any dimensions didn't match */ - char filename[1024]; + char filename[1024]; unsigned u; /* Local index variable */ - herr_t status; /* Generic routine value */ + herr_t status; /* Generic routine value */ TESTING("deprected API routines for datatypes"); @@ -7144,7 +7144,7 @@ test_deprec(hid_t fapl) dim_mismatch = TRUE; } /* end if */ if(dim_mismatch) - FAIL_PUTS_ERROR(" Dimensions didn't match!") + FAIL_PUTS_ERROR(" Dimensions didn't match!") /* Check the array dimension permutations */ dim_mismatch = FALSE; @@ -7154,7 +7154,7 @@ test_deprec(hid_t fapl) dim_mismatch = TRUE; } /* end if */ if(dim_mismatch) - FAIL_PUTS_ERROR(" Dimension permutations modified!") + FAIL_PUTS_ERROR(" Dimension permutations modified!") /* Close the datatype */ if(H5Tclose(type) < 0) @@ -7167,31 +7167,31 @@ test_deprec(hid_t fapl) /* Predefined types cannot be committed */ H5E_BEGIN_TRY { - status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); + status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Predefined types should not be committable!") + FAIL_PUTS_ERROR(" Predefined types should not be committable!") /* Copy a predefined datatype and commit the copy */ if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR if(H5Tcommit1(file, "native-int", type) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(0 == status) - FAIL_PUTS_ERROR(" H5Tcommitted() returned false!") + FAIL_PUTS_ERROR(" H5Tcommitted() returned false!") /* We should not be able to modify a type after it has been committed. */ H5E_BEGIN_TRY { - status = H5Tset_precision(type, (size_t)256); + status = H5Tset_precision(type, (size_t)256); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Committed type is not constant!") + FAIL_PUTS_ERROR(" Committed type is not constant!") /* We should not be able to re-commit a committed type */ H5E_BEGIN_TRY { - status = H5Tcommit1(file, "test_named_2 (should not exist)", type); + status = H5Tcommit1(file, "test_named_2 (should not exist)", type); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Committed types should not be recommitted!") + FAIL_PUTS_ERROR(" Committed types should not be recommitted!") /* * Close the committed type and reopen it. It should return a named type. @@ -7200,7 +7200,7 @@ test_deprec(hid_t fapl) if((type = H5Topen1(file, "native-int")) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(!status) - FAIL_PUTS_ERROR(" Opened named types should be named types!") + FAIL_PUTS_ERROR(" Opened named types should be named types!") /* Close */ if(H5Tclose(type) < 0) FAIL_STACK_ERROR @@ -7230,24 +7230,24 @@ test_deprec(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Fclose(file); + H5Tclose(type); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_deprec() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- - * Function: test_utf_ascii_conv + * Function: test_utf_ascii_conv * - * Purpose: Make sure the library doesn't conversion strings between + * Purpose: Make sure the library doesn't conversion strings between * ASCII and UTF8. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 10 November 2011 *------------------------------------------------------------------------- */ @@ -7265,12 +7265,12 @@ test_utf_ascii_conv(void) char *ascii_r = NULL; const char *ascii_w = "bar!"; char *utf8_r = NULL; - char filename[1024]; + char filename[1024]; char ascii2[4], utf8_2[4]; herr_t status; TESTING("string conversion between ASCII and UTF"); - + /************************************************ * Test VL string conversion from UTF8 to ASCII ************************************************/ @@ -7437,13 +7437,13 @@ test_utf_ascii_conv(void) error: H5E_BEGIN_TRY { - H5Tclose(utf8_vtid); - H5Tclose(ascii_vtid); - H5Tclose(utf8_tid); - H5Tclose(ascii_tid); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid); + H5Tclose(utf8_vtid); + H5Tclose(ascii_vtid); + H5Tclose(utf8_tid); + H5Tclose(ascii_tid); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; return 1; } @@ -7583,7 +7583,7 @@ error: return ret; } /* end of verify_version */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -7603,8 +7603,8 @@ error: * It then loops through all valid combination of the library version * bounds to verify each datatype's version. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -7797,26 +7797,26 @@ test_versionbounds(void) /* Close dataspace and property lists */ if (H5Sclose(space) < 0) TEST_ERROR - if (H5Pclose(fcpl) < 0) TEST_ERROR - if (H5Pclose(fapl) < 0) TEST_ERROR + if (H5Pclose(fcpl) < 0) TEST_ERROR + if (H5Pclose(fapl) < 0) TEST_ERROR PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Dclose(dset); - H5Sclose(space); - H5Tclose(dset_dtype); - H5Pclose(dcpl); - H5Pclose(fcpl); - H5Pclose(fapl); - H5Fclose(file); + H5Dclose(dset); + H5Sclose(space); + H5Tclose(dset_dtype); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_versionbounds() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -7836,8 +7836,8 @@ error: int main(void) { - long nerrors = 0; - hid_t fapl = -1; + long nerrors = 0; + hid_t fapl = -1; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -7846,7 +7846,7 @@ main(void) fapl = h5_fileaccess(); if(ALIGNMENT) - printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); + printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); /* Do the tests */ nerrors += test_classes(); @@ -7901,12 +7901,12 @@ main(void) nerrors += test_versionbounds(); if(nerrors) { - printf("***** %lu FAILURE%s! *****\n", + HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } - printf("All datatype tests passed.\n"); + HDprintf("All datatype tests passed.\n"); return 0; } diff --git a/test/earray.c b/test/earray.c index bb258c7..71dd8b5 100644 --- a/test/earray.c +++ b/test/earray.c @@ -20,15 +20,15 @@ * This file needs to access private datatypes from the H5EA package. * This file also needs to access the extensible array testing code. */ -#define H5EA_FRIEND /*suppress error about including H5EApkg */ +#define H5EA_FRIEND /*suppress error about including H5EApkg */ #define H5EA_TESTING -#include "H5EApkg.h" /* Extensible Arrays */ +#include "H5EApkg.h" /* Extensible Arrays */ /* Other private headers that this test requires */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Iprivate.h" /* IDs */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Local macros */ @@ -173,16 +173,16 @@ char filename_g[EARRAY_FILENAME_LEN]; /* Empty file size */ h5_stat_size_t empty_size_g; - + /*------------------------------------------------------------------------- - * Function: init_cparam + * Function: init_cparam * - * Purpose: Initialize array creation parameter structure + * Purpose: Initialize array creation parameter structure * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 21, 2008 * *------------------------------------------------------------------------- @@ -205,18 +205,18 @@ init_cparam(H5EA_create_t *cparam) return(0); } /* init_cparam() */ - + /*------------------------------------------------------------------------- - * Function: init_tparam + * Function: init_tparam * - * Purpose: Initialize array testing parameter structure + * Purpose: Initialize array testing parameter structure * - * Note: This initialization is the same as that in H5EA_hdr_init() + * Note: This initialization is the same as that in H5EA_hdr_init() * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 25, 2008 * *------------------------------------------------------------------------- @@ -255,16 +255,16 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) return(0); } /* init_tparam() */ - + /*------------------------------------------------------------------------- - * Function: finish_tparam + * Function: finish_tparam * - * Purpose: Close down array testing parameter structure + * Purpose: Close down array testing parameter structure * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 25, 2008 * *------------------------------------------------------------------------- @@ -279,16 +279,16 @@ finish_tparam(earray_test_param_t *tparam) return(0); } /* finish_tparam() */ - + /*------------------------------------------------------------------------- - * Function: create_file + * Function: create_file * - * Purpose: Create file and retrieve pointer to internal file object + * Purpose: Create file and retrieve pointer to internal file object * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -315,16 +315,16 @@ error: return(-1); } /* create_file() */ - + /*------------------------------------------------------------------------- - * Function: check_stats + * Function: check_stats * - * Purpose: Verify stats for an extensible array + * Purpose: Verify stats for an extensible array * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 21, 2008 * *------------------------------------------------------------------------- @@ -393,22 +393,22 @@ error: return(-1); } /* check_stats() */ - + /*------------------------------------------------------------------------- - * Function: reopen_file + * Function: reopen_file * - * Purpose: Perform common "re-open" operations on file & array for testing + * Purpose: Perform common "re-open" operations on file & array for testing * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, hid_t fapl, +reopen_file(hid_t *file, H5F_t **f, hid_t fapl, H5EA_t **ea, haddr_t ea_addr, const earray_test_param_t *tparam) { /* Check for closing & re-opening the array */ @@ -454,16 +454,16 @@ error: return(-1); } /* reopen_file() */ - + /*------------------------------------------------------------------------- - * Function: create_array + * Function: create_array * - * Purpose: Create an extensible array and perform initial checks + * Purpose: Create an extensible array and perform initial checks * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -501,16 +501,16 @@ error: return(-1); } /* create_array() */ - + /*------------------------------------------------------------------------- - * Function: verify_cparam + * Function: verify_cparam * - * Purpose: Verify creation parameters are correct + * Purpose: Verify creation parameters are correct * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -530,23 +530,23 @@ verify_cparam(const H5EA_t *ea, const H5EA_create_t *cparam) TEST_ERROR /* Success */ - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /* verify_cparam() */ - + /*------------------------------------------------------------------------- - * Function: finish + * Function: finish * - * Purpose: Close array, delete array, close file and verify that file + * Purpose: Close array, delete array, close file and verify that file * is empty size * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -590,16 +590,16 @@ error: return(-1); } /* finish() */ - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Test creating extensible array + * Purpose: Test creating extensible array * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 7, 2008 * *------------------------------------------------------------------------- @@ -607,8 +607,8 @@ error: static unsigned test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -806,22 +806,22 @@ error: H5E_BEGIN_TRY { if(ea) H5EA_close(ea); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_create() */ - + /*------------------------------------------------------------------------- - * Function: test_reopen + * Function: test_reopen * - * Purpose: Create & reopen an extensible array + * Purpose: Create & reopen an extensible array * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -829,8 +829,8 @@ error: static unsigned test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -876,22 +876,22 @@ error: H5E_BEGIN_TRY { if(ea) H5EA_close(ea); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_reopen() */ - + /*------------------------------------------------------------------------- - * Function: test_open_twice + * Function: test_open_twice * - * Purpose: Open an extensible array twice + * Purpose: Open an extensible array twice * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -899,10 +899,10 @@ error: static unsigned test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t file2 = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ H5EA_t *ea2 = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -982,25 +982,25 @@ error: H5EA_close(ea); if(ea2) H5EA_close(ea2); - H5Fclose(file); - H5Fclose(file2); + H5Fclose(file); + H5Fclose(file2); } H5E_END_TRY; return 1; } /* test_open_twice() */ - + /*------------------------------------------------------------------------- - * Function: test_open_twice_diff + * Function: test_open_twice_diff * - * Purpose: Open an extensible array twice, through different "top" file + * Purpose: Open an extensible array twice, through different "top" file * handles, with an intermediate file open that takes the "shared" * file handle from the first extensible array's file pointer. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 18, 2015 * *------------------------------------------------------------------------- @@ -1009,12 +1009,12 @@ static unsigned test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { char filename_tmp[EARRAY_FILENAME_LEN]; /* Temporary file name */ - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - hid_t file0 = -1; /* File ID */ - hid_t file00 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t file2 = -1; /* File ID */ + hid_t file0 = -1; /* File ID */ + hid_t file00 = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ H5EA_t *ea2 = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -1122,25 +1122,25 @@ error: H5EA_close(ea); if(ea2) H5EA_close(ea2); - H5Fclose(file); - H5Fclose(file2); - H5Fclose(file0); - H5Fclose(file00); + H5Fclose(file); + H5Fclose(file2); + H5Fclose(file0); + H5Fclose(file00); } H5E_END_TRY; return 1; } /* test_open_twice_diff() */ - + /*------------------------------------------------------------------------- - * Function: test_delete_open + * Function: test_delete_open * - * Purpose: Delete opened extensible array (& open deleted array) + * Purpose: Delete opened extensible array (& open deleted array) * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -1148,8 +1148,8 @@ error: static unsigned test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ H5EA_t *ea2 = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -1243,7 +1243,7 @@ error: H5EA_close(ea); if(ea2) H5EA_close(ea2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; @@ -1255,16 +1255,16 @@ typedef struct eiter_fw_t { unsigned base_sblk_idx; /* Starting index for actual superblocks */ } eiter_fw_t; - + /*------------------------------------------------------------------------- - * Function: eiter_fw_init + * Function: eiter_fw_init * - * Purpose: Initialize element interator (forward iteration) + * Purpose: Initialize element interator (forward iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 2, 2008 * *------------------------------------------------------------------------- @@ -1287,16 +1287,16 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para return(eiter); } /* end eiter_fw_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_fw_next + * Function: eiter_fw_next * - * Purpose: Get next element index (forward iteration) + * Purpose: Get next element index (forward iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1316,16 +1316,16 @@ eiter_fw_next(void *_eiter) return(ret_val); } /* end eiter_fw_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_fw_max + * Function: eiter_fw_max * - * Purpose: Get max. element index (forward iteration) + * Purpose: Get max. element index (forward iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1344,14 +1344,14 @@ eiter_fw_max(const void *_eiter) /*------------------------------------------------------------------------- - * Function: eiter_fw_state + * Function: eiter_fw_state * - * Purpose: Get extensible array state (forward iteration) + * Purpose: Get extensible array state (forward iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1416,16 +1416,16 @@ HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks); return(0); } /* end eiter_fw_state() */ - + /*------------------------------------------------------------------------- - * Function: eiter_fw_term + * Function: eiter_fw_term * - * Purpose: Shut down element interator (forward iteration) + * Purpose: Shut down element interator (forward iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 2, 2008 * *------------------------------------------------------------------------- @@ -1461,16 +1461,16 @@ typedef struct eiter_rv_t { hsize_t idx_blk_nsblks; /* Number of superblocks directly pointed to in the index block */ } eiter_rv_t; - + /*------------------------------------------------------------------------- - * Function: eiter_rv_init + * Function: eiter_rv_init * - * Purpose: Initialize element interator (reverse iteration) + * Purpose: Initialize element interator (reverse iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1505,16 +1505,16 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, return(eiter); } /* end eiter_rv_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_next + * Function: eiter_rv_next * - * Purpose: Get next element index (reverse iteration) + * Purpose: Get next element index (reverse iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1534,16 +1534,16 @@ eiter_rv_next(void *_eiter) return(ret_val); } /* end eiter_rv_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_max + * Function: eiter_rv_max * - * Purpose: Get max. element index (reverse iteration) + * Purpose: Get max. element index (reverse iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1560,16 +1560,16 @@ eiter_rv_max(const void *_eiter) return((hssize_t)eiter->max); } /* end eiter_rv_max() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_state + * Function: eiter_rv_state * - * Purpose: Get extensible array state (reverse iteration) + * Purpose: Get extensible array state (reverse iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1658,16 +1658,16 @@ HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", eit return(0); } /* end eiter_rv_state() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_term + * Function: eiter_rv_term * - * Purpose: Shut down element interator (reverse iteration) + * Purpose: Shut down element interator (reverse iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1700,16 +1700,16 @@ typedef struct eiter_rnd_t { hsize_t *idx; /* Array of shuffled indices */ } eiter_rnd_t; - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_init + * Function: eiter_rnd_init * - * Purpose: Initialize element interator (random iteration) + * Purpose: Initialize element interator (random iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1752,16 +1752,16 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par return(eiter); } /* end eiter_rnd_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_next + * Function: eiter_rnd_next * - * Purpose: Get next element index (random iteration) + * Purpose: Get next element index (random iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1786,16 +1786,16 @@ eiter_rnd_next(void *_eiter) return(ret_val); } /* end eiter_rnd_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_max + * Function: eiter_rnd_max * - * Purpose: Get max. element index (random iteration) + * Purpose: Get max. element index (random iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1812,16 +1812,16 @@ eiter_rnd_max(const void *_eiter) return((hssize_t)eiter->max); } /* end eiter_rnd_max() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_term + * Function: eiter_rnd_term * - * Purpose: Shut down element interator (random iteration) + * Purpose: Shut down element interator (random iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1853,16 +1853,16 @@ static const earray_iter_t ea_iter_rnd = { eiter_rnd_term /* Iterator term */ }; - + /*------------------------------------------------------------------------- - * Function: eiter_rnd2_init + * Function: eiter_rnd2_init * - * Purpose: Initialize element interator (random #2 iteration) + * Purpose: Initialize element interator (random #2 iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 11, 2008 * *------------------------------------------------------------------------- @@ -1937,16 +1937,16 @@ typedef struct eiter_cyc_t { hsize_t cyc; /* Cycle of elements to choose from */ } eiter_cyc_t; - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_init + * Function: eiter_cyc_init * - * Purpose: Initialize element interator (cyclic iteration) + * Purpose: Initialize element interator (cyclic iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -1971,16 +1971,16 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par return(eiter); } /* end eiter_cyc_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_next + * Function: eiter_cyc_next * - * Purpose: Get next element index (cyclic iteration) + * Purpose: Get next element index (cyclic iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2007,16 +2007,16 @@ eiter_cyc_next(void *_eiter) return(ret_val); } /* end eiter_cyc_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_max + * Function: eiter_cyc_max * - * Purpose: Get max. element index (cyclic iteration) + * Purpose: Get max. element index (cyclic iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2033,16 +2033,16 @@ eiter_cyc_max(const void *_eiter) return((hssize_t)eiter->max); } /* end eiter_cyc_max() */ - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_term + * Function: eiter_cyc_term * - * Purpose: Shut down element interator (cyclic iteration) + * Purpose: Shut down element interator (cyclic iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2070,16 +2070,16 @@ static const earray_iter_t ea_iter_cyc = { eiter_cyc_term /* Iterator term */ }; - + /*------------------------------------------------------------------------- - * Function: test_set_elmts + * Function: test_set_elmts * - * Purpose: Set all elements from 0 through 'nelmts' in extensible array + * Purpose: Set all elements from 0 through 'nelmts' in extensible array * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 22, 2008 * *------------------------------------------------------------------------- @@ -2088,8 +2088,8 @@ static unsigned test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, hsize_t nelmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ void *eiter_info; /* Extensible array iterator info */ earray_state_t state; /* State of extensible array */ @@ -2242,22 +2242,22 @@ error: H5E_BEGIN_TRY { if(ea) H5EA_close(ea); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_set_elmts() */ - + /*------------------------------------------------------------------------- - * Function: test_skip_elmts + * Function: test_skip_elmts * - * Purpose: Skip some elements when writing element + * Purpose: Skip some elements when writing element * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2266,8 +2266,8 @@ static unsigned test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, hsize_t skip_elmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ earray_state_t state; /* State of extensible array */ uint64_t welmt; /* Element to write */ @@ -2405,16 +2405,16 @@ error: return 1; } /* test_skip_elmts() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test the extensible array code + * Purpose: Test the extensible array code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 17, 2008 * *------------------------------------------------------------------------- @@ -2426,10 +2426,10 @@ main(void) earray_test_param_t tparam; /* Testing parameters */ earray_test_type_t curr_test; /* Current test being worked on */ earray_iter_type_t curr_iter; /* Current iteration type being worked on */ - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ + hid_t fapl = -1; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ - int ExpressMode; /* Test express value */ + int ExpressMode; /* Test express value */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ @@ -2437,7 +2437,7 @@ main(void) fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); @@ -2452,7 +2452,7 @@ main(void) /* Create an empty file to retrieve size */ { - hid_t file; /* File ID */ + hid_t file; /* File ID */ if((file = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR @@ -2560,14 +2560,14 @@ main(void) nelmts = (hsize_t)((hsize_t)1 + cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx + (tparam.sblk_info[sblk].dblk_nelmts * dblk)); - sprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks); + HDsprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks); nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str); /* Test all elements in data block */ nelmts = (hsize_t)(cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx + (tparam.sblk_info[sblk].dblk_nelmts * (dblk + 1))); - sprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks); + HDsprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks); nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str); /* Increment data block being tested */ diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 826957f..fa0a15e 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -137,7 +137,7 @@ main(void) hid_t srcspace = -1; /* Source dataspaces */ hid_t vspace = -1; /* Virtual dset dataspaces */ hsize_t dims[1] = {3}; /* Data space current size */ - hsize_t chunk_size[2] = {16384, 4}; /* chunk size */ + hsize_t chunk_size[2] = {16384, 4}; /* chunk size */ double fill = 2.7f; /* Fill value */ hsize_t max_size[1]; /* data space maximum size */ size_t nslots = 521 * 2; @@ -198,14 +198,14 @@ main(void) continue; /* Display testing info */ - low_string = h5_get_version_string(low); + low_string = h5_get_version_string(low); high_string = h5_get_version_string(high); HDsprintf(msg, "Testing ENCODE/DECODE with file version bounds: (%s, %s):", low_string, high_string); HDputs(msg); if(VERBOSE_MED) - printf("Encode/Decode DCPLs\n"); + HDprintf("Encode/Decode DCPLs\n"); /******* ENCODE/DECODE DCPLS *****/ TESTING("Default DCPL Encoding/Decoding"); @@ -233,23 +233,23 @@ main(void) FAIL_STACK_ERROR max_size[0] = 100; - if((H5Pset_external(dcpl, "ext1.data", (off_t)0, + if((H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) FAIL_STACK_ERROR - if((H5Pset_external(dcpl, "ext2.data", (off_t)0, + if((H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) FAIL_STACK_ERROR - if((H5Pset_external(dcpl, "ext3.data", (off_t)0, + if((H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) FAIL_STACK_ERROR - if((H5Pset_external(dcpl, "ext4.data", (off_t)0, + if((H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) FAIL_STACK_ERROR /* Test encoding & decoding property list */ if(test_encode_decode(dcpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("DCPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(dcpl)) < 0) FAIL_STACK_ERROR @@ -260,7 +260,7 @@ main(void) TESTING("DCPL Encoding/Decoding for virtual layout"); if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - + /* Set virtual layout */ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0) TEST_ERROR @@ -299,11 +299,11 @@ main(void) if((H5Pset_chunk_cache(dapl, nslots, nbytes, w0)) < 0) FAIL_STACK_ERROR - + /* Test encoding & decoding property list */ if(test_encode_decode(dapl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("DAPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(dapl)) < 0) FAIL_STACK_ERROR @@ -314,7 +314,7 @@ main(void) TESTING("Default OCPL Encoding/Decoding"); if((ocpl = H5Pcreate(H5P_OBJECT_CREATE)) < 0) FAIL_STACK_ERROR - + /* Test encoding & decoding default property list */ if(test_encode_decode(ocpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("Default OCPL encoding/decoding failed\n") @@ -385,13 +385,13 @@ main(void) if((H5Pclose(dxpl)) < 0) FAIL_STACK_ERROR - PASSED(); + PASSED(); /******* ENCODE/DECODE GCPLS *****/ TESTING("Default GCPL Encoding/Decoding"); if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) FAIL_STACK_ERROR - + /* Test encoding & decoding default property list */ if(test_encode_decode(gcpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("Default GCPL encoding/decoding failed\n") @@ -419,7 +419,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(gcpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("GCPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(gcpl)) < 0) FAIL_STACK_ERROR @@ -445,7 +445,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(lcpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("LCPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(lcpl)) < 0) FAIL_STACK_ERROR @@ -491,7 +491,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(lapl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("LAPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(lapl)) < 0) FAIL_STACK_ERROR @@ -523,7 +523,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(ocpypl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("OCPYPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(ocpypl)) < 0) FAIL_STACK_ERROR @@ -619,7 +619,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(fcpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("FCPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(fcpl)) < 0) FAIL_STACK_ERROR @@ -647,7 +647,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(strcpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("STRCPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(strcpl)) < 0) FAIL_STACK_ERROR @@ -675,7 +675,7 @@ main(void) /* Test encoding & decoding property list */ if(test_encode_decode(acpl, low, high, FALSE) < 0) FAIL_PUTS_ERROR("ACPL encoding/decoding failed\n") - + /* release resource */ if((H5Pclose(acpl)) < 0) FAIL_STACK_ERROR @@ -688,7 +688,7 @@ main(void) return 0; error: - printf("***** Plist Encode/Decode tests FAILED! *****\n"); +HDprintf("***** Plist Encode/Decode tests FAILED! *****\n"); return 1; } diff --git a/test/enum.c b/test/enum.c index 588e9b3..26e64fd 100644 --- a/test/enum.c +++ b/test/enum.c @@ -166,7 +166,7 @@ test_conv(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if(data1[i] != data2[i]) { H5_FAILED(); - printf(" 1. data1[%lu]=%d, data2[%lu]=%d (should be same)\n", + HDprintf(" 1. data1[%lu]=%d, data2[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data2[i])); goto error; @@ -178,7 +178,7 @@ test_conv(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if((short)data1[i] != data_short[i]) { H5_FAILED(); - printf(" 2. data1[%lu]=%d, data_short[%lu]=%d (should be same)\n", + HDprintf(" 2. data1[%lu]=%d, data_short[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data_short[i])); goto error; @@ -190,7 +190,7 @@ test_conv(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if((int)data1[i] != (int)data_double[i]) { H5_FAILED(); - printf(" 3. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n", + HDprintf(" 3. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data_double[i])); goto error; @@ -212,7 +212,7 @@ test_conv(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if((int)data1[i] != data_int[i]) { H5_FAILED(); - printf(" 4. data1[%lu]=%d, data_int[%lu]=%d (should be same)\n", + HDprintf(" 4. data1[%lu]=%d, data_int[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data_int[i])); goto error; @@ -234,7 +234,7 @@ test_conv(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if((int)data1[i] != (int)data_double[i]) { H5_FAILED(); - printf(" 5. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n", + HDprintf(" 5. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data_double[i])); goto error; @@ -318,7 +318,7 @@ test_tr1(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if(data1[i] != data2[i]) { H5_FAILED(); - printf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n", + HDprintf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data2[i])); goto error; @@ -400,7 +400,7 @@ test_tr2(hid_t file) for(i = 0; i < (size_t)ds_size[0]; i++) if(data1[i] != data2[i]) { H5_FAILED(); - printf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n", + HDprintf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data2[i])); goto error; @@ -559,7 +559,7 @@ test_funcs(void) } H5E_END_TRY; if (ret>=0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -568,7 +568,7 @@ test_funcs(void) } H5E_END_TRY; if (size>0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -577,7 +577,7 @@ test_funcs(void) } H5E_END_TRY; if (inpad>-1) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -586,7 +586,7 @@ test_funcs(void) } H5E_END_TRY; if (cset>-1) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -596,7 +596,7 @@ test_funcs(void) } H5E_END_TRY; if (ret>=0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ @@ -605,7 +605,7 @@ test_funcs(void) } H5E_END_TRY; if (ret>=0) { H5_FAILED(); - printf("Operation not allowed for this type.\n"); + HDprintf("Operation not allowed for this type.\n"); goto error; } /* end if */ diff --git a/test/err_compat.c b/test/err_compat.c index 4860a3c..d2d039a 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -12,17 +12,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * October 14, 2001 * - * Purpose: Tests Error API + * Purpose: Tests Error API */ #include "h5test.h" #ifdef H5_NO_DEPRECATED_SYMBOLS int main(void) { - printf("Test skipped because backward compatability with v1.6 is NOT configured in\n"); + HDprintf("Test skipped because backward compatibility with v1.6 is NOT configured in\n"); return 0; } #else /* H5_NO_DEPRECATED_SYMBOLS */ @@ -35,7 +35,7 @@ const char *FILENAME[] = { #define DIM0 100 #define DIM1 200 -int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; +int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; #define DSET_NAME "a_dataset" #define FAKE_ID (hid_t)-1 @@ -43,17 +43,17 @@ int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data); herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data); - + /*------------------------------------------------------------------------- - * Function: user_print1 + * Function: user_print1 * - * Purpose: This function is a user-defined old-style printing function. - * This is just a convenience function for H5Ewalk1() with a + * Purpose: This function is a user-defined old-style printing function. + * This is just a convenience function for H5Ewalk1() with a * function that prints error messages. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * *------------------------------------------------------------------------- @@ -62,7 +62,7 @@ static herr_t user_print1(FILE *stream) { /* Customized way to print errors */ - fprintf(stderr, "\n********* Print error stack in customized way *********\n"); + HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); if(H5Ewalk1(H5E_WALK_UPWARD, (H5E_walk1_t)custom_print_cb1, stream) < 0) TEST_ERROR; @@ -73,17 +73,17 @@ user_print1(FILE *stream) } - + /*------------------------------------------------------------------------- - * Function: user_print2 + * Function: user_print2 * - * Purpose: This function is a user-defined new-style printing function. - * This is just a convenience function for H5Ewalk2() with a + * Purpose: This function is a user-defined new-style printing function. + * This is just a convenience function for H5Ewalk2() with a * function that prints error messages. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * *------------------------------------------------------------------------- @@ -92,7 +92,7 @@ static herr_t user_print2(hid_t err_stack, FILE *stream) { /* Customized way to print errors */ - fprintf(stderr, "\n********* Print error stack in customized way *********\n"); + HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); if(H5Ewalk2(err_stack, H5E_WALK_UPWARD, (H5E_walk2_t)custom_print_cb2, stream) < 0) TEST_ERROR; @@ -103,18 +103,18 @@ user_print2(hid_t err_stack, FILE *stream) } - + /*------------------------------------------------------------------------- * Function: custom_print_cb1 * - * Purpose: Callback function to print error stack in customized way + * Purpose: Callback function to print error stack in customized way * for H5Ewalk1. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * * Modifications: @@ -124,10 +124,10 @@ user_print2(hid_t err_stack, FILE *stream) herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data) { - FILE *stream = (FILE *)client_data; + FILE *stream = (FILE *)client_data; char *maj = NULL; char *min = NULL; - const int indent = 4; + const int indent = 4; if(NULL == (min = H5Eget_minor(err_desc->min_num))) TEST_ERROR; @@ -135,12 +135,12 @@ custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data) if(NULL == (maj = H5Eget_major(err_desc->maj_num))) TEST_ERROR; - fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", - indent, "", n, err_desc->file_name, - err_desc->func_name, err_desc->line); - - fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); - fprintf(stream, "%*sminor: %s\n", indent * 2, "", min); + HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", + indent, "", n, err_desc->file_name, + err_desc->func_name, err_desc->line); + + HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); + HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min); H5free_memory(maj); H5free_memory(min); @@ -152,22 +152,22 @@ error: H5free_memory(maj); if(min) H5free_memory(min); - + return -1; } - + /*------------------------------------------------------------------------- * Function: custom_print_cb2 * - * Purpose: Callback function to print error stack in customized way + * Purpose: Callback function to print error stack in customized way * for H5Ewalk1. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * * Modifications: @@ -177,10 +177,10 @@ error: herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data) { - FILE *stream = (FILE *)client_data; + FILE *stream = (FILE *)client_data; char *maj = NULL; char *min = NULL; - const int indent = 4; + const int indent = 4; if(NULL == (min = H5Eget_minor(err_desc->min_num))) TEST_ERROR; @@ -188,12 +188,12 @@ custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data) if(NULL == (maj = H5Eget_major(err_desc->maj_num))) TEST_ERROR; - fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", - indent, "", n, err_desc->file_name, - err_desc->func_name, err_desc->line); - - fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); - fprintf(stream, "%*sminor: %s\n", indent * 2, "", min); + HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", + indent, "", n, err_desc->file_name, + err_desc->func_name, err_desc->line); + + HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); + HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min); H5free_memory(maj); H5free_memory(min); @@ -205,22 +205,22 @@ error: H5free_memory(maj); if(min) H5free_memory(min); - + return -1; } - + /*------------------------------------------------------------------------- - * Function: test_error1 + * Function: test_error1 * - * Purpose: Test the backward compatibility of H5Eset/get_auto. + * Purpose: Test the backward compatibility of H5Eset/get_auto. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * 17 September 2010 + * Programmer: Raymond Lu + * 17 September 2010 * * * Modifications: @@ -230,63 +230,63 @@ error: static herr_t test_error1(void) { - hid_t dataset, space; - hsize_t dims[2]; + hid_t dataset, space; + hsize_t dims[2]; H5E_auto1_t old_func1; H5E_auto2_t old_func2; void *old_data; herr_t ret; TESTING("error API H5Eset/get_auto"); - fprintf(stderr, "\n"); + HDfprintf(stderr, "\n"); /* Create the data space */ dims[0] = DIM0; dims[1] = DIM1; if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; - /* Use H5Eget_auto2 to query the default printing function. The library + /* Use H5Eget_auto2 to query the default printing function. The library *should indicate H5Eprint2 as the default. */ if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data)<0) - TEST_ERROR; + TEST_ERROR; if (old_data != NULL) - TEST_ERROR; + TEST_ERROR; if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) - TEST_ERROR; + TEST_ERROR; /* This function sets the default printing function to be H5Eprint2. */ if(H5Eset_auto2(H5E_DEFAULT, old_func2, old_data)<0) TEST_ERROR; - /* Try the printing function. Dataset creation should fail because the file + /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, + dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if(dataset >= 0) + if(dataset >= 0) TEST_ERROR; /* This call should work. It simply returns H5Eprint1. */ if((ret = H5Eget_auto1(&old_func1, &old_data))<0) TEST_ERROR; if (old_data != NULL) - TEST_ERROR; + TEST_ERROR; if (!old_func1 || (H5E_auto1_t)H5Eprint1 != old_func1) - TEST_ERROR; + TEST_ERROR; /* This function changes the old-style printing function to be user_print1. */ if(H5Eset_auto1((H5E_auto1_t)user_print1, stderr)<0) TEST_ERROR; - /* Try the printing function. Dataset creation should fail because the file + /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, + dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if(dataset >= 0) + if(dataset >= 0) TEST_ERROR; - /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1. - * Once the H5Eset_auto1 is called with a user-defined printing function, - * a call to H5Eget_auto2 will fail. But keep in mind the printing function is + /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1. + * Once the H5Eset_auto1 is called with a user-defined printing function, + * a call to H5Eget_auto2 will fail. But keep in mind the printing function is * user_print1. */ if((ret = H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data))>=0) TEST_ERROR; @@ -295,44 +295,44 @@ test_error1(void) if(H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)user_print2, stderr)<0) TEST_ERROR; - /* Try the printing function. Dataset creation should fail because the file + /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, + dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if(dataset >= 0) + if(dataset >= 0) TEST_ERROR; /* This function changes the new-style printing function back to the default H5Eprint2. */ if(H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL)<0) TEST_ERROR; - /* This call should work because the H5Eset_auto2 above restored the default printing + /* This call should work because the H5Eset_auto2 above restored the default printing * function H5Eprint2. It simply returns user_print1. */ if((ret = H5Eget_auto1(&old_func1, &old_data))<0) TEST_ERROR; if (old_data != NULL) - TEST_ERROR; + TEST_ERROR; if (!old_func1 || (H5E_auto1_t)user_print1 != old_func1) - TEST_ERROR; + TEST_ERROR; /* This function changes the new-style printing function back to the default H5Eprint1. */ if(H5Eset_auto1((H5E_auto1_t)H5Eprint1, NULL)<0) TEST_ERROR; - /* This call should work because the H5Eset_auto1 above restored the default printing + /* This call should work because the H5Eset_auto1 above restored the default printing * function H5Eprint1. It simply returns H5Eprint2. */ if((ret = H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data))<0) TEST_ERROR; if (old_data != NULL) - TEST_ERROR; + TEST_ERROR; if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) - TEST_ERROR; + TEST_ERROR; - /* Try the printing function. Dataset creation should fail because the file + /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, + dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if(dataset >= 0) + if(dataset >= 0) TEST_ERROR; return 0; @@ -341,18 +341,18 @@ test_error1(void) return -1; } - + /*------------------------------------------------------------------------- - * Function: test_error2 + * Function: test_error2 * - * Purpose: Test error API functions, mainly on H5Epush1. + * Purpose: Test error API functions, mainly on H5Epush1. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * July 10, 2003 + * Programmer: Raymond Lu + * July 10, 2003 * * * Modifications: @@ -362,12 +362,12 @@ test_error1(void) static herr_t test_error2(hid_t file) { - hid_t dataset, space; - hsize_t dims[2]; + hid_t dataset, space; + hsize_t dims[2]; const char *FUNC_test_error="test_error2"; TESTING("error API based on data I/O"); - fprintf(stderr, "\n"); + HDfprintf(stderr, "\n"); /* Create the data space */ dims[0] = DIM0; @@ -381,7 +381,7 @@ test_error2(hid_t file) /* Create the dataset */ if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE, "H5Dcreate2 failed"); goto error; @@ -411,18 +411,18 @@ test_error2(hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: dump_error * - * Purpose: Prints error stack in default and customized ways. + * Purpose: Prints error stack in default and customized ways. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * July 17, 2003 + * Programmer: Raymond Lu + * July 17, 2003 * * * Modifications: @@ -433,12 +433,12 @@ static herr_t dump_error(void) { /* Print errors in library default way */ - fprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); + HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); if(H5Eprint1(stderr) < 0) TEST_ERROR; /* Customized way to print errors */ - fprintf(stderr, "\n********* Print error stack in customized way *********\n"); + HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); if(H5Ewalk1(H5E_WALK_UPWARD, custom_print_cb1, stderr) < 0) TEST_ERROR; @@ -449,14 +449,14 @@ dump_error(void) } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test error API. + * Purpose: Test error API. * - * Programmer: Raymond Lu - * July 10, 2003 + * Programmer: Raymond Lu + * July 10, 2003 * * Modifications: * @@ -465,16 +465,16 @@ dump_error(void) int main(void) { - hid_t file, fapl; - char filename[1024]; + hid_t file, fapl; + char filename[1024]; const char *FUNC_main="main"; - fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to be some error messages\n"); + HDfprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to be some error messages\n"); fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR ; + TEST_ERROR ; /* Test error stack */ @@ -500,11 +500,11 @@ main(void) if(H5Fclose(file) < 0) TEST_ERROR ; h5_clean_files(FILENAME, fapl); - printf("All error API tests passed.\n"); + HDprintf("All error API tests passed.\n"); return 0; - error: - printf("***** ERROR TEST FAILED! *****\n"); +error: + HDprintf("***** ERROR TEST FAILED! *****\n"); return 1; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/test/error_test.c b/test/error_test.c index 44f6210..1de9065 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -12,10 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * October 14, 2001 * - * Purpose: Tests the error API routines. + * Purpose: Tests the error API routines. */ #include "h5test.h" #include "H5srcdir.h" @@ -23,7 +23,7 @@ #ifdef H5_USE_16_API int main(void) { - HDfprintf(stderr, "Test skipped because backward compatbility with v1.6 is configured in\n"); + HDfprintf(stderr, "Test skipped because backward compatibility with v1.6 is configured in\n"); return 0; } #else /* H5_USE_16_API */ @@ -38,7 +38,7 @@ const char *FILENAME[] = { #define DIM0 100 #define DIM1 200 -int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; +int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; hid_t ERR_CLS; hid_t ERR_CLS2; @@ -80,7 +80,7 @@ hid_t ERR_MIN_GETNUM; static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data); - + /*------------------------------------------------------------------------- * Function: test_error * @@ -94,10 +94,10 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, static herr_t test_error(hid_t file) { - hid_t dataset = -1; + hid_t dataset = -1; hid_t space = -1; hid_t estack_id = -1; - hsize_t dims[2]; + hsize_t dims[2]; const char *FUNC_test_error = "test_error"; H5E_auto2_t old_func; void *old_data = NULL; @@ -169,7 +169,7 @@ test_error(hid_t file) return -1; } /* end test_error() */ - + /*------------------------------------------------------------------------- * Function: init_error * @@ -245,7 +245,7 @@ error: return -1; } /* end init_error() */ - + /*------------------------------------------------------------------------- * Function: error_stack * @@ -287,7 +287,7 @@ error: return -1; } /* end error_stack() */ - + /*------------------------------------------------------------------------- * Function: long_desc_cb * @@ -309,7 +309,7 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie return -1; } /* end long_desc_cb() */ - + /*------------------------------------------------------------------------- * Function: test_long_desc * @@ -384,7 +384,7 @@ error: } /* end test_long_desc() */ #pragma GCC diagnostic pop - + /*------------------------------------------------------------------------- * Function: dump_error * @@ -414,7 +414,7 @@ error: return -1; } /* end dump_error() */ - + /*------------------------------------------------------------------------- * Function: custom_print_cb * @@ -445,8 +445,8 @@ custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) TEST_ERROR; HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", - indent, "", n, err_desc->file_name, - err_desc->func_name, err_desc->line); + indent, "", n, err_desc->file_name, + err_desc->func_name, err_desc->line); HDfprintf(stream, "%*sclass: %s\n", indent * 2, "", cls); HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min); @@ -457,7 +457,7 @@ error: return -1; } /* end custom_print_cb() */ - + /*------------------------------------------------------------------------- * Function: test_create * @@ -540,11 +540,11 @@ test_copy(void) err_num = H5Eget_num(H5E_DEFAULT); if (err_num != 1) TEST_ERROR - + /* Copy error stack, which clears the original */ if ((estack_id = H5Eget_current_stack()) < 0) TEST_ERROR - + /* Check the number of errors on stack copy */ err_num = H5Eget_num(estack_id); if (err_num != 1) @@ -564,7 +564,7 @@ test_copy(void) if (err_num != 1) TEST_ERROR - /* Try to close error stack copy. Should fail because + /* Try to close error stack copy. Should fail because * the current H5Eset_current_stack closes the stack to be set. */ H5E_BEGIN_TRY { @@ -579,7 +579,7 @@ error: return -1; } /* end test_copy() */ - + /*------------------------------------------------------------------------- * Function: close_error * @@ -615,17 +615,17 @@ error: return -1; } /* end close_error() */ - + /*------------------------------------------------------------------------- * Function: test_filter_error * * Purpose: Make sure the error message prints out the filter name - * when the existent file is opened but the filter isn't - * registered. The existent file was created with - * gen_filters.c. + * when the existent file is opened but the filter isn't + * registered. The existent file was created with + * gen_filters.c. * * Return: Success: 0 - * Failure: -1 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -663,7 +663,7 @@ error: return -1; } /* end test_filter_error() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -745,7 +745,7 @@ main(void) if (close_error() < 0) TEST_ERROR; - /* Test error message during data reading when filter isn't registered + /* Test error message during data reading when filter isn't registered * Use default FAPL to avoid some VFD drivers by the check-vfd test because * the test file was pre-generated. */ diff --git a/test/extend.c b/test/extend.c index e5c3cb3..a31ac0e 100644 --- a/test/extend.c +++ b/test/extend.c @@ -105,9 +105,9 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me for(k = 0; k < (NX / 2); k++) for(m = 0; m < (NY / 2); m++) if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) { - printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m); - printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]); - printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]); + HDprintf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m); + HDprintf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]); + HDprintf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]); TEST_ERROR; } /* end if */ } /* end for */ @@ -195,9 +195,9 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h for(k = 0; k < (NX / 2); k++) for(m = 0; m < (NY / 2); m++) if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) { - printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m); - printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]); - printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]); + HDprintf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m); + HDprintf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]); + HDprintf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]); TEST_ERROR; } /* end if */ } /* end for */ @@ -219,23 +219,15 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests extendible datasets + * Purpose: Tests extendible datasets * - * Return: Success: exit(0) - * - * Failure: exit(non-zero) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Friday, January 30, 1998 * - * Modifications: - * Took main data code out into write_data() routine, to allow - * different dataset creation property list settings to be tested. - * Quincey Koziol - * Tuesday, June 10, 2003 - * *------------------------------------------------------------------------- */ int @@ -289,17 +281,17 @@ main (void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); if(nerrors) { - printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); - exit(EXIT_FAILURE); + HDprintf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); + HDexit(EXIT_FAILURE); } /* end if */ - printf("All extend tests passed.\n"); + HDprintf("All extend tests passed.\n"); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: - printf("*** One or more extend tests failed ***\n"); - return 1; -} + HDprintf("*** One or more extend tests failed ***\n"); + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/external.c b/test/external.c index 50d94ab..e2565de 100644 --- a/test/external.c +++ b/test/external.c @@ -147,7 +147,7 @@ test_non_extendible(hid_t file) if(1 != n) { H5_FAILED(); HDputs(" Returned external count is wrong."); - printf(" got: %d\n ans: 1\n", n); + HDprintf(" got: %d\n ans: 1\n", n); goto error; } @@ -157,13 +157,13 @@ test_non_extendible(hid_t file) if(file_offset != 0) { H5_FAILED(); HDputs(" Wrong file offset."); - printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset); + HDprintf(" got: %lu\n ans: 0\n", (unsigned long)file_offset); goto error; } if(file_size != (max_size[0] * sizeof(int))) { H5_FAILED(); HDputs(" Wrong file size."); - printf(" got: %lu\n ans: %lu\n", (unsigned long)file_size, (unsigned long)max_size[0]*sizeof(int)); + HDprintf(" got: %lu\n ans: %lu\n", (unsigned long)file_size, (unsigned long)max_size[0]*sizeof(int)); goto error; } @@ -396,7 +396,7 @@ test_unlimited(hid_t file) if(1 != n) { H5_FAILED(); HDputs(" Returned external count is wrong."); - printf(" got: %d\n ans: 1\n", n); + HDprintf(" got: %d\n ans: 1\n", n); goto error; } /* end if */ @@ -405,13 +405,13 @@ test_unlimited(hid_t file) if(file_offset != 0) { H5_FAILED(); HDputs(" Wrong file offset."); - printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset); + HDprintf(" got: %lu\n ans: 0\n", (unsigned long)file_offset); goto error; } if(H5F_UNLIMITED != file_size) { H5_FAILED(); HDputs(" Wrong file size."); - printf(" got: %lu\n ans: INF\n", (unsigned long)file_size); + HDprintf(" got: %lu\n ans: INF\n", (unsigned long)file_size); goto error; } @@ -655,7 +655,7 @@ test_read_file_set(hid_t fapl) TEST_ERROR /* Reset the raw data files */ - if(reset_raw_data_files(0) < 0) + if(reset_raw_data_files(FALSE) < 0) TEST_ERROR /* Create the file and an initial group. This causes messages about @@ -795,7 +795,7 @@ test_write_file_set(hid_t fapl) } /* end for */ /* Reset the raw data files */ - if(reset_raw_data_files(0) < 0) + if(reset_raw_data_files(FALSE) < 0) TEST_ERROR /* Create the dataset */ @@ -896,7 +896,7 @@ test_path_absolute(hid_t fapl) FAIL_STACK_ERROR /* Reset the raw data files */ - if(reset_raw_data_files(0) < 0) + if(reset_raw_data_files(FALSE) < 0) TEST_ERROR /* Create the dcpl */ @@ -992,7 +992,7 @@ test_path_relative(hid_t fapl) FAIL_STACK_ERROR; /* Reset the raw data files */ - if(reset_raw_data_files(0) < 0) + if(reset_raw_data_files(FALSE) < 0) TEST_ERROR /* Create the dataset */ @@ -1087,7 +1087,7 @@ test_path_relative_cwd(hid_t fapl) FAIL_STACK_ERROR; /* Reset the raw data files */ - if(reset_raw_data_files(0) < 0) + if(reset_raw_data_files(FALSE) < 0) TEST_ERROR /* Create the dataset */ @@ -1229,7 +1229,7 @@ test_h5d_get_access_plist(hid_t fapl_id) TEST_ERROR /* Reset the raw data files */ - if(reset_raw_data_files(0) < 0) + if(reset_raw_data_files(FALSE) < 0) TEST_ERROR /* Create the file */ @@ -1418,7 +1418,7 @@ error: H5Gclose(gid); } H5E_END_TRY; nerrors = MAX(1, nerrors); - printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); + HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); return EXIT_FAILURE; } /* end main() */ diff --git a/test/external_common.c b/test/external_common.c index c3aa455..c9b6584 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -35,7 +35,7 @@ *------------------------------------------------------------------------- */ herr_t -reset_raw_data_files(int is_env) +reset_raw_data_files(hbool_t is_env) { int fd = 0; /* external file descriptor */ size_t i, j; /* iterators */ diff --git a/test/external_common.h b/test/external_common.h index a2cb03e..f02652b 100644 --- a/test/external_common.h +++ b/test/external_common.h @@ -31,7 +31,15 @@ #define TOTAL_SIZE 100 #define GARBAGE_PER_FILE 10 -H5TEST_DLL herr_t reset_raw_data_files(int); -#endif /* _EXTERNAL_COMMON_H */ +#ifdef __cplusplus +extern "C" { +#endif + +H5TEST_DLL herr_t reset_raw_data_files(hbool_t is_env); +#ifdef __cplusplus +} +#endif + +#endif /* _EXTERNAL_COMMON_H */ diff --git a/test/external_env.c b/test/external_env.c index 8ecebf6..01f2cba 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Purpose: Tests datasets stored in external raw files. + * Purpose: Tests datasets stored in external raw files. */ #include "external_common.h" #include "external_fname.h" @@ -22,7 +22,7 @@ static const char *EXT_ENV_FNAME[] = { NULL }; - + /*------------------------------------------------------------------------- * Function: test_path_env * @@ -47,18 +47,18 @@ static const char *EXT_ENV_FNAME[] = { static int test_path_env(hid_t fapl) { - hid_t file = -1; /* file to write to */ - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - hid_t dapl = -1; /* dataset access property list */ - hid_t dset = -1; /* dataset */ - size_t i; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ - char filename[1024]; /* file name */ - int part[PART_SIZE]; /* raw data buffer (partial) */ + hid_t file = -1; /* file to write to */ + hid_t dcpl = -1; /* dataset creation properties */ + hid_t space = -1; /* data space */ + hid_t dapl = -1; /* dataset access property list */ + hid_t dset = -1; /* dataset */ + size_t i; /* miscellaneous counters */ + char cwdpath[1024]; /* working directory */ + char filename[1024]; /* file name */ + int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ - hsize_t cur_size; /* current data space size */ - char buffer[1024]; /* buffer to read efile_prefix */ + hsize_t cur_size; /* current data space size */ + char buffer[1024]; /* buffer to read efile_prefix */ TESTING("prefix in HDF5_EXTFILE_PREFIX"); @@ -70,7 +70,7 @@ test_path_env(hid_t fapl) FAIL_STACK_ERROR /* Reset the raw data files */ - if(reset_raw_data_files(1) < 0) + if(reset_raw_data_files(TRUE) < 0) TEST_ERROR /* Create the dataset */ @@ -130,7 +130,7 @@ error: return 1; } /* end test_path_env() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -138,7 +138,7 @@ error: * * Return: EXIT_SUCCESS/EXIT_FAILURE * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 3, 1998 * *------------------------------------------------------------------------- @@ -146,12 +146,12 @@ error: int main(void) { - hid_t fapl_id_old = -1; /* file access properties (old format) */ - hid_t fapl_id_new = -1; /* file access properties (new format) */ - hid_t fid = -1; /* file for test_1* functions */ - hid_t gid = -1; /* group to emit diagnostics */ + hid_t fapl_id_old = -1; /* file access properties (old format) */ + hid_t fapl_id_new = -1; /* file access properties (new format) */ + hid_t fid = -1; /* file for test_1* functions */ + hid_t gid = -1; /* group to emit diagnostics */ unsigned latest_format; /* default or latest file format */ - int nerrors = 0; /* number of errors */ + int nerrors = 0; /* number of errors */ h5_reset(); @@ -213,7 +213,7 @@ error: H5Gclose(gid); } H5E_END_TRY; nerrors = MAX(1, nerrors); - printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); + HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); return EXIT_FAILURE; } /* end main() */ diff --git a/test/filenotclosed.c b/test/filenotclosed.c index 2c5c8dc..2d050eb 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -35,7 +35,7 @@ */ static void catch_signal(int H5_ATTR_UNUSED signo) { - HDexit(1); + HDexit(EXIT_FAILURE); } /* catch_signal() */ diff --git a/test/fillval.c b/test/fillval.c index 5b95de9..0454bde 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -15,7 +15,7 @@ * Programmer: Robb Matzke <robb@arborea.spizella.com> * Thursday, October 1, 1998 * - * Purpose: Tests dataset fill values. + * Purpose: Tests dataset fill values. */ #include "h5test.h" #include "H5srcdir.h" @@ -59,9 +59,9 @@ typedef struct { * for version 1.4(after 1.4.3). To get this data file, simply compile * gen_old_fill.c with HDF5 library (before v1.5) and run it. */ #define FILE_COMPATIBLE "fill_old.h5" -#define FILE_NAME_RAW "fillval.raw" +#define FILE_NAME_RAW "fillval.raw" + - /*------------------------------------------------------------------------- * Function: create_compound_type * @@ -91,7 +91,7 @@ static hid_t create_compound_type(void) if(H5Tinsert(ret_value, "y", HOFFSET(comp_datatype, y), H5T_NATIVE_DOUBLE) < 0) goto error; if(H5Tinsert(ret_value, "z", HOFFSET(comp_datatype, z), H5T_NATIVE_CHAR) < 0) - goto error; + goto error; return ret_value; @@ -102,7 +102,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_compound_vl_type * @@ -146,18 +146,18 @@ error: return -1; } /* end create_compound_vl_type() */ - + /*------------------------------------------------------------------------- - * Function: test_getset + * Function: test_getset * - * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value() - * functions. + * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value() + * functions. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * * Modifications: @@ -167,15 +167,15 @@ error: static int test_getset(void) { - hid_t dcpl=-1; - int fill_i; - hid_t type_ss=-1, type_si=-1; + hid_t dcpl=-1; + int fill_i; + hid_t type_ss=-1, type_si=-1; struct fill_si { - int v1, v2; - } fill_si; + int v1, v2; + } fill_si; struct fill_ss { - short v1, v2; - } fill_ss, fill_ss_rd; + short v1, v2; + } fill_ss, fill_ss_rd; TESTING("property lists"); @@ -185,18 +185,18 @@ test_getset(void) */ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if((type_ss=H5Tcreate(H5T_COMPOUND, sizeof fill_ss)) < 0 || - H5Tinsert(type_ss, "v1", HOFFSET(struct fill_ss, v1), - H5T_NATIVE_SHORT) < 0 || - H5Tinsert(type_ss, "v2", HOFFSET(struct fill_ss, v2), - H5T_NATIVE_SHORT) < 0) { - goto error; + H5Tinsert(type_ss, "v1", HOFFSET(struct fill_ss, v1), + H5T_NATIVE_SHORT) < 0 || + H5Tinsert(type_ss, "v2", HOFFSET(struct fill_ss, v2), + H5T_NATIVE_SHORT) < 0) { + goto error; } if((type_si=H5Tcreate(H5T_COMPOUND, sizeof fill_si)) < 0 || - H5Tinsert(type_si, "v1", HOFFSET(struct fill_si, v1), - H5T_NATIVE_INT) < 0 || - H5Tinsert(type_si, "v2", HOFFSET(struct fill_si, v2), - H5T_NATIVE_INT) < 0) { - goto error; + H5Tinsert(type_si, "v1", HOFFSET(struct fill_si, v1), + H5T_NATIVE_INT) < 0 || + H5Tinsert(type_si, "v2", HOFFSET(struct fill_si, v2), + H5T_NATIVE_INT) < 0) { + goto error; } /* @@ -204,12 +204,12 @@ test_getset(void) * no fill value should result in a failure. */ H5E_BEGIN_TRY { - H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i); + H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i); } H5E_END_TRY; if(fill_i != 0) { - H5_FAILED(); - puts(" H5Pget_fill_value() should return default 0"); - goto error; + H5_FAILED(); + puts(" H5Pget_fill_value() should return default 0"); + goto error; } /* @@ -224,10 +224,10 @@ test_getset(void) */ if(H5Pget_fill_value(dcpl, type_ss, &fill_ss_rd) < 0) goto error; if(fill_ss.v1!=fill_ss_rd.v1 || fill_ss.v2!=fill_ss_rd.v2) { - H5_FAILED(); - puts(" Failed to get fill value using same data type that was "); - puts(" used to set the fill value."); - goto error; + H5_FAILED(); + puts(" Failed to get fill value using same data type that was "); + puts(" used to set the fill value."); + goto error; } /* @@ -235,10 +235,10 @@ test_getset(void) */ if(H5Pget_fill_value(dcpl, type_si, &fill_si) < 0) goto error; if(fill_ss.v1!=fill_si.v1 || fill_ss.v2!=fill_si.v2) { - H5_FAILED(); - puts(" Failed to get fill value using a data type other than what"); - puts(" was used to set the fill value."); - goto error; + H5_FAILED(); + puts(" Failed to get fill value using a data type other than what"); + puts(" was used to set the fill value."); + goto error; } /* @@ -247,9 +247,9 @@ test_getset(void) if(H5Pset_fill_value(dcpl, type_si, &fill_si) < 0) goto error; if(H5Pget_fill_value(dcpl, type_ss, &fill_ss) < 0) goto error; if(fill_si.v1!=fill_ss.v1 || fill_si.v2!=fill_ss.v2) { - H5_FAILED(); - puts(" Resetting the fill value was unsuccessful."); - goto error; + H5_FAILED(); + puts(" Resetting the fill value was unsuccessful."); + goto error; } /* Success */ @@ -261,24 +261,24 @@ test_getset(void) error: H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Tclose(type_si); - H5Tclose(type_ss); + H5Pclose(dcpl); + H5Tclose(type_si); + H5Tclose(type_ss); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- - * Function: test_getset_vl + * Function: test_getset_vl * - * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value() - * functions, using variable-length datatype. + * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value() + * functions, using variable-length datatype. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 31, 2007 * *------------------------------------------------------------------------- @@ -362,47 +362,47 @@ test_getset_vl(hid_t fapl) return 1; } /* end test_getset_vl() */ - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Tests creating datasets that have fill values. + * Purpose: Tests creating datasets that have fill values. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * * Modifications: - * Many new cases have been added to this test since - * the fill value design has been modified. + * Many new cases have been added to this test since + * the fill value design has been modified. * *------------------------------------------------------------------------- */ static int test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) { - hid_t file=-1, space=-1, dcpl=-1, comp_type_id=-1; - hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1, - dset6=-1, /* dset7=-1, */ dset8=-1, dset9=-1; + hid_t file=-1, space=-1, dcpl=-1, comp_type_id=-1; + hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1, + dset6=-1, /* dset7=-1, */ dset8=-1, dset9=-1; hsize_t cur_size[5] = {2, 8, 8, 4, 2}; - hsize_t ch_size[5] = {1, 1, 1, 4, 1}; - short rd_s, fill_s = 0x1234; - long rd_l, fill_l = 0x4321; - char filename[1024]; - H5D_space_status_t allocation; + hsize_t ch_size[5] = {1, 1, 1, 4, 1}; + short rd_s, fill_s = 0x1234; + long rd_l, fill_l = 0x4321; + char filename[1024]; + H5D_space_status_t allocation; H5D_alloc_time_t alloc_time; - H5D_fill_time_t fill_time; + H5D_fill_time_t fill_time; comp_datatype rd_c, fill_ctype; if(H5D_CHUNKED==layout) { - TESTING("chunked dataset creation"); + TESTING("chunked dataset creation"); } else if(H5D_COMPACT==layout) { TESTING("compact dataset creation"); } else { - TESTING("contiguous dataset creation"); + TESTING("contiguous dataset creation"); } /* @@ -410,11 +410,11 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) */ h5_fixname(base_name, fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if((space=H5Screate_simple(5, cur_size, cur_size)) < 0) goto error; if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5D_CHUNKED==layout) { - if(H5Pset_chunk(dcpl, 5, ch_size) < 0) goto error; + if(H5Pset_chunk(dcpl, 5, ch_size) < 0) goto error; } else if(H5D_COMPACT==layout) { if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) goto error; } @@ -444,21 +444,21 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_value(dcpl, H5T_NATIVE_SHORT, &fill_s) < 0) goto error; #endif if((dset1=H5Dcreate2(file, "dset1", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; + goto error; /* 3. Large to small fill conversion */ #ifndef NO_FILLING if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error; #endif if((dset2=H5Dcreate2(file, "dset2", H5T_NATIVE_SHORT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; + goto error; /* 4. No conversion */ #ifndef NO_FILLING if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error; #endif if((dset3=H5Dcreate2(file, "dset3", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; + goto error; /* 5. late space allocation and never write fill value */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; @@ -504,7 +504,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 3. Write fill value at space allocation time */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; if((dset6 = H5Dcreate2(file, "dset6", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; + goto error; /* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ @@ -531,7 +531,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* Open the file and get the dataset fill value from each dataset */ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - goto error; + goto error; /* I. Check cases for late space allocation except compact dataset */ if(H5D_COMPACT != layout) { @@ -541,10 +541,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) #ifndef NO_FILLING if(H5Pget_fill_value(dcpl, H5T_NATIVE_SHORT, &rd_s) < 0) goto error; if(rd_s != fill_s) { - H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got %d, set %d\n", rd_s, fill_s); - goto error; + H5_FAILED(); + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got %d, set %d\n", rd_s, fill_s); + goto error; } #endif if(H5Dclose(dset1) < 0) goto error; @@ -556,10 +556,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) #ifndef NO_FILLING if(H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0) goto error; if(rd_l!=fill_l) { - H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got %ld, set %ld\n", rd_l, fill_l); - goto error; + H5_FAILED(); + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got %ld, set %ld\n", rd_l, fill_l); + goto error; } #endif if(H5Dclose(dset2) < 0) goto error; @@ -571,10 +571,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) #ifndef NO_FILLING if(H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0) goto error; if(rd_l != fill_l) { - H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got %ld, set %ld\n", rd_l, fill_l); - goto error; + H5_FAILED(); + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got %ld, set %ld\n", rd_l, fill_l); + goto error; } #endif if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error; @@ -582,12 +582,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); - printf(" Got %d\n", alloc_time); + HDprintf(" Got %d\n", alloc_time); } if(fill_time != H5D_FILL_TIME_ALLOC) { H5_FAILED(); puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); - printf(" Got %d\n", fill_time); + HDprintf(" Got %d\n", fill_time); } if(H5Dclose(dset3) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -598,21 +598,21 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) { H5_FAILED(); puts(" Got allocated space instead of unallocated."); - printf(" Got %d\n", allocation); + HDprintf(" Got %d\n", allocation); goto error; } if((dcpl = H5Dget_create_plist(dset4)) < 0) goto error; if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error; if(H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if(alloc_time != H5D_ALLOC_TIME_LATE) { - H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); - printf(" Got %d\n", alloc_time); + H5_FAILED(); + puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); + HDprintf(" Got %d\n", alloc_time); } if(fill_time != H5D_FILL_TIME_NEVER) { - H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); - printf(" Got %d\n", fill_time); + H5_FAILED(); + puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); + HDprintf(" Got %d\n", fill_time); } if(H5Dclose(dset4) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -624,7 +624,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') { H5_FAILED(); puts(" Got wrong fill value"); - printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", + HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } if(H5Dclose(dset9) < 0) goto error; @@ -639,21 +639,21 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Dget_space_status(dset5, &allocation) < 0) goto error; if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) { H5_FAILED(); - printf(" %d: Got unallocated space instead of allocated.\n",__LINE__); - printf(" Got %d\n", allocation); + HDprintf(" %d: Got unallocated space instead of allocated.\n",__LINE__); + HDprintf(" Got %d\n", allocation); goto error; } if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error; if(alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); - printf(" Got %d\n", alloc_time); + HDprintf(" Got %d\n", alloc_time); } if(H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if(fill_time != H5D_FILL_TIME_NEVER) { H5_FAILED(); puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); - printf(" Got %d\n", fill_time); + HDprintf(" Got %d\n", fill_time); } if(H5Dclose(dset5) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -664,28 +664,28 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Dget_space_status(dset6, &allocation) < 0) goto error; if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) { H5_FAILED(); - printf(" %d: Got unallocated space instead of allocated.\n",__LINE__); - printf(" Got %d\n", allocation); + HDprintf(" %d: Got unallocated space instead of allocated.\n",__LINE__); + HDprintf(" Got %d\n", allocation); goto error; } if(H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0) goto error; if(rd_l != fill_l) { H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got %ld, set %ld\n", rd_l, fill_l); + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got %ld, set %ld\n", rd_l, fill_l); goto error; } if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error; if(alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); - printf(" Got %d\n", alloc_time); + HDprintf(" Got %d\n", alloc_time); } if(H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if(fill_time != H5D_FILL_TIME_ALLOC) { H5_FAILED(); puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); - printf(" Got %d\n", fill_time); + HDprintf(" Got %d\n", fill_time); } if(H5Dclose(dset6) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -697,8 +697,8 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') { H5_FAILED(); puts(" Got wrong fill value"); - printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", - (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); + HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", + (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } if(H5Dclose(dset8) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -710,56 +710,56 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) error: H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Sclose(space); + H5Pclose(dcpl); + H5Sclose(space); if(H5D_COMPACT != layout) { - H5Dclose(dset1); - H5Dclose(dset2); - H5Dclose(dset3); + H5Dclose(dset1); + H5Dclose(dset2); + H5Dclose(dset3); H5Dclose(dset4); H5Dclose(dset9); } H5Dclose(dset5); H5Dclose(dset6); - H5Dclose(dset8); - H5Fclose(file); + H5Dclose(dset8); + H5Fclose(file); } H5E_END_TRY; return 1; } /*------------------------------------------------------------------------- - * Function: test_rdwr_cases + * Function: test_rdwr_cases * - * Purpose: Tests fill values read and write for datasets. + * Purpose: Tests fill values read and write for datasets. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * * Modifications: - * This function is called by test_rdwr to write and read - * dataset for different cases. + * This function is called by test_rdwr to write and read + * dataset for different cases. * *------------------------------------------------------------------------- */ static int test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, - H5D_fill_time_t fill_time, H5D_layout_t layout, - H5T_class_t datatype, hid_t ctype_id) + H5D_fill_time_t fill_time, H5D_layout_t layout, + H5T_class_t datatype, hid_t ctype_id) { - hid_t fspace=-1, mspace=-1, dset1=-1, dset2=-1; - hsize_t cur_size[5] = {2, 8, 8, 4, 2}; - hsize_t one[5] = {1, 1, 1, 1, 1}; - hsize_t hs_size[5], hs_stride[5]; - hsize_t hs_offset[5], nelmts; - int fillval=(-1), val_rd, should_be; - int i, j, *buf=NULL, odd; + hid_t fspace=-1, mspace=-1, dset1=-1, dset2=-1; + hsize_t cur_size[5] = {2, 8, 8, 4, 2}; + hsize_t one[5] = {1, 1, 1, 1, 1}; + hsize_t hs_size[5], hs_stride[5]; + hsize_t hs_offset[5], nelmts; + int fillval=(-1), val_rd, should_be; + int i, j, *buf=NULL, odd; unsigned u; comp_datatype rd_c, fill_c, should_be_c; - comp_datatype *buf_c=NULL; + comp_datatype *buf_c=NULL; H5D_space_status_t allocation; if(datatype == H5T_INTEGER) { @@ -788,27 +788,27 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if((mspace = H5Screate_simple(5, one, NULL)) < 0) goto error; for (i=0; i<1000; i++) { - for (j=0; j<5; j++) - hs_offset[j] = (hsize_t)HDrand() % cur_size[j]; - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, - one, NULL) < 0) goto error; + for (j=0; j<5; j++) + hs_offset[j] = (hsize_t)HDrand() % cur_size[j]; + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, + one, NULL) < 0) goto error; - /* case for atomic datatype */ - if(datatype==H5T_INTEGER) { + /* case for atomic datatype */ + if(datatype==H5T_INTEGER) { if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, - &val_rd) < 0) goto error; - if(fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) { - H5_FAILED(); + &val_rd) < 0) goto error; + if(fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) { + H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); - HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, " - "Fill value: %u\n", - hs_offset[0], hs_offset[1], - hs_offset[2], hs_offset[3], - hs_offset[4], val_rd, fillval); - goto error; - } - /* case for compound datatype */ - } + HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, " + "Fill value: %u\n", + hs_offset[0], hs_offset[1], + hs_offset[2], hs_offset[3], + hs_offset[4], val_rd, fillval); + goto error; + } + /* case for compound datatype */ + } else if(datatype==H5T_COMPOUND) { if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, &rd_c) < 0) goto error; @@ -822,7 +822,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, - (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z); + (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z); goto error; } } @@ -871,8 +871,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, else if(datatype == H5T_COMPOUND) { /*check for overflow*/ HDassert((nelmts * sizeof(comp_datatype)) == - (hsize_t)((size_t)(nelmts * sizeof(comp_datatype)))); - buf_c = (comp_datatype *)HDmalloc((size_t)nelmts * sizeof(comp_datatype)); + (hsize_t)((size_t)(nelmts * sizeof(comp_datatype)))); + buf_c = (comp_datatype *)HDmalloc((size_t)nelmts * sizeof(comp_datatype)); if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0) goto error; @@ -910,24 +910,24 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, else if(datatype == H5T_COMPOUND) { HDmemset(buf_c, 0, ((size_t)nelmts * sizeof(comp_datatype))); for(u = 0; u < nelmts; u++) { - buf_c[u].a = 1111.11F; - buf_c[u].x = 2222; - buf_c[u].y = 3333.3333F; - buf_c[u].z = 'd'; - } + buf_c[u].a = 1111.11F; + buf_c[u].x = 2222; + buf_c[u].y = 3333.3333F; + buf_c[u].z = 'd'; + } if(H5Dwrite(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0) goto error; } /* Check if space is allocated */ if(datatype==H5T_INTEGER && H5Dget_space_status(dset1, &allocation) < 0) - goto error; + goto error; if(datatype==H5T_COMPOUND && H5Dget_space_status(dset2, &allocation) < 0) goto error; if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) { H5_FAILED(); - printf(" %d: Got unallocated space instead of allocated.\n",__LINE__); - printf(" Got %d\n", allocation); + HDprintf(" %d: Got unallocated space instead of allocated.\n",__LINE__); + HDprintf(" Got %d\n", allocation); goto error; } HDfree(buf); @@ -938,86 +938,86 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if((mspace = H5Screate_simple(5, one, NULL)) < 0) goto error; for(i = 0; i < 1000; i++) { - for(j = 0, odd = 0; j < 5; j++) { - hs_offset[j] = (hsize_t)HDrand() % cur_size[j]; - odd += (int)(hs_offset[j]%2); - } /* end for */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) + for(j = 0, odd = 0; j < 5; j++) { + hs_offset[j] = (hsize_t)HDrand() % cur_size[j]; + odd += (int)(hs_offset[j]%2); + } /* end for */ + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) goto error; - /* case for atomic datatype */ + /* case for atomic datatype */ if(datatype==H5T_INTEGER) { - if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0) + if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0) goto error; if(fill_time == H5D_FILL_TIME_ALLOC) { should_be = odd ? fillval : 9999; if(val_rd!=should_be) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__); - printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, " + HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, " "should be: %u\n", (long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3], (long)hs_offset[4], val_rd, should_be); goto error; } - } - else if(fill_time == H5D_FILL_TIME_NEVER && !odd) { - should_be = 9999; - if(val_rd!=should_be) { - H5_FAILED(); + } + else if(fill_time == H5D_FILL_TIME_NEVER && !odd) { + should_be = 9999; + if(val_rd!=should_be) { + H5_FAILED(); HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__); - printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, " - "should be: %u\n", - (long)hs_offset[0], (long)hs_offset[1], - (long)hs_offset[2], (long)hs_offset[3], - (long)hs_offset[4], val_rd, should_be); - goto error; - } - } else if(fill_time == H5D_FILL_TIME_NEVER && odd) { - /*Trash data. Don't compare*/ - } - } /* end for datatype==H5T_INTEGER */ - /* case for compound datatype */ - else if(datatype==H5T_COMPOUND) { + HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, " + "should be: %u\n", + (long)hs_offset[0], (long)hs_offset[1], + (long)hs_offset[2], (long)hs_offset[3], + (long)hs_offset[4], val_rd, should_be); + goto error; + } + } else if(fill_time == H5D_FILL_TIME_NEVER && odd) { + /*Trash data. Don't compare*/ + } + } /* end for datatype==H5T_INTEGER */ + /* case for compound datatype */ + else if(datatype==H5T_COMPOUND) { if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, &rd_c) < 0) goto error; if(fill_time == H5D_FILL_TIME_ALLOC) { - if(odd) { - should_be_c.a=fill_c.a; - should_be_c.x=fill_c.x; - should_be_c.y=fill_c.y; - should_be_c.z=fill_c.z; - } else { - should_be_c.a=buf_c[0].a; - should_be_c.x=buf_c[0].x; - should_be_c.y=buf_c[0].y; - should_be_c.z=buf_c[0].z; - } - if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x || - !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) { + if(odd) { + should_be_c.a=fill_c.a; + should_be_c.x=fill_c.x; + should_be_c.y=fill_c.y; + should_be_c.z=fill_c.z; + } else { + should_be_c.a=buf_c[0].a; + should_be_c.x=buf_c[0].x; + should_be_c.y=buf_c[0].y; + should_be_c.z=buf_c[0].z; + } + if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x || + !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__); - printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c " + HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c " "should be: %f,%d,%f,%c\n", (long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3], (long)hs_offset[4], - (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a, - should_be_c.x,should_be_c.y,should_be_c.z); + (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a, + should_be_c.x,should_be_c.y,should_be_c.z); goto error; - } - } /* end for fill_time == H5D_FILL_TIME_ALLOC */ - else if(fill_time == H5D_FILL_TIME_NEVER && !odd) { + } + } /* end for fill_time == H5D_FILL_TIME_ALLOC */ + else if(fill_time == H5D_FILL_TIME_NEVER && !odd) { should_be_c.a=buf_c[0].a; should_be_c.x=buf_c[0].x; should_be_c.y=buf_c[0].y; should_be_c.z=buf_c[0].z; - if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x || - !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) { + if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x || + !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__); - printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c " + HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c " "should be: %f,%d,%f,%c\n", (long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3], @@ -1026,11 +1026,11 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, should_be_c.x,should_be_c.y,should_be_c.z); goto error; } - } /* end for fill_time == H5D_FILL_TIME_NEVER */ + } /* end for fill_time == H5D_FILL_TIME_NEVER */ else if(fill_time == H5D_FILL_TIME_NEVER && odd) { /*Trash data. Don't compare*/ } - } /* end for datatype==H5T_COMPOUND */ + } /* end for datatype==H5T_COMPOUND */ } if(datatype == H5T_COMPOUND) { HDfree(buf_c); @@ -1045,16 +1045,16 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, error: H5E_BEGIN_TRY { - if(datatype==H5T_INTEGER) H5Dclose(dset1); - if(datatype==H5T_COMPOUND) H5Dclose(dset2); - H5Sclose(fspace); - H5Sclose(mspace); + if(datatype==H5T_INTEGER) H5Dclose(dset1); + if(datatype==H5T_COMPOUND) H5Dclose(dset2); + H5Sclose(fspace); + H5Sclose(mspace); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_rdwr * @@ -1068,8 +1068,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, * Thursday, October 1, 1998 * * Modifications: - * Many new cases have been added to this test since the - * fill value design is modified. + * Many new cases have been added to this test since the + * fill value design is modified. * *------------------------------------------------------------------------- */ @@ -1077,9 +1077,9 @@ static int test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) { char filename[1024]; - hid_t file=-1, dcpl=-1, ctype_id=-1; + hid_t file=-1, dcpl=-1, ctype_id=-1; hsize_t ch_size[5] = {2, 8, 8, 4, 2}; - int nerrors=0; + int nerrors=0; int fillval = 0x4c70f1cd; comp_datatype fill_ctype={0,0,0,0}; @@ -1154,7 +1154,7 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) fill_ctype.y = 4444.4444F; if(H5Pset_fill_value(dcpl, ctype_id, &fill_ctype) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset11", &fill_ctype, H5D_FILL_TIME_ALLOC, - layout, H5T_COMPOUND, ctype_id); + layout, H5T_COMPOUND, ctype_id); if(H5Pclose(dcpl) < 0) goto error; if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; @@ -1211,7 +1211,7 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) if(nerrors) - goto error; + goto error; if(H5Pclose(dcpl) < 0) goto error; if(H5Tclose(ctype_id) < 0) goto error; if(H5Fclose(file) < 0) goto error; @@ -1221,22 +1221,22 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) error: H5E_BEGIN_TRY { H5Pclose(dcpl); - H5Tclose(ctype_id); + H5Tclose(ctype_id); H5Fclose(file); } H5E_END_TRY; return nerrors; } - + /*------------------------------------------------------------------------- - * Function: test_extend_init_integer + * Function: test_extend_init_integer * - * Purpose: Initializes integer values + * Purpose: Initializes integer values * - * Return: Success: 0 - * Failure: < 0 + * Return: Success: 0 + * Failure: < 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1255,16 +1255,16 @@ test_extend_init_integer(void *_buf, size_t nelmts, const void *_val) return 0; } /* end test_extend_init_integer() */ - + /*------------------------------------------------------------------------- - * Function: test_extend_verify_integer + * Function: test_extend_verify_integer * - * Purpose: Verifies integer values + * Purpose: Verifies integer values * - * Return: Success: 0 - * Failure: < 0 + * Return: Success: 0 + * Failure: < 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1293,16 +1293,16 @@ error: return -1; } /* end test_extend_verify_integer() */ - + /*------------------------------------------------------------------------- - * Function: test_extend_release_integer + * Function: test_extend_release_integer * - * Purpose: Release element of integer value + * Purpose: Release element of integer value * - * Return: Success: 0 - * Failure: < 0 + * Return: Success: 0 + * Failure: < 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1313,16 +1313,16 @@ test_extend_release_integer(void H5_ATTR_UNUSED *_elmt) return 0; } /* end test_extend_release_integer() */ - + /*------------------------------------------------------------------------- - * Function: test_extend_init_cmpd_vl + * Function: test_extend_init_cmpd_vl * - * Purpose: Initializes compound+vl values + * Purpose: Initializes compound+vl values * - * Return: Success: 0 - * Failure: < 0 + * Return: Success: 0 + * Failure: < 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1348,16 +1348,16 @@ test_extend_init_cmpd_vl(void *_buf, size_t nelmts, const void *_val) return 0; } /* end test_extend_init_cmpd_vl() */ - + /*------------------------------------------------------------------------- - * Function: test_extend_verify_cmpd_vl + * Function: test_extend_verify_cmpd_vl * - * Purpose: Verifies compound+vl values + * Purpose: Verifies compound+vl values * - * Return: Success: 0 - * Failure: < 0 + * Return: Success: 0 + * Failure: < 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1389,16 +1389,16 @@ error: return -1; } /* end test_extend_verify_cmpd_vl() */ - + /*------------------------------------------------------------------------- - * Function: test_extend_release_cmpd_vl + * Function: test_extend_release_cmpd_vl * - * Purpose: Release element of compound+vl value + * Purpose: Release element of compound+vl value * - * Return: Success: 0 - * Failure: < 0 + * Return: Success: 0 + * Failure: < 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1415,16 +1415,16 @@ test_extend_release_cmpd_vl(void *_elmt) return 0; } /* end test_extend_release_integer() */ - + /*------------------------------------------------------------------------- - * Function: test_extend_cases + * Function: test_extend_cases * - * Purpose: Called to test fill values with various different values + * Purpose: Called to test fill values with various different values * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 3, 2007 * *------------------------------------------------------------------------- @@ -1433,13 +1433,13 @@ static int test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_size, hsize_t *start_size, hsize_t *max_size, hid_t dtype, void *fillval) { - hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */ - hid_t dset = -1; /* Dataset ID */ + hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */ + hid_t dset = -1; /* Dataset ID */ hid_t dcpl = -1; /* Dataset creation property list */ - hsize_t extend_size[5]; /* Dimensions to extend to */ - hsize_t one[5] = {1, 1, 1, 1, 1}; /* Dimensions of single element dataspace */ - hsize_t hs_size[5], hs_stride[5], hs_offset[5]; - size_t nelmts; + hsize_t extend_size[5]; /* Dimensions to extend to */ + hsize_t one[5] = {1, 1, 1, 1, 1}; /* Dimensions of single element dataspace */ + hsize_t hs_size[5], hs_stride[5], hs_offset[5]; + size_t nelmts; H5T_class_t dtype_class; /* Class of datatype */ int (*init_rtn)(void *, size_t, const void *); int (*verify_rtn)(unsigned, const hsize_t *, const void *, const void *); @@ -1447,12 +1447,12 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, size_t val_size; /* Size of element */ void *val_rd, *odd_val; const void *init_val, *should_be, *even_val; - int val_rd_i, init_val_i = 9999; + int val_rd_i, init_val_i = 9999; comp_vl_datatype init_val_c = {87, "baz", "mumble", 129}; comp_vl_datatype val_rd_c; - void *buf = NULL; - unsigned odd; /* Whether an odd or even coord. was read */ - unsigned i, j; /* Local index variables */ + void *buf = NULL; + unsigned odd; /* Whether an odd or even coord. was read */ + unsigned i, j; /* Local index variables */ /* Make copy of dataset creation property list */ if((dcpl = H5Pcopy(_dcpl)) < 0) TEST_ERROR @@ -1503,14 +1503,14 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR for(i = 0; i < 1000; i++) { /* Set offset for random element */ - for(j = 0; j < 5; j++) - hs_offset[j] = (hsize_t)HDrand() % start_size[j]; + for(j = 0; j < 5; j++) + hs_offset[j] = (hsize_t)HDrand() % start_size[j]; /* Select the random element */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR /* Read the random element */ - if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR + if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR /* Verify the element read in */ if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, fillval) < 0) TEST_ERROR @@ -1526,10 +1526,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, /* Initialize dataspace & hyperslab info */ for(i = 0, nelmts = 1; i < 5; i++) { - hs_size[i] = (start_size[i] + 1) / 2; - hs_offset[i] = 0; - hs_stride[i] = 2; - nelmts *= hs_size[i]; + hs_size[i] = (start_size[i] + 1) / 2; + hs_offset[i] = 0; + hs_stride[i] = 2; + nelmts *= hs_size[i]; } /* end for */ /* Check for overflow */ @@ -1556,19 +1556,19 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR for(i = 0; i < 1000; i++) { /* Set offset for random element */ - for(j = 0, odd = 0; j < 5; j++) { - hs_offset[j] = (hsize_t)HDrand() % start_size[j]; - odd += (unsigned)(hs_offset[j] % 2); - } /* end for */ + for(j = 0, odd = 0; j < 5; j++) { + hs_offset[j] = (hsize_t)HDrand() % start_size[j]; + odd += (unsigned)(hs_offset[j] % 2); + } /* end for */ /* Select the random element */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR /* Read the random element */ - if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR + if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR /* Verify the element read in */ - should_be = odd ? odd_val : even_val; + should_be = odd ? odd_val : even_val; if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR /* Release any VL components */ @@ -1594,22 +1594,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR for(i = 0; i < 1000; i++) { /* Set offset for random element */ - for(j = 0, odd = 0; j < 5; j++) { - hs_offset[j] = (hsize_t)HDrand() % extend_size[j]; - if(hs_offset[j] >= start_size[j]) - odd = 1; - else - odd += (unsigned)(hs_offset[j] % 2); - } /* end for */ + for(j = 0, odd = 0; j < 5; j++) { + hs_offset[j] = (hsize_t)HDrand() % extend_size[j]; + if(hs_offset[j] >= start_size[j]) + odd = 1; + else + odd += (unsigned)(hs_offset[j] % 2); + } /* end for */ /* Select the random element */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR /* Read the random element */ - if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR + if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR /* Verify the element read in */ - should_be = odd ? odd_val : even_val; + should_be = odd ? odd_val : even_val; if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR /* Release any VL components */ @@ -1633,22 +1633,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR for(i = 0; i < 1000; i++) { /* Set offset for random element */ - for(j = 0, odd = 0; j < 5; j++) { - hs_offset[j] = (hsize_t)HDrand() % max_size[j]; - if(hs_offset[j] >= start_size[j]) - odd = 1; - else - odd += (unsigned)(hs_offset[j] % 2); - } /* end for */ + for(j = 0, odd = 0; j < 5; j++) { + hs_offset[j] = (hsize_t)HDrand() % max_size[j]; + if(hs_offset[j] >= start_size[j]) + odd = 1; + else + odd += (unsigned)(hs_offset[j] % 2); + } /* end for */ /* Select the random element */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR /* Read the random element */ - if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR + if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR /* Verify the element read in */ - should_be = odd ? odd_val : even_val; + should_be = odd ? odd_val : even_val; if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR /* Release any VL components */ @@ -1674,22 +1674,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR for(i = 0; i < 1000; i++) { /* Set offset for random element */ - for(j = 0, odd = 0; j < 5; j++) { - hs_offset[j] = (hsize_t)HDrand() % extend_size[j]; - if(hs_offset[j] >= start_size[j]) - odd = 1; - else - odd += (unsigned)(hs_offset[j] % 2); - } /* end for */ + for(j = 0, odd = 0; j < 5; j++) { + hs_offset[j] = (hsize_t)HDrand() % extend_size[j]; + if(hs_offset[j] >= start_size[j]) + odd = 1; + else + odd += (unsigned)(hs_offset[j] % 2); + } /* end for */ /* Select the random element */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR /* Read the random element */ - if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR + if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR /* Verify the element read in */ - should_be = odd ? odd_val : even_val; + should_be = odd ? odd_val : even_val; if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR /* Release any VL components */ @@ -1767,22 +1767,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, /* Read some data and make sure it's the right value */ for(i = 0; i < 1000; i++) { /* Set offset for random element */ - for(j = 0, odd = 0; j < 5; j++) { - hs_offset[j] = (hsize_t)HDrand() % extend_size[j]; - if(hs_offset[j] >= start_size[j]) - odd = 1; - else - odd += (unsigned)(hs_offset[j] % 2); - } /* end for */ + for(j = 0, odd = 0; j < 5; j++) { + hs_offset[j] = (hsize_t)HDrand() % extend_size[j]; + if(hs_offset[j] >= start_size[j]) + odd = 1; + else + odd += (unsigned)(hs_offset[j] % 2); + } /* end for */ /* Select the random element */ - if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR + if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR /* Read the random element */ - if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR + if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR /* Verify the element read in */ - should_be = odd ? odd_val : even_val; + should_be = odd ? odd_val : even_val; if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR /* Release any VL components */ @@ -1811,26 +1811,26 @@ error: if(buf) HDfree(buf); H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Dclose(dset); - H5Sclose(fspace); - H5Sclose(mspace); + H5Pclose(dcpl); + H5Dclose(dset); + H5Sclose(fspace); + H5Sclose(mspace); } H5E_END_TRY; return -1; } /* end test_extend_cases() */ - + /*------------------------------------------------------------------------- - * Function: test_extend + * Function: test_extend * - * Purpose: Test that filling works okay when a dataset is extended. + * Purpose: Test that filling works okay when a dataset is extended. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, October 5, 1998 * * Modifications: @@ -1840,30 +1840,30 @@ error: static int test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) { - hid_t file = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t cmpd_vl_tid = -1; /* Compound+vl datatype ID */ - hsize_t start_size[5] = {8, 8, 8, 4, 2}; - hsize_t max_size[5] = {32, 32, 32, 16, 8}; - hsize_t ch_size[5] = {1, 8, 8, 4, 2}; + hid_t file = -1; /* File ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t cmpd_vl_tid = -1; /* Compound+vl datatype ID */ + hsize_t start_size[5] = {8, 8, 8, 4, 2}; + hsize_t max_size[5] = {32, 32, 32, 16, 8}; + hsize_t ch_size[5] = {1, 8, 8, 4, 2}; #ifdef NO_FILLING - int fillval_i = 0; + int fillval_i = 0; #else - int fillval_i = 0x4c70f1cd; + int fillval_i = 0x4c70f1cd; #endif comp_vl_datatype fillval_c = {32, "foo", "bar", 64}; /* Fill value for compound+vl datatype tests */ - char filename[1024]; + char filename[1024]; /* Print testing message */ if(H5D_CHUNKED == layout) - TESTING("chunked dataset extend") + TESTING("chunked dataset extend") else - TESTING("contiguous dataset extend") + TESTING("contiguous dataset extend") /* Create dataset creation property list */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR if(H5D_CHUNKED == layout) - if(H5Pset_chunk(dcpl, 5, ch_size) < 0) TEST_ERROR + if(H5Pset_chunk(dcpl, 5, ch_size) < 0) TEST_ERROR #if 1 /* @@ -1877,13 +1877,13 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) * below. */ if(H5D_CONTIGUOUS==layout) { - max_size[0] = (max_size[0] * max_size[1] * max_size[2] * - max_size[3] * max_size[4]) / - (start_size[1] * start_size[2] * start_size[3] * start_size[4]); - max_size[1] = start_size[1]; - max_size[2] = start_size[2]; - max_size[3] = start_size[3]; - max_size[4] = start_size[4]; + max_size[0] = (max_size[0] * max_size[1] * max_size[2] * + max_size[3] * max_size[4]) / + (start_size[1] * start_size[2] * start_size[3] * start_size[4]); + max_size[1] = start_size[1]; + max_size[2] = start_size[2]; + max_size[3] = start_size[3]; + max_size[4] = start_size[4]; } #endif @@ -1896,13 +1896,13 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) */ if(H5D_CONTIGUOUS==layout) { int fd; - hsize_t nelmts; + hsize_t nelmts; - nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4]; - if((fd = HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 || - HDclose(fd) < 0) goto error; - if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0) - goto error; + nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4]; + if((fd = HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 || + HDclose(fd) < 0) goto error; + if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0) + goto error; } #endif @@ -1914,9 +1914,9 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) * errors described above or `unable to select fill value region'. */ if(H5D_CONTIGUOUS==layout) { - SKIPPED(); - puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator"); - goto skip; + SKIPPED(); + puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator"); + goto skip; } #endif @@ -1947,20 +1947,20 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) error: H5E_BEGIN_TRY { H5Tclose(cmpd_vl_tid); - H5Pclose(dcpl); - H5Fclose(file); + H5Pclose(dcpl); + H5Fclose(file); } H5E_END_TRY; return 1; skip: H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Fclose(file); + H5Pclose(dcpl); + H5Fclose(file); } H5E_END_TRY; return 0; } /* end test_extend() */ - + /*------------------------------------------------------------------------- * Function: test_compatible * @@ -1992,7 +1992,7 @@ test_compatible(void) TESTING("contiguous dataset compatibility with v. 1.4"); if((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { - printf(" Could not open file %s. Try set $srcdir to point at the " + HDprintf(" Could not open file %s. Try set $srcdir to point at the " "source directory of test\n", testfile); goto error; } @@ -2002,8 +2002,8 @@ test_compatible(void) if(H5Pfill_value_defined(dcpl1, &status) < 0) goto error; if(status != H5D_FILL_VALUE_UNDEFINED) { H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got status=%ld, suppose to be H5D_FILL_VALUE_UNDEFINED\n", + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got status=%ld, suppose to be H5D_FILL_VALUE_UNDEFINED\n", (long)status); goto error; } @@ -2012,7 +2012,7 @@ test_compatible(void) if(dims[0] != 8 || dims[1] != 8) { H5_FAILED(); puts(" Got a different dimension size than what was set."); - printf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); + HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); goto error; } if((mspace = H5Screate_simple(2, one, NULL)) < 0) goto error; @@ -2023,7 +2023,7 @@ test_compatible(void) if(val_rd != 0) { H5_FAILED(); puts(" Got a different value than what was set."); - printf(" Got %ld, set 0\n", (long)val_rd); + HDprintf(" Got %ld, set 0\n", (long)val_rd); goto error; } if(H5Pclose(dcpl1) < 0) goto error; @@ -2037,16 +2037,16 @@ test_compatible(void) if(H5Pfill_value_defined(dcpl2, &status) < 0) goto error; if(status != H5D_FILL_VALUE_USER_DEFINED) { H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got status=%ld, suppose to be H5D_FILL_VALUE_USER_DEFINED\n", + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got status=%ld, suppose to be H5D_FILL_VALUE_USER_DEFINED\n", (long)status); goto error; } if(H5Pget_fill_value(dcpl2, H5T_NATIVE_INT, &rd_fill) < 0) goto error; if(rd_fill != fill_val) { H5_FAILED(); - printf(" %d: Got a different fill value than what was set.",__LINE__); - printf(" Got %ld, set %ld\n", (long)rd_fill, (long)fill_val); + HDprintf(" %d: Got a different fill value than what was set.",__LINE__); + HDprintf(" Got %ld, set %ld\n", (long)rd_fill, (long)fill_val); goto error; } fspace = -1; @@ -2056,7 +2056,7 @@ test_compatible(void) if(dims[0] != 8 || dims[1] != 8) { H5_FAILED(); puts(" Got a different dimension size than what was set."); - printf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); + HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); goto error; } if((mspace=H5Screate_simple(2, one, NULL)) < 0) goto error; @@ -2067,7 +2067,7 @@ test_compatible(void) if(val_rd != fill_val) { H5_FAILED(); puts(" Got a different value than what was set."); - printf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val); + HDprintf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val); goto error; } if(H5Pclose(dcpl2) < 0) goto error; @@ -2096,20 +2096,20 @@ error: } /*------------------------------------------------------------------------- - * Function: test_partalloc_cases + * Function: test_partalloc_cases * - * Purpose: Tests fill values read and write for datasets. + * Purpose: Tests fill values read and write for datasets. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Joel Plutchak + * Programmer: Joel Plutchak * April 15, 2013 * * Modifications: - * This function is called by test_rdwr to write and read - * dataset for different cases of chunked datasets with + * This function is called by test_rdwr to write and read + * dataset for different cases of chunked datasets with * unallocated chunks. * *------------------------------------------------------------------------- @@ -2118,12 +2118,12 @@ error: static int test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time) { - hid_t fspace=-1, dset1=-1, rspace = -1; - herr_t ret; - hsize_t ds_size[2] = {4, 4}; - hsize_t max_size[2] = {H5S_UNLIMITED,4}; + hid_t fspace=-1, dset1=-1, rspace = -1; + herr_t ret; + hsize_t ds_size[2] = {4, 4}; + hsize_t max_size[2] = {H5S_UNLIMITED,4}; hsize_t chunk_size[2] = {1, 4}; - int fillval=(-1); + int fillval=(-1); int w_values[] = {42}; /* New value to be written */ int f_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */ int r_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */ @@ -2141,17 +2141,17 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t /* * Select a point in the file dataspace. */ - coord[0][0]=0; coord[0][1]=0; + coord[0][0]=0; coord[0][1]=0; if (H5Sselect_elements( fspace, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord)) goto error; - + /* * Write single data point to the dataset. */ if ((ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, w_values))< 0) { goto error; } - + /* Read a line/chunk and make sure values are right */ rspace = H5Screate_simple(2, chunk_size, NULL); @@ -2163,7 +2163,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) goto error; if ((ret = H5Sselect_all(rspace)) < 0) - goto error; + goto error; if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &r_values) < 0) goto error; @@ -2185,7 +2185,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t (r_values[3] != fillval)) { H5_FAILED(); HDfprintf(stdout, "%u: Allocated chunk value read was not correct.\n", (unsigned)__LINE__); - printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + HDprintf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", (long)r_values[0], (long)r_values[1], (long)r_values[2], (long)r_values[3], (long)w_values[0], (long)fillval, @@ -2199,7 +2199,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t (f_values[3] != fillval)) { H5_FAILED(); HDfprintf(stdout, "%u: Unallocated chunk value read was not correct.\n", (unsigned)__LINE__); - printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + HDprintf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", (long)f_values[0], (long)f_values[1], (long)f_values[2], (long)f_values[3], (long)fillval, (long)fillval, @@ -2218,15 +2218,15 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t error: H5E_BEGIN_TRY { - H5Dclose(dset1); - H5Sclose(fspace); - H5Sclose(rspace); + H5Dclose(dset1); + H5Sclose(fspace); + H5Sclose(rspace); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_partalloc * @@ -2246,9 +2246,9 @@ static int test_partalloc(hid_t fapl, const char *base_name) { char filename[1024]; - hid_t file=-1, dcpl=-1; + hid_t file=-1, dcpl=-1; hsize_t ch_size[2] = {1, 4}; - int nerrors=0; + int nerrors=0; TESTING("chunked dataset partially allocated I/O"); @@ -2262,86 +2262,86 @@ test_partalloc(hid_t fapl, const char *base_name) /* I. Test H5D_ALLOC_TIME_LATE space allocation cases */ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error; #ifdef DEBUG - fprintf( stdout, "\nALLOC_TIME_LATE\n" ); + HDfprintf( stdout, "\nALLOC_TIME_LATE\n" ); #endif /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_ALLOC\n" ); + HDfprintf( stdout, " FILL_TIME_ALLOC\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset1", H5D_FILL_TIME_ALLOC); - + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_NEVER\n" ); + HDfprintf( stdout, " FILL_TIME_NEVER\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset2", H5D_FILL_TIME_NEVER ); /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_IFSET\n" ); + HDfprintf( stdout, " FILL_TIME_IFSET\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset3", H5D_FILL_TIME_IFSET ); /* II. Test H5D_ALLOC_TIME_INCR space allocation cases */ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0) goto error; #ifdef DEBUG - fprintf( stdout, "\nALLOC_TIME_INCR\n" ); + HDfprintf( stdout, "\nALLOC_TIME_INCR\n" ); #endif /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_ALLOC\n" ); + HDfprintf( stdout, " FILL_TIME_ALLOC\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset4", H5D_FILL_TIME_ALLOC ); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_NEVER\n" ); + HDfprintf( stdout, " FILL_TIME_NEVER\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset5", H5D_FILL_TIME_NEVER ); /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_IFSET\n" ); + HDfprintf( stdout, " FILL_TIME_IFSET\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset6", H5D_FILL_TIME_IFSET ); /* III. Test H5D_ALLOC_TIME_EARLY space allocation cases */ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; #ifdef DEBUG - fprintf( stdout, "\nALLOC_TIME_EARLY\n" ); + HDfprintf( stdout, "\nALLOC_TIME_EARLY\n" ); #endif /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_ALLOC\n" ); + HDfprintf( stdout, " FILL_TIME_ALLOC\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset7", H5D_FILL_TIME_ALLOC ); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_NEVER\n" ); + HDfprintf( stdout, " FILL_TIME_NEVER\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset8", H5D_FILL_TIME_NEVER ); /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; #ifdef DEBUG - fprintf( stdout, " FILL_TIME_IFSET\n" ); + HDfprintf( stdout, " FILL_TIME_IFSET\n" ); #endif nerrors += test_partalloc_cases(file, dcpl, "dset9", H5D_FILL_TIME_IFSET ); if(nerrors) - goto error; + goto error; if(H5Pclose(dcpl) < 0) goto error; if(H5Fclose(file) < 0) goto error; PASSED(); @@ -2355,17 +2355,17 @@ test_partalloc(hid_t fapl, const char *base_name) return nerrors; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests fill values + * Purpose: Tests fill values * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * *------------------------------------------------------------------------- @@ -2373,9 +2373,9 @@ test_partalloc(hid_t fapl, const char *base_name) int main(int argc, char *argv[]) { - int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; - hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - unsigned new_format; /* Whether to use the new format or not */ + int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; + hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ + unsigned new_format; /* Whether to use the new format or not */ if(argc >= 2) { test_contig = test_chunk = test_compact = 0; diff --git a/test/filter_fail.c b/test/filter_fail.c index 76b3106..4be2547 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -270,15 +270,15 @@ test_filter_read(char *file_name, hid_t my_fapl) for(i = 0; i < DIM; i++) { if(i < DIM-2 && rbuf[i] != i) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d\n", i); - printf(" rbuf[%d]=%d\n", i, rbuf[i]); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d\n", i); + HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]); TEST_ERROR } else if(i >= DIM-2 && rbuf[i] != 0) { H5_FAILED(); - printf(" No value should be read.\n"); - printf(" At index %d\n", i); - printf(" rbuf[%d]=%d\n", i, rbuf[i]); + HDprintf(" No value should be read.\n"); + HDprintf(" At index %d\n", i); + HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]); TEST_ERROR } } @@ -310,15 +310,15 @@ test_filter_read(char *file_name, hid_t my_fapl) for(i = 0; i < DIM; i+=2) { if(i < DIM-2 && rbuf[i] != i) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d\n", i); - printf(" rbuf[%d]=%d\n", i, rbuf[i]); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d\n", i); + HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]); TEST_ERROR } else if(i >= DIM-2 && rbuf[i] != 0) { H5_FAILED(); - printf(" No value should be read.\n"); - printf(" At index %d\n", i); - printf(" rbuf[%d]=%d\n", i, rbuf[i]); + HDprintf(" No value should be read.\n"); + HDprintf(" At index %d\n", i); + HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]); TEST_ERROR } } @@ -347,17 +347,15 @@ error: * Purpose: Tests the library's behavior when a mandate filter returns * failure. * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Raymond Lu * 25 August 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ -int main(void) +int +main(void) { hid_t fapl; int mdc_nelmts = 0; @@ -398,12 +396,12 @@ int main(void) if (nerrors) TEST_ERROR - return 0; + HDexit(EXIT_SUCCESS); error: if (nerrors) { - printf("***** %u FAILURE%s! *****\n", + HDprintf("***** %u FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } -} +} /* end main() */ diff --git a/test/flush2.c b/test/flush2.c index 8ebfb75..0f15903 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -15,10 +15,10 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Friday, October 23, 1998 * - * Purpose: This is the second half of a two-part test that makes sure - * that a file can be read after an application crashes as long - * as the file was flushed first. This half tries to read the - * file created by the first half. + * Purpose: This is the second half of a two-part test that makes sure + * that a file can be read after an application crashes as long + * as the file was flushed first. This half tries to read the + * file created by the first half. */ #include "h5test.h" diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake index 73210ef..6faf37b 100644 --- a/test/flushrefreshTest.cmake +++ b/test/flushrefreshTest.cmake @@ -30,18 +30,18 @@ if (NOT PERL_EXECUTABLE) message (STATUS "Require PERL_EXECUTABLE to be defined") endif () -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) +if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) endif () -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) +if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 AND NOT MINGW) + if (WIN32 OR MINGW) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -69,10 +69,10 @@ endif () set (verification_done "0") while (verification_done LESS "1") message (STATUS "checking first stage:${TEST_FOLDER}/${TEST_ARGS1}") - if (EXISTS ${TEST_FOLDER}/${TEST_ERR}) + if (EXISTS "${TEST_FOLDER}/${TEST_ERR}") # Error exit script set (verification_done "3") - elseif (EXISTS ${TEST_FOLDER}/${TEST_ARGS1}) + elseif (EXISTS "${TEST_FOLDER}/${TEST_ARGS1}") file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1) list (LENGTH v1 len_v1) message (STATUS "v1:${v1} len_v1:${len_v1}") @@ -90,7 +90,7 @@ while (verification_done LESS "1") else () message (STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}") execute_process ( - COMMAND ${TEST_PROGRAM} ${param1} ${param2} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${TEST_PROGRAM} ${param1} ${param2} RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT} ERROR_FILE ${TEST_OUTPUT}.err @@ -112,10 +112,10 @@ endwhile () while (verification_done LESS "2") message (STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}") - if (EXISTS ${TEST_FOLDER}/${TEST_ERR}) + if (EXISTS "${TEST_FOLDER}/${TEST_ERR}") # Error exit script set (verification_done "3") - elseif (EXISTS ${TEST_FOLDER}/${TEST_ARGS1}) + elseif (EXISTS "${TEST_FOLDER}/${TEST_ARGS1}") file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1) list (LENGTH v1 len_v1) message (STATUS "v1:${v1} len_v1:${len_v1}") @@ -133,7 +133,7 @@ while (verification_done LESS "2") else () message (STATUS "execute: ${TEST_PROGRAM} ${param1}") execute_process ( - COMMAND ${TEST_PROGRAM} ${param1} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${TEST_PROGRAM} ${param1} RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT} ERROR_FILE ${TEST_OUTPUT}.err @@ -158,7 +158,7 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the return value is !=${TEST_EXPECT} bail out if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) - if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) message (STATUS "Output :\n${TEST_STREAM}") endif () diff --git a/test/gen_cross.c b/test/gen_cross.c index f7a1938..105895d 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -1255,13 +1255,11 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Create a file for cross_read.c test. + * Purpose: Create a file for cross_read.c test * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Raymond Lu - * Some time ago * *------------------------------------------------------------------------- */ @@ -1279,9 +1277,8 @@ main (void) * default file creation properties, and default file * access properties. */ - if((file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) - < 0) - {H5_FAILED(); AT(); return 1;} + if((file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; /* * Describe the size of the array and create the data space for fixed @@ -1291,82 +1288,84 @@ main (void) dimsf[0] = NX + 1; dimsf[1] = NY; if((filespace = H5Screate_simple(RANK, dimsf, NULL)) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; dimsf[0] = NX; - if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dimsf, NULL) - < 0) - {H5_FAILED(); AT(); return 1;} + if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dimsf, NULL) < 0) + TEST_ERROR; /* Create memory space. This does not include the extra row for fill * values. */ HDassert(dimsf[0] == NX); HDassert(dimsf[1] == NY); if((memspace = H5Screate_simple(RANK, dimsf, NULL)) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a regular dataset */ if(create_normal_dset(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with scale-offset filter */ if(create_scale_offset_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of DOUBLE with scale-offset filter */ if(create_scale_offset_dsets_double(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of CHAR with scale-offset filter */ if(create_scale_offset_dsets_char(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of SHORT with scale-offset filter */ if(create_scale_offset_dsets_short(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of INT with scale-offset filter */ if(create_scale_offset_dsets_int(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of LONG LONG with scale-offset filter */ if(create_scale_offset_dsets_long_long(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with fletcher filter */ if(create_fletcher_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with deflate filter */ if(create_deflate_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; #ifdef H5_HAVE_FILTER_SZIP /* Create a dataset of FLOAT with szip filter */ if(create_szip_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; #else /* H5_HAVE_FILTER_SZIP */ - puts("Szip filter is not enabled. Can't create the dataset."); + HDputs("Szip filter is not enabled. Can't create the dataset."); #endif /* H5_HAVE_FILTER_SZIP */ /* Create a dataset of FLOAT with shuffle filter */ if(create_shuffle_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with nbit filter */ if(create_nbit_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* * Close/release resources. */ if(H5Sclose(memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; if(H5Sclose(filespace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; if(H5Fclose(file) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; - return 0; -} + HDexit(EXIT_SUCCESS); + +error: + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/gheap.c b/test/gheap.c index 5b51c0e..09ba1cf 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -57,7 +57,7 @@ const char *FILENAME[] = { NULL }; - + /*------------------------------------------------------------------------- * Function: test_1 * @@ -68,7 +68,7 @@ const char *FILENAME[] = { * * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * *------------------------------------------------------------------------- @@ -165,7 +165,7 @@ error: return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- * Function: test_2 * @@ -176,7 +176,7 @@ error: * * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * *------------------------------------------------------------------------- @@ -264,7 +264,7 @@ test_2 (hid_t fapl) return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- * Function: test_3 * @@ -275,7 +275,7 @@ test_2 (hid_t fapl) * * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * *------------------------------------------------------------------------- @@ -353,7 +353,7 @@ test_3 (hid_t fapl) return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- * Function: test_4 * @@ -365,7 +365,7 @@ test_3 (hid_t fapl) * * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * *------------------------------------------------------------------------- @@ -448,7 +448,7 @@ test_4 (hid_t fapl) return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- * Function: test_ooo_indices * @@ -461,7 +461,7 @@ test_4 (hid_t fapl) * * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, October 26, 2009 * *------------------------------------------------------------------------- @@ -566,7 +566,7 @@ test_ooo_indices(hid_t fapl) return MAX(1, nerrors); } /* end test_ooo_indices */ - + /*------------------------------------------------------------------------- * Function: main * @@ -579,8 +579,8 @@ test_ooo_indices(hid_t fapl) int main (void) { - int nerrors = 0; - hid_t fapl_id = H5I_INVALID_HID; + int nerrors = 0; + hid_t fapl_id = H5I_INVALID_HID; hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_reset(); diff --git a/test/h5test.c b/test/h5test.c index d83c6e7..dd8d906 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -25,7 +25,7 @@ #include "H5srcdir.h" /* Necessary for h5_verify_cached_stabs() */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING #include "H5Gpkg.h" @@ -110,15 +110,14 @@ const char *LIBVER_NAMES[] = { NULL }; - /* 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, +static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname, size_t size, hbool_t nest_printf, hbool_t subst_for_superblock); - + /*------------------------------------------------------------------------- * Function: h5_errors * @@ -143,7 +142,7 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) return 0; } - + /*------------------------------------------------------------------------- * Function: h5_clean_files * @@ -172,7 +171,7 @@ h5_clean_files(const char *base_name[], hid_t fapl) return; } /* end h5_clean_files() */ - + /*------------------------------------------------------------------------- * Function: h5_delete_test_file * @@ -249,7 +248,7 @@ h5_delete_test_file(const char *base_name, hid_t fapl) } /* end h5_delete_test_file() */ #pragma GCC diagnostic pop - + /*------------------------------------------------------------------------- * Function: h5_delete_all_test_files * @@ -282,7 +281,7 @@ h5_delete_all_test_files(const char *base_name[], hid_t fapl) return; } /* end h5_delete_all_test_files() */ - + /*------------------------------------------------------------------------- * Function: h5_cleanup * @@ -315,7 +314,7 @@ h5_cleanup(const char *base_name[], hid_t fapl) return retval; } /* end h5_cleanup() */ - + /*------------------------------------------------------------------------- * Function: h5_test_shutdown * @@ -344,7 +343,7 @@ h5_test_shutdown(void) return; } /* end h5_test_shutdown() */ - + /*------------------------------------------------------------------------- * Function: h5_restore_err * @@ -366,7 +365,7 @@ h5_restore_err(void) err_func = NULL; } - + /*------------------------------------------------------------------------- * Function: h5_reset * @@ -408,7 +407,7 @@ h5_reset(void) * Cause the library to emit some diagnostics early so they don't * interfere with other formatted output. */ - sprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid()); + HDsprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid()); H5E_BEGIN_TRY { hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -421,7 +420,7 @@ h5_reset(void) #endif /* OLD_WAY */ } - + /*------------------------------------------------------------------------- * Function: h5_test_init * @@ -454,7 +453,7 @@ h5_test_init(void) return; } /* end h5_test_init() */ - + /*------------------------------------------------------------------------- * Function: h5_fixname * @@ -483,7 +482,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) return (h5_fixname_real(base_name, fapl, ".h5", fullname, size, FALSE, FALSE)); } - + /*------------------------------------------------------------------------- * Function: h5_fixname_superblock * @@ -509,7 +508,7 @@ h5_fixname_superblock(const char *base_name, hid_t fapl_id, char *fullname, size return (h5_fixname_real(base_name, fapl_id, ".h5", fullname, size, FALSE, TRUE)); } - + /*------------------------------------------------------------------------- * Function: h5_fixname_no_suffix * @@ -529,7 +528,7 @@ h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t s return (h5_fixname_real(base_name, fapl, NULL, fullname, size, FALSE, FALSE)); } - + /*------------------------------------------------------------------------- * Function: h5_fixname_printf * @@ -555,7 +554,7 @@ h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size return (h5_fixname_real(base_name, fapl, ".h5", fullname, size, TRUE, FALSE)); } - + /*------------------------------------------------------------------------- * Function: h5_fixname_real * @@ -579,7 +578,7 @@ h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size *------------------------------------------------------------------------- */ static char * -h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, +h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname, size_t size, hbool_t nest_printf, hbool_t subst_for_superblock) { const char *prefix = NULL; @@ -680,7 +679,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); if (mpi_rank == 0) - printf("*** Hint ***\n" + HDprintf("*** Hint ***\n" "You can use environment variable HDF5_PARAPREFIX to " "run parallel test files in a\n" "different directory or to add file type prefix. e.g.,\n" @@ -796,7 +795,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, return fullname; } - + /*------------------------------------------------------------------------- * Function: h5_rmprefix * @@ -827,7 +826,7 @@ h5_rmprefix(const char *filename) return(ret_ptr); } - + /*------------------------------------------------------------------------- * Function: h5_fileaccess * @@ -858,7 +857,7 @@ h5_fileaccess(void) /* Finally, check for libver bounds */ if(h5_get_libver_fapl(fapl_id) < 0) goto error; - + return fapl_id; error: @@ -867,7 +866,7 @@ error: return H5I_INVALID_HID; } /* end h5_fileaccess() */ - + /*------------------------------------------------------------------------- * Function: h5_fileaccess_flags * @@ -898,7 +897,7 @@ h5_fileaccess_flags(unsigned flags) /* Finally, check for libver bounds */ if((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0) goto error; - + return fapl_id; error: @@ -907,7 +906,7 @@ error: return H5I_INVALID_HID; } /* end h5_fileaccess_flags() */ - + /*------------------------------------------------------------------------- * Function: h5_get_vfd_fapl * @@ -1043,7 +1042,7 @@ error: return -1; } /* end h5_get_vfd_fapl() */ - + /*------------------------------------------------------------------------- * Function: h5_get_libver_fapl * @@ -1106,7 +1105,7 @@ error: return -1; } /* end h5_get_libver_fapl() */ - + /*------------------------------------------------------------------------- * Function: h5_no_hwconv * @@ -1127,7 +1126,7 @@ h5_no_hwconv(void) H5Tunregister(H5T_PERS_HARD, NULL, (hid_t)-1, (hid_t)-1, NULL); } - + /*------------------------------------------------------------------------- * Function: h5_show_hostname * @@ -1161,15 +1160,15 @@ h5_show_hostname(void) if(mpi_initialized && !mpi_finalized) { MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - printf("MPI-process %d.", mpi_rank); + HDprintf("MPI-process %d.", mpi_rank); } else - printf("thread 0."); + HDprintf("thread 0."); } #elif defined(H5_HAVE_THREADSAFE) - printf("thread %lu.", HDpthread_self_ulong()); + HDprintf("thread %lu.", HDpthread_self_ulong()); #else - printf("thread 0."); + HDprintf("thread 0."); #endif #ifdef H5_HAVE_WIN32_API @@ -1194,19 +1193,19 @@ h5_show_hostname(void) #endif #ifdef H5_HAVE_GETHOSTNAME - if (gethostname(hostname, (size_t)80) < 0) - printf(" gethostname failed\n"); + if (HDgethostname(hostname, (size_t)80) < 0) + HDprintf(" gethostname failed\n"); else - printf(" hostname=%s\n", hostname); + HDprintf(" hostname=%s\n", hostname); #else - printf(" gethostname not supported\n"); + HDprintf(" gethostname not supported\n"); #endif #ifdef H5_HAVE_WIN32_API WSACleanup(); #endif } - + #ifdef H5_HAVE_PARALLEL /* * Function: h5_set_info_object @@ -1305,7 +1304,7 @@ h5_set_info_object(void) return ret_value; } - + /* * Function: h5_dump_info_object * Purpose: Display content of an MPI Info object @@ -1321,25 +1320,25 @@ h5_dump_info_object(MPI_Info info) int flag; int i, nkeys; - printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info, + HDprintf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info, MPI_MAX_INFO_VAL); if (info==MPI_INFO_NULL){ - printf("object is MPI_INFO_NULL\n"); + HDprintf("object is MPI_INFO_NULL\n"); } else { MPI_Info_get_nkeys(info, &nkeys); - printf("object has %d items\n", nkeys); + HDprintf("object has %d items\n", nkeys); for (i=0; i<nkeys; i++){ MPI_Info_get_nthkey(info, i, key); MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag); - printf("%s=%s\n", key, value); + HDprintf("%s=%s\n", key, value); } } } #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: h5_get_file_size * @@ -1477,14 +1476,14 @@ print_func(const char *format, ...) int ret_value; HDva_start(arglist, format); - ret_value = vprintf(format, arglist); + ret_value = HDvprintf(format, arglist); HDva_end(arglist); return ret_value; } #ifdef H5_HAVE_FILTER_SZIP - + /*------------------------------------------------------------------------- * Function: h5_szip_can_encode * @@ -1661,7 +1660,7 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0) if(HDwrite(fd_new, buf, (size_t)nread) < 0) goto error; - + /* Close files */ if(HDclose(fd_old) < 0) goto error; @@ -1683,7 +1682,7 @@ error: return -1; } /* end h5_make_local_copy() */ - + /*------------------------------------------------------------------------- * Function: h5_verify_cached_stabs_cb * @@ -1706,7 +1705,7 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name, return SUCCEED; } /* end h5_verify_cached_stabs_cb() */ - + /*------------------------------------------------------------------------- * Function: h5_verify_cached_stabs * @@ -1769,16 +1768,16 @@ error: /*------------------------------------------------------------------------- * Function: h5_send_message - * + * * Purpose: Sends the specified signal. - * + * * In terms of this test framework, a signal consists of a file - * on disk. Since there are multiple processes that need to + * on disk. Since there are multiple processes that need to * communicate with each other, they do so by writing and - * reading signal files on disk, the names and contents of + * reading signal files on disk, the names and contents of * which are used to inform a process about when it can * proceed and what it should do next. - * + * * This function writes a signal file. The first argument is * the name of the signal file, and the second and third * arguments are the contents of the first two lines of the @@ -1788,7 +1787,7 @@ error: * * Programmer: Mike McGreevy * August 18, 2010 - * + * *------------------------------------------------------------------------- */ void @@ -1807,7 +1806,7 @@ h5_send_message(const char *send, const char *arg1, const char *arg2) else if(arg1 != NULL) { HDassert(arg2 == NULL); HDfprintf(signalfile, "%s\n", arg1); - } /* end if */ + } /* end if */ else { HDassert(arg1 == NULL); HDassert(arg2 == NULL); @@ -1820,38 +1819,38 @@ h5_send_message(const char *send, const char *arg1, const char *arg2) /*------------------------------------------------------------------------- * Function: h5_wait_message - * + * * Purpose: Waits for the specified signal. - * + * * In terms of this test framework, a signal consists of a file - * on disk. Since there are multiple processes that need to + * on disk. Since there are multiple processes that need to * communicate with each other, they do so by writing and - * reading signal files on disk, the names and contents of + * reading signal files on disk, the names and contents of * which are used to inform a process about when it can * proceed and what it should do next. - * + * * This function continuously attempts to read the specified * signal file from disk, and only continues once it has * successfully done so (i.e., only after another process has * called the "h5_send_message" function to write the signal file). - * This functon will then immediately remove the file (i.e., - * to indicate that it has been received and can be reused), + * This functon will then immediately remove the file (i.e., + * to indicate that it has been received and can be reused), * and then exits, allowing the calling function to continue. * * Return: void * * Programmer: Mike McGreevy * August 18, 2010 - * + * *------------------------------------------------------------------------- */ herr_t -h5_wait_message(const char *waitfor) +h5_wait_message(const char *waitfor) { FILE *returnfile; time_t t0,t1; - /* Start timer. If this function runs for too long (i.e., + /* Start timer. If this function runs for too long (i.e., expected signal is never received), it will return failure */ HDtime(&t0); @@ -1939,10 +1938,10 @@ static const H5FD_class_t H5FD_dummy_g = { NULL, /* truncate */ NULL, /* lock */ NULL, /* unlock */ - H5FD_FLMAP_DICHOTOMY /* fl_map */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; - + /*------------------------------------------------------------------------- * Function: h5_get_dummy_vfd_class() * @@ -1983,7 +1982,6 @@ error: return NULL; } /* h5_get_dummy_vfd_class */ - /*------------------------------------------------------------------------- * Function: h5_get_dummy_vol_class() * @@ -2032,7 +2030,7 @@ error: * Purpose: Get the string that corresponds to the libvery version bound. * * Return: The string - * + * *------------------------------------------------------------------------- */ H5_ATTR_PURE const char * diff --git a/test/h5test.h b/test/h5test.h index a0c8974..15bb15c 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -78,7 +78,7 @@ #define BEGINTEST 3 /* Skip all tests before this test */ /* - * This contains the filename prefix specificied as command line option for + * This contains the filename prefix specified as command line option for * the parallel test files. */ H5TEST_DLLVAR char *paraprefix; @@ -89,7 +89,7 @@ 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", \ +#define AT() HDprintf (" at %s:%d in %s()...\n", \ __FILE__, __LINE__, FUNC); /* @@ -101,18 +101,18 @@ 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 %-60s",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 TESTING(WHAT) {HDprintf("Testing %-62s",WHAT); HDfflush(stdout);} +#define TESTING_2(WHAT) {HDprintf(" Testing %-60s",WHAT); HDfflush(stdout);} +#define PASSED() {HDputs(" PASSED");HDfflush(stdout);} +#define H5_FAILED() {HDputs("*FAILED*");HDfflush(stdout);} +#define H5_WARNING() {HDputs("*WARNING*");HDfflush(stdout);} +#define SKIPPED() {HDputs(" -SKIP-");HDfflush(stdout);} +#define PUTS_ERROR(s) {HDputs(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); \ goto error;} -#define FAIL_PUTS_ERROR(s) {H5_FAILED(); AT(); puts(s); goto error;} +#define FAIL_PUTS_ERROR(s) {H5_FAILED(); AT(); HDputs(s); goto error;} /* * Alarm definitions to wait up (terminate) a test that runs too long. diff --git a/test/hdfs.c b/test/hdfs.c new file mode 100644 index 0000000..ab39da6 --- /dev/null +++ b/test/hdfs.c @@ -0,0 +1,1767 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Read-Only HDFS Virtual File Driver (VFD) + * + * Purpose: + * + * Verify behavior for Read-Only HDFS VFD. + * + * Demonstrates basic use cases and fapl interaction. + * + * Programmer: Jacob Smith <jake.smith@hdfgroup.org> + * 2018-04-23 + */ + +#include "h5test.h" /* testing utilities */ +#include "H5FDhdfs.h" /* this file driver's utilities */ + + +#ifdef H5_HAVE_LIBHDFS +#define HDFS_TEST_DEBUG 0 +#define HDFS_TEST_MAX_BUF_SIZE 256 +#endif /* H5_HAVE_LIBHDFS */ + +/***************************************************************************** + * + * FILE-LOCAL TESTING MACROS + * + * Purpose: + * + * 1) Upon test failure, goto-jump to single-location teardown in test + * function. E.g., `error:` (consistency with HDF corpus) or + * `failed:` (reflects purpose). + * >>> using "error", in part because `H5E_BEGIN_TRY` expects it. + * 2) Increase clarity and reduce overhead found with `TEST_ERROR`. + * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:" + * requires reading of entire line to know whether this if/call is + * part of the test setup, test operation, or a test unto itself. + * 3) Provide testing macros with optional user-supplied failure message; + * if not supplied (NULL), generate comparison output in the spirit of + * test-driven development. E.g., "expected 5 but was -3" + * User messages clarify test's purpose in code, encouraging description + * without relying on comments. + * 4) Configurable expected-actual order in generated comparison strings. + * Some prefer `VERIFY(expected, actual)`, others + * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch + * to satifsy both parties, assuming one paradigm per test file. + * (One could #undef and redefine the flag through the file as desired, + * but _why_.) + * + * Provided as courtesy, per consideration for inclusion in the library + * proper. + * + * Macros: + * + * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order + * FAIL_IF() - check condition + * FAIL_UNLESS() - check _not_ condition + * JSVERIFY() - long-int equality check; prints reason/comparison + * JSVERIFY_NOT() - long-int inequality check; prints + * JSVERIFY_STR() - string equality check; prints + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *****************************************************************************/ + + +/*---------------------------------------------------------------------------- + * + * ifdef flag: JSVERIFY_EXP_ACT + * + * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason]) + * default, if this is undefined, is (ACTUAL, EXPECTED[, reason]) + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_EXP_ACT 1L + + +/*---------------------------------------------------------------------------- + * + * Macro: JSFAILED_AT() + * + * Purpose: + * + * Preface a test failure by printing "*FAILED*" and location to stdout + * Similar to `H5_FAILED(); AT();` from h5test.h + * + * *FAILED* at somefile.c:12 in function_name()... + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSFAILED_AT() { \ + HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: FAIL_IF() + * + * Purpose: + * + * Make tests more accessible and less cluttered than + * `if (thing == otherthing()) TEST_ERROR` + * paradigm. + * + * The following lines are roughly equivalent: + * + * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests) + * `FAIL_IF(myfunc() < 0)` + * + * Prints a generic "FAILED AT" line to stdout and jumps to `error`, + * similar to `TEST_ERROR` in h5test.h + * + * Programmer: Jacob Smith + * 2017-10-23 + * + *---------------------------------------------------------------------------- + */ +#define FAIL_IF(condition) \ +if (condition) { \ + JSFAILED_AT() \ + goto error; \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: FAIL_UNLESS() + * + * Purpose: + * + * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests", + * e.g., "a != b". + * + * Opposite of FAIL_IF; fails if the given condition is _not_ true. + * + * `FAIL_IF( 5 != my_op() )` + * is equivalent to + * `FAIL_UNLESS( 5 == my_op() )` + * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer. + * (see JSVERIFY) + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#if 0 /* UNUSED */ +#define FAIL_UNLESS(condition) \ +if (!(condition)) { \ + JSFAILED_AT() \ + goto error; \ +} +#endif /* UNUSED */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSERR_LONG() + * + * Purpose: + * + * Print an failure message for long-int arguments. + * ERROR-AT printed first. + * If `reason` is given, it is printed on own line and newlined after + * else, prints "expected/actual" aligned on own lines. + * + * *FAILED* at myfile.c:488 in somefunc()... + * forest must be made of trees. + * + * or + * + * *FAILED* at myfile.c:488 in somefunc()... + * ! Expected 425 + * ! Actual 3 + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSERR_LONG(expected, actual, reason) { \ + JSFAILED_AT() \ + if (reason!= NULL) { \ + HDprintf("%s\n", (reason)); \ + } else { \ + HDprintf(" ! Expected %ld\n ! Actual %ld\n", \ + (long)(expected), (long)(actual)); \ + } \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: JSERR_STR() + * + * Purpose: + * + * Print an failure message for string arguments. + * ERROR-AT printed first. + * If `reason` is given, it is printed on own line and newlined after + * else, prints "expected/actual" aligned on own lines. + * + * *FAILED* at myfile.c:421 in myfunc()... + * Blue and Red strings don't match! + * + * or + * + * *FAILED* at myfile.c:421 in myfunc()... + * !!! Expected: + * this is my expected + * string + * !!! Actual: + * not what I expected at all + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSERR_STR(expected, actual, reason) { \ + JSFAILED_AT() \ + if ((reason) != NULL) { \ + HDprintf("%s\n", (reason)); \ + } else { \ + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \ + (expected), (actual)); \ + } \ +} + + + +#ifdef JSVERIFY_EXP_ACT + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY() + * + * Purpose: + * + * Verify that two long integers are equal. + * If unequal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY(expected, actual, reason) \ +if ((long)(actual) != (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY_NOT() + * + * Purpose: + * + * Verify that two long integers are _not_ equal. + * If equal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_NOT(expected, actual, reason) \ +if ((long)(actual) == (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY_NOT */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY_STR() + * + * Purpose: + * + * Verify that two strings are equal. + * If unequal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_STR(expected, actual, reason) \ +if (strcmp((actual), (expected)) != 0) { \ + JSERR_STR((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY_STR */ + + +#else +/* JSVERIFY_EXP_ACT not defined + * + * Repeats macros above, but with actual/expected parameters reversed. + */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY() + * See: JSVERIFY documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY(actual, expected, reason) \ +if ((long)(actual) != (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY_NOT() + * See: JSVERIFY_NOT documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_NOT(actual, expected, reason) \ +if ((long)(actual) == (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY_NOT */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY_STR() + * See: JSVERIFY_STR documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_STR(actual, expected, reason) \ +if (strcmp((actual), (expected)) != 0) { \ + JSERR_STR((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY_STR */ + +#endif /* ifdef/else JSVERIFY_EXP_ACT */ + +/******************************** + * OTHER MACROS AND DEFINITIONS * + ********************************/ + +/* copied from src/hdfs.c + */ +#ifdef H5_HAVE_LIBHDFS +#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) +#endif /* H5_HAVE_LIBHDFS */ + +#define HDFS_NAMENODE_NAME_MAX_SIZE 128 + +/******************************* + * FILE-LOCAL GLOBAL VARIABLES * + *******************************/ + +#ifdef H5_HAVE_LIBHDFS +static const char filename_missing[] = "/tmp/missing.txt"; +static const char filename_bard[] = "/tmp/t8.shakespeare.txt"; +static const char filename_raven[] = "/tmp/Poe_Raven.txt"; +static const char filename_example_h5[] = "/tmp/t.h5"; +#endif /* H5_HAVE_LIBHDFS */ + +static H5FD_hdfs_fapl_t default_fa = { + 1, /* fa version */ + "localhost", /* namenode name */ + 0, /* namenode port */ + "", /* user name */ + "", /* kerberos path */ + 1024, /* buffer size */ +}; + +/****************** + * TEST FUNCTIONS * + ******************/ + + +/*--------------------------------------------------------------------------- + * + * Function: test_fapl_config_validation() + * + * Purpose: + * + * Test data consistency of fapl configuration. + * Tests `H5FD_hdfs_validate_config` indirectly through `H5Pset_fapl_hdfs`. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2018-04-25 + * + * Changes: None. + * + *--------------------------------------------------------------------------- + */ +static int +test_fapl_config_validation(void) +{ + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char *msg; + herr_t expected; + H5FD_hdfs_fapl_t config; + }; + + /************************ + * test-local variables * + ************************/ + + hid_t fapl_id = -1; /* file access property list ID */ + H5FD_hdfs_fapl_t config; + H5FD_hdfs_fapl_t fa_fetch; + herr_t success = SUCCEED; + unsigned int i = 0; + unsigned int ncases = 6; /* should equal number of cases */ + struct testcase *case_ptr = NULL; /* dumb work-around for possible */ + /* dynamic cases creation because */ + /* of compiler warnings Wlarger-than */ + struct testcase cases_arr[] = { + { "default config fapl", + SUCCEED, + { 1, /* version */ + "localhost", /* namenode_name */ + 0, /* namenode_port number */ + "some_user", /* user_name */ + "", /* kerberos_ticket_cache path */ + -1, /* stream_buffer_size */ + }, + }, + { "invalid version number (2)", + FAIL, + { 2, /* version */ + "localhost", /* namenode_name */ + 0, /* namenode_port number */ + "some_user", /* user_name */ + "", /* kerberos_ticket_cache path */ + -1, /* stream_buffer_size */ + }, + }, + { "invalid version number (0)", + FAIL, + { 0, /* version */ + "localhost", /* namenode_name */ + 0, /* namenode_port number */ + "some_user", /* user_name */ + "", /* kerberos_ticket_cache path */ + -1, /* stream_buffer_size */ + }, + }, + { "nonsense kerberos path still ok?", + SUCCEED, + { 1, /* version */ + "localhost", /* namenode_name */ + 0, /* namenode_port number */ + "some_user", /* user_name */ + "pathToSomewhere", /* kerberos_ticket_cache path */ + -1, /* stream_buffer_size */ + }, + }, + { "namenode port number too high", + FAIL, + { 1, /* version */ + "localhost", /* namenode_name */ + 88000, /* namenode_port number */ + "some_user", /* user_name */ + "", /* kerberos_ticket_cache path */ + -1, /* stream_buffer_size */ + }, + }, + { "negative namenode port number", + FAIL, + { 1, /* version */ + "localhost", /* namenode_name */ + -1, /* namenode_port number */ + "some_user", /* user_name */ + "", /* kerberos_ticket_cache path */ + -1, /* stream_buffer_size */ + }, + }, + }; + + TESTING("HDFS fapl configuration validation"); + + /********* + * TESTS * + *********/ + + for (i = 0; i < ncases; i++) { + + /*--------------- + * per-test setup + *--------------- + */ + case_ptr = &cases_arr[i]; + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) /* sanity-check */ + + /*----------------------------------- + * Actually test -- set fapl. + * Mute stack trace in failure cases. + *----------------------------------- + */ + H5E_BEGIN_TRY { + /* `H5FD_hdfs_validate_config(...)` is static/private + * to src/hdfs.c and cannot (and should not?) be tested directly? + * Instead, validate config through public api. + */ + success = H5Pset_fapl_hdfs(fapl_id, &case_ptr->config); + } H5E_END_TRY; + + JSVERIFY( case_ptr->expected, success, case_ptr->msg ) + + /* Make sure we can get back what we put in. + * Only valid if the fapl configuration does not result in error. + */ + if (success == SUCCEED) { + config = case_ptr->config; + JSVERIFY( SUCCEED, + H5Pget_fapl_hdfs(fapl_id, &fa_fetch), + "unable to get fapl" ) + JSVERIFY( H5FD__CURR_HDFS_FAPL_T_VERSION, + fa_fetch.version, + "invalid version number" ) + JSVERIFY( config.version, + fa_fetch.version, + "version number mismatch" ) + JSVERIFY( config.namenode_port, + fa_fetch.namenode_port, + "namenode port mismatch" ) + JSVERIFY( config.stream_buffer_size, + fa_fetch.stream_buffer_size, + "streambuffer size mismatch" ) + JSVERIFY_STR( config.namenode_name, + fa_fetch.namenode_name, + NULL ) + JSVERIFY_STR( config.user_name, + fa_fetch.user_name, + NULL ) + JSVERIFY_STR( config.kerberos_ticket_cache, + fa_fetch.kerberos_ticket_cache, + NULL ) + } + + /*----------------------------- + * per-test sanitation/teardown + *----------------------------- + */ + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + } /* for each test case */ + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (fapl_id < 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + return 1; + +} /* end test_fapl_config_validation() */ + + +/*------------------------------------------------------------------------- + * + * Function: test_hdfs_fapl() + * + * Purpose: Tests the file handle interface for the HDFS driver. + * + * For now, test only fapl & flags. Extend as the + * work on the VFD continues. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Jacob Smith + * 2018-04-25 + * + * Changes: None. + * + *------------------------------------------------------------------------- + */ +static int +test_hdfs_fapl(void) +{ + /************************ + * test-local variables * + ************************/ + + hid_t fapl_id = -1; /* file access property list ID */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + H5FD_hdfs_fapl_t hdfs_fa_0 = { + 1, /* version*/ + "", /* node name */ + 9000, /* node port */ + "", /* username */ + "", /* kerb cache path */ + 1024, /* stream buffer size */ + }; + + TESTING("HDFS fapl "); + + /* Set property list and file name for HDFS driver. + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &hdfs_fa_0) ) + + driver_id = H5Pget_driver(fapl_id); + FAIL_IF( driver_id < 0 ) + + /**************** + * Check that the VFD feature flags are correct + * SPEC MAY CHANGE + ******************/ + + FAIL_IF( H5FDdriver_query(driver_id, &driver_flags) < 0 ) + + JSVERIFY_NOT( 0, (driver_flags & H5FD_FEAT_DATA_SIEVE), + "bit(s) in `driver_flags` must align with " + "H5FD_FEAT_DATA_SIEVE" ) + + JSVERIFY( H5FD_FEAT_DATA_SIEVE, driver_flags, + "H5FD_FEAT_DATA_SIEVE should be the only supported flag") + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + + return 1; + +} /* end test_hdfs_fapl() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_vfd_open() + * + * Purpose: + * + * Demonstrate/specify VFD-level "Open" failure cases + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2018-06-07 + * + *--------------------------------------------------------------------------- + */ +static int +test_vfd_open(void) +{ + +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS VFD-level open"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else + + /********************* + * test-local macros * + *********************/ + +/* selectors for which fapl to use in testcase */ +#define FAPL_H5P_DEFAULT -2 +#define FAPL_UNCONFIGURED -3 /* H5P_FILE_ACCESS */ +#define FAPL_HDFS -4 + + /************************* + * test-local structures * + *************************/ + + struct test_condition { + const char *message; + const char *url; + unsigned flags; + int which_fapl; + haddr_t maxaddr; + hbool_t might_use_other_driver; + }; + + /************************ + * test-local variables * + ************************/ + + struct test_condition failing_conditions[] = { + { "default property list (H5P_DEFAULT) is invalid", + filename_bard, + H5F_ACC_RDONLY, + FAPL_H5P_DEFAULT, + MAXADDR, + TRUE, + }, + { "generic file access property list is invalid", + filename_bard, + H5F_ACC_RDONLY, + FAPL_UNCONFIGURED, + MAXADDR, + TRUE, + }, + { "filename cannot be null", + NULL, + H5F_ACC_RDONLY, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "filename cannot be empty", + "", + H5F_ACC_RDONLY, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "file at filename must exist", + filename_missing, + H5F_ACC_RDONLY, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "read-write flag not supported", + filename_bard, + H5F_ACC_RDWR, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "truncate flag not supported", + filename_bard, + H5F_ACC_TRUNC, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "create flag not supported", + filename_bard, + H5F_ACC_CREAT, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "EXCL flag not supported", + filename_bard, + H5F_ACC_EXCL, + FAPL_HDFS, + MAXADDR, + FALSE, + }, + { "maxaddr cannot be 0 (caught in `H5FD_open()`)", + filename_bard, + H5F_ACC_RDONLY, + FAPL_HDFS, + 0, + FALSE, + }, + }; + unsigned i = 0; + unsigned failing_conditions_count = 10; + H5FD_t *fd = NULL; + hid_t fapl_hdfs = -1; + hid_t fapl_unconfigured = -1; + + TESTING("HDFS VFD-level open"); + + fapl_unconfigured = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_unconfigured < 0 ) + + fapl_hdfs = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_hdfs < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_hdfs, &default_fa) ) + + /********* + * TESTS * + *********/ + + /* all the test cases that will _not_ open + */ + for (i = 0; i < failing_conditions_count; i++) { + struct test_condition T = failing_conditions[i]; + hid_t fapl_id = H5P_DEFAULT; + + fd = NULL; + + if (T.which_fapl == FAPL_UNCONFIGURED) { + fapl_id = fapl_unconfigured; + } + else + if (T.which_fapl == FAPL_HDFS) { + fapl_id = fapl_hdfs; + } + +#if HDFS_TEST_DEBUG + HDfprintf(stderr, "testing: %s\n", T.message); +#endif /* HDFS_TEST_DEBUG */ + + H5E_BEGIN_TRY { + fd = H5FDopen(T.url, T.flags, fapl_id, T.maxaddr); + } H5E_END_TRY; + if (NULL != fd) { + if (TRUE == T.might_use_other_driver && + H5FD_HDFS != fd->driver_id) + { + HDfprintf(stderr, "\n!!!!! WARNING !!!!!\n" \ + " Successful open of file on local system " \ + "with non-HDFS VFD.\n"); + JSVERIFY(SUCCEED, H5FDclose(fd), + "unable to close errant open"); + fd = NULL; + } + else { + JSVERIFY(1, 0, T.message); /* print message and fail */ + } + } + } + + FAIL_IF( NULL != fd ) /* sanity check */ + +#if HDFS_TEST_DEBUG + HDfprintf(stderr, "nominal open\n"); +#endif /* HDFS_TEST_DEBUG */ + + /* finally, show that a file can be opened + */ + fd = H5FDopen( + filename_bard, + H5F_ACC_RDONLY, + fapl_hdfs, + MAXADDR); + FAIL_IF( NULL == fd ) + + /************ + * TEARDOWN * + ************/ + +#if HDFS_TEST_DEBUG + HDfprintf(stderr, "teardown...\n"); +#endif /* HDFS_TEST_DEBUG */ + + FAIL_IF( FAIL == H5FDclose(fd) ) + fd = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_hdfs) ) + fapl_hdfs = -1; + + FAIL_IF( FAIL == H5Pclose(fapl_unconfigured) ) + fapl_unconfigured = -1; + + PASSED(); + return 0; + +error: + + /*********** + * CLEANUP * + ***********/ + + if (fd) { + (void)H5FDclose(fd); + } + H5E_BEGIN_TRY { + if (fapl_hdfs >= 0) { + (void)H5Pclose(fapl_hdfs); + } + if (fapl_unconfigured >= 0) { + (void)H5Pclose(fapl_unconfigured); + } + } H5E_END_TRY; + + return 1; + +#undef FAPL_H5P_DEFAULT +#undef FAPL_UNCONFIGURED +#undef FAPL_HDFS + +#endif /* H5_HAVE_LIBHDFS */ + +} /* end test_vfd_open() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_eof_eoa() + * + * Purpose: + * + * Demonstrate behavior of get_eof, get_eoa, and set_eoa. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2018-06-07 + * + *--------------------------------------------------------------------------- + */ +static int +test_eof_eoa(void) +{ +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS eof/eoa gets and sets"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + H5FD_t *fd_shakespeare = NULL; + hid_t fapl_id = -1; + + TESTING("HDFS eof/eoa gets and sets"); + + /********* + * SETUP * + *********/ + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( 0 > fapl_id ) + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) ) + + fd_shakespeare = H5FDopen( + filename_bard, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == fd_shakespeare ) + + /********* + * TESTS * + *********/ + + /* verify as found + */ + JSVERIFY( 5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL ) + JSVERIFY( H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), + H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW), + "mismatch between DEFAULT and RAW memory types" ) + JSVERIFY( 0, + H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoA should be unset by H5FDopen" ) + + /* set EoA below EoF + */ + JSVERIFY( SUCCEED, + H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 44442202), + "unable to set EoA (lower)" ) + JSVERIFY( 5458199, + H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoF changed" ) + JSVERIFY( 44442202, + H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoA unchanged" ) + + /* set EoA above EoF + */ + JSVERIFY( SUCCEED, + H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 6789012), + "unable to set EoA (higher)" ) + JSVERIFY( 5458199, + H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoF changed" ) + JSVERIFY( 6789012, + H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoA unchanged" ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(fd_shakespeare) ) + fd_shakespeare = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + + /*********** + * CLEANUP * + ***********/ + + if (fd_shakespeare != NULL) { + (void)H5FDclose(fd_shakespeare); + } + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +#endif /* H5_HAVE_LIBHDFS */ + +} /* end test_eof_eoa() */ + + +/*----------------------------------------------------------------------------- + * + * Function: test_H5FDread_without_eoa_set_fails() + * + * Purpose: + * + * Demonstrate a not-obvious constraint by the library, preventing + * file read before EoA is set + * + * Programmer: Jacob Smith + * 2018-06-08 + * + *----------------------------------------------------------------------------- + */ +static int +test_H5FDread_without_eoa_set_fails(void) +{ +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS VFD read-eoa temporal coupling library limitation"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else + + char buffer[HDFS_TEST_MAX_BUF_SIZE]; + unsigned int i = 0; + H5FD_t *file_shakespeare = NULL; + hid_t fapl_id = -1; + + TESTING("HDFS VFD read-eoa temporal coupling library limitation"); + + /********* + * SETUP * + *********/ + + /* create HDFS fapl + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) ) + + file_shakespeare = H5FDopen( + filename_bard, + H5F_ACC_RDONLY, + fapl_id, + MAXADDR); + FAIL_IF( NULL == file_shakespeare ) + + JSVERIFY( 0, H5FDget_eoa(file_shakespeare, H5FD_MEM_DEFAULT), + "EoA should remain unset by H5FDopen" ) + + /* zero buffer contents */ + for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) { + buffer[i] = 0; + } + + /******** + * TEST * + ********/ + + H5E_BEGIN_TRY { /* mute stack trace on expected failure */ + JSVERIFY( FAIL, + H5FDread(file_shakespeare, + H5FD_MEM_DRAW, + H5P_DEFAULT, + 1200699, + 102, + buffer), + "cannot read before eoa is set" ) + } H5E_END_TRY; + for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) { + JSVERIFY( 0, (unsigned)buffer[i], "buffer was modified by write!" ) + } + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(file_shakespeare) ) + file_shakespeare = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + + /*********** + * CLEANUP * + ***********/ + + if (file_shakespeare) { + (void)H5FDclose(file_shakespeare); + } + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +#endif /* H5_HAVE_LIBHDFS */ + +} /* end test_H5FDread_without_eoa_set_fails() */ + + + +/*--------------------------------------------------------------------------- + * + * Function: test_read() + * + * Purpose: + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2018-06-08 + * + *--------------------------------------------------------------------------- + */ +static int +test_read(void) +{ +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS VFD read/range-gets"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + struct testcase { + const char *message; /* purpose of test case */ + haddr_t eoa_set; /* set file EOA to this prior to read */ + size_t addr; /* offset of read in file */ + size_t len; /* length of read in file */ + herr_t success; /* expected return value of read function */ + const char *expected; /* expected contents of buffer; failure ignores */ + }; + + /************************ + * test-local variables * + ************************/ + struct testcase cases[] = { + { "successful range-get", + 6464, + 5691, + 32, /* fancy quotes are three bytes each(?) */ + SUCCEED, + "Quoth the Raven “Nevermore.”", + }, + { "read past EOA fails (EOA < EOF < addr)", + 3000, + 4000, + 100, + FAIL, + NULL, + }, + { "read overlapping EOA fails (EOA < addr < EOF < (addr+len))", + 3000, + 8000, + 100, + FAIL, + NULL, + }, + { "read past EOA/EOF fails ((EOA==EOF) < addr)", + 6464, + 7000, + 100, + FAIL, + NULL, + }, + { "read overlapping EOA/EOF fails (addr < (EOA==EOF) < (addr+len))", + 6464, + 6400, + 100, + FAIL, + NULL, + }, + { "read between EOF and EOA fails (EOF < addr < (addr+len) < EOA)", + 8000, + 7000, + 100, + FAIL, + NULL, + }, + }; + unsigned testcase_count = 6; + unsigned test_i = 0; + struct testcase test; + herr_t open_return = FAIL; + char buffer[HDFS_TEST_MAX_BUF_SIZE]; + unsigned int i = 0; + H5FD_t *file_raven = NULL; + hid_t fapl_id = -1; + + TESTING("HDFS VFD read/range-gets"); + + /********* + * SETUP * + *********/ + + /* create HDFS fapl + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) ) + + /* zero buffer contents */ + for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) { + buffer[i] = 0; + } + + /* open file + */ + file_raven = H5FDopen( + filename_raven, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); /* Demonstrate success with "automatic" value */ + FAIL_IF( NULL == file_raven ) + + JSVERIFY( 6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL ) + + /********* + * TESTS * + *********/ + + for (test_i = 0; test_i < testcase_count; test_i++) { + + /* -------------- * + * per-test setup * + * -------------- */ + + test = cases[test_i]; + open_return = FAIL; + + FAIL_IF( HDFS_TEST_MAX_BUF_SIZE < test.len ) /* buffer too small! */ + + FAIL_IF( FAIL == + H5FDset_eoa( file_raven, H5FD_MEM_DEFAULT, test.eoa_set) ) + + /* zero buffer contents */ + for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) { + buffer[i] = 0; + } + + /* ------------ * + * conduct test * + * ------------ */ + + H5E_BEGIN_TRY { + open_return = H5FDread( + file_raven, + H5FD_MEM_DRAW, + H5P_DEFAULT, + test.addr, + test.len, + buffer); + } H5E_END_TRY; + + JSVERIFY( test.success, + open_return, + test.message ) + + if (open_return == SUCCEED) { + JSVERIFY_STR( test.expected, buffer, NULL ) + } + + } /* for each testcase */ + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(file_raven) ) + file_raven = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + + /*********** + * CLEANUP * + ***********/ + + if (file_raven != 0) { + (void)H5FDclose(file_raven); + } + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +#endif /* H5_HAVE_LIBHDFS */ + +} /* end test_read() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_noops_and_autofails() + * + * Purpose: + * + * Demonstrate the unavailable and do-nothing routines unique to + * Read-Only VFD. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-06 + * + * Changes: + * + modify from S3VFD codebase to HDFS; Minor changes, mostly. + * + Jacob Smith 2018-06-08 + * + *--------------------------------------------------------------------------- + */ +static int +test_noops_and_autofails(void) +{ +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS VFD always-fail and no-op routines"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + hid_t fapl_id = -1; + H5FD_t *file = NULL; + const char data[36] = "The Force shall be with you, always"; + + TESTING("HDFS VFD always-fail and no-op routines"); + + /********* + * SETUP * + *********/ + + /* create HDFS fapl + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) ) + + /* open file + */ + file = H5FDopen( + filename_bard, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == file ) + + /********* + * TESTS * + *********/ + + /* auto-fail calls to write and truncate + */ + H5E_BEGIN_TRY { + JSVERIFY( FAIL, + H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data), + "write must fail" ) + } H5E_END_TRY; + + H5E_BEGIN_TRY { + JSVERIFY( FAIL, + H5FDtruncate(file, H5P_DEFAULT, FALSE), + "truncate must fail" ) + } H5E_END_TRY; + + H5E_BEGIN_TRY { + JSVERIFY( FAIL, + H5FDtruncate(file, H5P_DEFAULT, TRUE), + "truncate must fail (closing)" ) + } H5E_END_TRY; + + /* no-op calls to `lock()` and `unlock()` + */ + JSVERIFY( SUCCEED, + H5FDlock(file, TRUE), + "lock always succeeds; has no effect" ) + JSVERIFY( SUCCEED, + H5FDlock(file, FALSE), + NULL ) + JSVERIFY( SUCCEED, + H5FDunlock(file), + NULL ) + /* Lock/unlock with null file or similar error crashes tests. + * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()` + */ + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(file) ) + file = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + + /*********** + * CLEANUP * + ***********/ + + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + if (file != NULL) { + (void)H5FDclose(file); + } + + return 1; + +#endif /* H5_HAVE_LIBHDFS */ + +} /* end test_noops_and_autofails() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_cmp() + * + * Purpose: + * + * Verify "file comparison" behavior. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-06 + * + *--------------------------------------------------------------------------- + */ +static int +test_cmp(void) +{ + TESTING("HDFS cmp (comparison)"); + SKIPPED(); + HDfprintf( + stderr, + " TODO: Distinct valid fapls to open the same file.\n"); + + return 0; + +} /* end test_cmp() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_H5F_integration() + * + * Purpose: + * + * Demonstrate H5F (File interface) behavior with files on HDFS. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-07 + * + * Changes: + * + modify from S3VFD codebase to HDFS; Minor changes, mostly. + * + Jacob Smith 2018-06-08 + * + *--------------------------------------------------------------------------- + */ +static int +test_H5F_integration(void) +{ +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS file access through HD5F library (H5F API)"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + hid_t file = -1; + hid_t fapl_id = -1; + + TESTING("HDFS file access through HD5F library (H5F API)"); + + /********* + * SETUP * + *********/ + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( 0 > fapl_id ) + FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) ) + + /********* + * TESTS * + *********/ + + /* Read-Write Open access is not allowed with this file driver. + */ + H5E_BEGIN_TRY { + FAIL_IF( 0 <= H5Fopen( + filename_example_h5, + H5F_ACC_RDWR, + fapl_id) ) + } H5E_END_TRY; + + /* H5Fcreate() is not allowed with this file driver. + */ + H5E_BEGIN_TRY { + FAIL_IF( 0 <= H5Fcreate( + filename_missing, + H5F_ACC_RDONLY, + H5P_DEFAULT, + fapl_id) ) + } H5E_END_TRY; + + /* Successful open. + */ + file = H5Fopen( + filename_example_h5, + H5F_ACC_RDONLY, + fapl_id); + FAIL_IF( file < 0 ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5Fclose(file) ) + file = -1; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + +#if HDFS_TEST_DEBUG + HDprintf("\nerror!"); fflush(stdout); +#endif /* HDFS_TEST_DEBUG */ + + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + if (file > 0) { + (void)H5Fclose(file); + } + + return 1; + +#endif /* H5_HAVE_LIBHDFS */ + +} /* test_H5F_integration */ + + +/*------------------------------------------------------------------------- + * + * Function: main + * + * Purpose: Tests the basic features of Virtual File Drivers + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Jacob Smith + * 2017-10-23 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + int nerrors = 0; + + /****************** + * commence tests * + ******************/ + + static char hdfs_namenode_name[HDFS_NAMENODE_NAME_MAX_SIZE] = ""; + const char *hdfs_namenode_name_env = NULL; + + hdfs_namenode_name_env = HDgetenv("HDFS_TEST_NAMENODE_NAME"); + if (hdfs_namenode_name_env == NULL || hdfs_namenode_name_env[0] == '\0') { + HDstrncpy(hdfs_namenode_name, "localhost", HDFS_NAMENODE_NAME_MAX_SIZE); + } + else { + HDstrncpy( /* TODO: error-check? */ + default_fa.namenode_name, + hdfs_namenode_name_env, + HDFS_NAMENODE_NAME_MAX_SIZE); + } + + h5_reset(); + + HDprintf("Testing hdfs VFD functionality.\n"); + + nerrors += test_fapl_config_validation(); + nerrors += test_hdfs_fapl(); + nerrors += test_vfd_open(); + nerrors += test_eof_eoa(); + nerrors += test_H5FDread_without_eoa_set_fails(); + nerrors += test_read(); + nerrors += test_noops_and_autofails(); + nerrors += test_cmp(); + nerrors += test_H5F_integration(); + + if (nerrors > 0) { + HDprintf("***** %d hdfs TEST%s FAILED! *****\n", + nerrors, + nerrors > 1 ? "S" : ""); + nerrors = 1; + } + else { + HDprintf("All hdfs tests passed.\n"); + } + return nerrors; /* 0 if no errors, 1 if any errors */ + +} /* end main() */ + + diff --git a/test/hyperslab.c b/test/hyperslab.c index d8c00c9..8ed9c22 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -85,19 +85,19 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) for(i = 0; i < nx; i++) { if(nz > 1) - printf("i=%lu:\n", (unsigned long)i); + HDprintf("i=%lu:\n", (unsigned long)i); else - printf("%03lu:", (unsigned long)i); + HDprintf("%03lu:", (unsigned long)i); for(j = 0; j < ny; j++) { if(nz > 1) - printf("%03lu:", (unsigned long)j); + HDprintf("%03lu:", (unsigned long)j); for(k = 0; k < nz; k++) - printf(" %3d", *array++); + HDprintf(" %3d", *array++); if(nz > 1) - printf("\n"); + HDprintf("\n"); } /* end for */ - printf("\n"); + HDprintf("\n"); } /* end for */ } /* end print_array() */ @@ -122,7 +122,7 @@ print_ref(size_t nx, size_t ny, size_t nz) uint8_t *array; if(NULL != (array = (uint8_t *)HDmalloc(nx * ny * nz))) { - printf("Reference array:\n"); + HDprintf("Reference array:\n"); init_full(array, nx, ny, nz); print_array(array, nx, ny, nz); HDfree(array); @@ -168,21 +168,21 @@ test_fill(size_t nx, size_t ny, size_t nz, if(0 == ny) { ndims = 1; ny = nz = 1; - sprintf(dim, "%lu", (unsigned long) nx); + HDsprintf(dim, "%lu", (unsigned long) nx); } /* end if */ else { ndims = 2; nz = 1; - sprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + HDsprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny); } /* end else */ } /* end if */ else { ndims = 3; - sprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny, + HDsprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } /* end else */ - sprintf(s, "Testing hyperslab fill %-11s variable hyperslab", dim); - printf("%-70s", s); + HDsprintf(s, "Testing hyperslab fill %-11s variable hyperslab", dim); + HDprintf("%-70s", s); fflush(stdout); /* Allocate array */ @@ -242,8 +242,8 @@ test_fill(size_t nx, size_t ny, size_t nz, * is going directly to a terminal. */ AT(); - printf(" acc != ref_value\n"); - printf(" i=%lu, j=%lu, k=%lu, " + HDprintf(" acc != ref_value\n"); + HDprintf(" i=%lu, j=%lu, k=%lu, " "dx=%lu, dy=%lu, dz=%lu, " "fill=%d\n", (unsigned long)i, (unsigned long)j, @@ -252,7 +252,7 @@ test_fill(size_t nx, size_t ny, size_t nz, (unsigned long)dy, (unsigned long)dz, fill_value); print_ref(nx, ny, nz); - printf("\n Result is:\n"); + HDprintf("\n Result is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -332,17 +332,17 @@ test_copy(int mode, if(0 == ny) { ndims = 1; ny = nz = 1; - sprintf(dim, "%lu", (unsigned long) nx); + HDsprintf(dim, "%lu", (unsigned long) nx); } /* end if */ else { ndims = 2; nz = 1; - sprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + HDsprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny); } /* end else */ } /* end if */ else { ndims = 3; - sprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny, + HDsprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } /* end else */ @@ -376,8 +376,8 @@ test_copy(int mode, HDabort(); } /* end switch */ - sprintf(s, "Testing hyperslab copy %-11s %s", dim, sub); - printf("%-70s", s); + HDsprintf(s, "Testing hyperslab copy %-11s %s", dim, sub); + HDprintf("%-70s", s); fflush(stdout); /* @@ -481,8 +481,8 @@ test_copy(int mode, * going directly to a terminal. */ AT(); - printf(" acc != ref_value\n"); - printf(" i=%lu, j=%lu, k=%lu, " + HDprintf(" acc != ref_value\n"); + HDprintf(" i=%lu, j=%lu, k=%lu, " "dx=%lu, dy=%lu, dz=%lu\n", (unsigned long)i, (unsigned long)j, @@ -491,7 +491,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + HDprintf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -522,9 +522,9 @@ test_copy(int mode, * going directly to a terminal. */ AT(); - printf(" acc != ref_value + nx*ny*nz - " + HDprintf(" acc != ref_value + nx*ny*nz - " "dx*dy*dz\n"); - printf(" i=%lu, j=%lu, k=%lu, " + HDprintf(" i=%lu, j=%lu, k=%lu, " "dx=%lu, dy=%lu, dz=%lu\n", (unsigned long)i, (unsigned long)j, @@ -533,7 +533,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + HDprintf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -594,7 +594,7 @@ test_multifill(size_t nx) } fill, *src = NULL, *dst = NULL; hsize_t i, j; - printf("%-70s", "Testing multi-byte fill value"); + HDprintf("%-70s", "Testing multi-byte fill value"); fflush(stdout); /* Initialize the source and destination */ @@ -639,28 +639,28 @@ test_multifill(size_t nx) s[0] = '\0'; for(i = 0; i < nx; i++) { if(dst[i].left != 3333333) - sprintf(s, "bad dst[%lu].left", (unsigned long)i); + HDsprintf(s, "bad dst[%lu].left", (unsigned long)i); else if(!H5_DBL_ABS_EQUAL(dst[i].mid, fill.mid)) /* Check if two DOUBLE values are equal. If their difference * is smaller than the EPSILON value for double, they are * considered equal. See the definition in h5test.h. */ - sprintf(s, "bad dst[%lu].mid", (unsigned long)i); + HDsprintf(s, "bad dst[%lu].mid", (unsigned long)i); else if(dst[i].right != 4444444) - sprintf(s, "bad dst[%lu].right", (unsigned long)i); + HDsprintf(s, "bad dst[%lu].right", (unsigned long)i); if(s[0]) { H5_FAILED() if(!HDisatty(1)) { AT(); - printf(" fill={%d,%g,%d}\n ", fill.left, fill.mid, + HDprintf(" fill={%d,%g,%d}\n ", fill.left, fill.mid, fill.right); for(j = 0; j < sizeof(fill); j++) - printf(" %02x", ((uint8_t *)&fill)[j]); - printf("\n dst[%lu]={%d,%g,%d}\n ", (unsigned long)i, + HDprintf(" %02x", ((uint8_t *)&fill)[j]); + HDprintf("\n dst[%lu]={%d,%g,%d}\n ", (unsigned long)i, dst[i].left, dst[i].mid, dst[i].right); for(j = 0; j < sizeof(dst[i]); j++) - printf(" %02x", ((uint8_t *)(dst + i))[j]); - printf("\n"); + HDprintf(" %02x", ((uint8_t *)(dst + i))[j]); + HDprintf("\n"); } /* end if */ goto error; } /* end if */ @@ -709,7 +709,7 @@ test_endian(size_t nx) hsize_t size[2]; /*size vector */ hsize_t i, j; - printf("%-70s", "Testing endian conversion by stride"); + HDprintf("%-70s", "Testing endian conversion by stride"); fflush(stdout); /* Initialize arrays */ @@ -742,10 +742,10 @@ test_endian(size_t nx) * to a terminal. */ AT(); - printf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); - printf(" Source array is:\n"); + HDprintf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Source array is:\n"); print_array(src, nx, (size_t)4, (size_t)1); - printf("\n Result is:\n"); + HDprintf("\n Result is:\n"); print_array(dst, nx, (size_t)4, (size_t)1); } /* end if */ goto error; @@ -795,9 +795,9 @@ test_transpose(size_t nx, size_t ny) char s[256]; hsize_t i, j; - sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, + HDsprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); - printf("%-70s", s); + HDprintf("%-70s", s); fflush(stdout); /* Initialize */ @@ -829,20 +829,20 @@ test_transpose(size_t nx, size_t ny) H5_FAILED() if(!HDisatty(1)) { AT(); - printf(" diff at i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); - printf(" Source is:\n"); + HDprintf(" diff at i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); + HDprintf(" Source is:\n"); for(i = 0; i < nx; i++) { - printf("%3lu:", (unsigned long)i); + HDprintf("%3lu:", (unsigned long)i); for(j = 0; j < ny; j++) - printf(" %6d", src[i * ny + j]); - printf("\n"); + HDprintf(" %6d", src[i * ny + j]); + HDprintf("\n"); } /* end for */ - printf("\n Destination is:\n"); + HDprintf("\n Destination is:\n"); for (i = 0; i < ny; i++) { - printf("%3lu:", (unsigned long)i); + HDprintf("%3lu:", (unsigned long)i); for(j = 0; j < nx; j++) - printf(" %6d", dst[i * nx + j]); - printf("\n"); + HDprintf(" %6d", dst[i * nx + j]); + HDprintf("\n"); } /* end for */ } /* end if */ goto error; @@ -896,10 +896,10 @@ test_sub_super(size_t nx, size_t ny) hsize_t i, j; char s[256]; - sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", + HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), (unsigned long)nx, (unsigned long)ny); - printf("%-70s", s); + HDprintf("%-70s", s); fflush(stdout); /* Initialize */ @@ -931,12 +931,12 @@ test_sub_super(size_t nx, size_t ny) H5_FAILED() if(!HDisatty(1)) { AT(); - printf(" full[%lu][%lu] != half[%lu][%lu]\n", + HDprintf(" full[%lu][%lu] != half[%lu][%lu]\n", (unsigned long)i * 2, (unsigned long)j * 2, (unsigned long)i, (unsigned long)j); - printf(" full is:\n"); + HDprintf(" full is:\n"); print_array(full, 2 * nx, 2 * ny, (size_t)1); - printf("\n half is:\n"); + HDprintf("\n half is:\n"); print_array(half, nx, ny, (size_t)1); } /* end if */ goto error; @@ -949,10 +949,10 @@ test_sub_super(size_t nx, size_t ny) * Test replicating pixels to produce an image twice as large in each * dimension. */ - sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", + HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)nx, (unsigned long)ny, (unsigned long)(2 * nx), (unsigned long)(2 * ny)); - printf("%-70s", s); + HDprintf("%-70s", s); fflush(stdout); /* Setup stride */ @@ -978,28 +978,28 @@ test_sub_super(size_t nx, size_t ny) for(i = 0; i < nx; i++) { for(j = 0; j < ny; j++) { if(half[i * ny + j] != twice[4 * i * ny + 2 * j]) - sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", + HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i, (unsigned long)j, (unsigned long)i * 2, (unsigned long)j * 2); else if(half[i * ny + j] != twice[4 * i * ny + 2 * j + 1]) - sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", + HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i, (unsigned long)j, (unsigned long)i * 2, (unsigned long)j * 2 + 1); else if(half[i * ny + j] != twice[(2 * i + 1) * 2 * ny + 2 * j]) - sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", + HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i, (unsigned long)j, (unsigned long)i * 2 + 1, (unsigned long)j * 2); else if(half[i * ny + j] != twice[(2 * i + 1) * 2 * ny + 2 * j + 1]) - sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", + HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i, (unsigned long)j, (unsigned long)i * 2 + 1, (unsigned long)j * 2 + 1); if(s[0]) { H5_FAILED() if(!HDisatty(1)) { AT(); - printf(" %s\n Half is:\n", s); + HDprintf(" %s\n Half is:\n", s); print_array(half, nx, ny, (size_t)1); - printf("\n Twice is:\n"); + HDprintf("\n Twice is:\n"); print_array(twice, 2 * nx, 2 * ny, (size_t)1); } /* end if */ goto error; @@ -1051,7 +1051,7 @@ test_array_fill(size_t lo, size_t hi) size_t u, v, w; /* Local index variables */ char s[256]; - sprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi); + HDsprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi); TESTING(s); /* Initialize */ @@ -1116,7 +1116,7 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */ char s[256]; - sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x); + HDsprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x); TESTING(s); /* Initialize */ @@ -1176,13 +1176,11 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Test various hyperslab operations. Give the words - * `small' and/or `medium' on the command line or only `small' - * is assumed. + * Purpose: Test various hyperslab operations. Give the words + * 'small' and/or 'medium' on the command line or only 'small' + * is assumed. * - * Return: Success: exit(EXIT_SUCCESS) - * - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Friday, October 10, 1997 @@ -1208,18 +1206,18 @@ main(int argc, char *argv[]) else if(!HDstrcmp(argv[i], "medium")) size_of_test |= TEST_MEDIUM; else { - printf("unrecognized argument: %s\n", argv[i]); + HDprintf("unrecognized argument: %s\n", argv[i]); HDexit(EXIT_FAILURE); } /* end else */ } /* end for */ } /* end else */ - printf("Test sizes: "); + HDprintf("Test sizes: "); if(size_of_test & TEST_SMALL) - printf(" SMALL"); + HDprintf(" SMALL"); if(size_of_test & TEST_MEDIUM) - printf(" MEDIUM"); - printf("\n"); + HDprintf(" MEDIUM"); + HDprintf("\n"); /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -1425,19 +1423,19 @@ main(int argc, char *argv[]) /*--- END OF TESTS ---*/ if(nerrors) { - printf("***** %d HYPERSLAB TEST%s FAILED! *****\n", nerrors, 1 + HDprintf("***** %d HYPERSLAB TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); if(HDisatty(1)) - printf("(Redirect output to a pager or a file to see debug output)\n"); + HDprintf("(Redirect output to a pager or a file to see debug output)\n"); HDexit(EXIT_FAILURE); } /* end if */ - printf("All hyperslab tests passed.\n"); + HDprintf("All hyperslab tests passed.\n"); #ifdef H5_HAVE_THREADSAFE H5close(); #endif /* H5_HAVE_THREADSAFE */ - return 0; + HDexit(EXIT_SUCCESS); } diff --git a/test/istore.c b/test/istore.c index 1d57a2a..c8fe866 100644 --- a/test/istore.c +++ b/test/istore.c @@ -106,21 +106,21 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) for (i = 0; i < nx; i++) { if (nz > 1) { - fprintf(stderr,"i=%lu:\n", (unsigned long)i); + HDfprintf(stderr,"i=%lu:\n", (unsigned long)i); } else { - fprintf(stderr,"%03lu:", (unsigned long)i); + HDfprintf(stderr,"%03lu:", (unsigned long)i); } for (j = 0; j < ny; j++) { if (nz > 1) - fprintf(stderr,"%03lu:", (unsigned long)j); + HDfprintf(stderr,"%03lu:", (unsigned long)j); for (k = 0; k < nz; k++) { - fprintf(stderr," %3d", *array++); + HDfprintf(stderr," %3d", *array++); } if (nz > 1) - fprintf(stderr,"\n"); + HDfprintf(stderr,"\n"); } - fprintf(stderr,"\n"); + HDfprintf(stderr,"\n"); } } @@ -268,19 +268,19 @@ test_extend(hid_t f, const char *prefix, if (!ny) { ndims = 1; ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); + HDsprintf(dims, "%lu", (unsigned long) nx); } else { ndims = 2; nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + HDsprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); } } else { ndims = 3; - sprintf(dims, "%lux%lux%lu", + HDsprintf(dims, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } - sprintf(s, "istore extend: %s", dims); + HDsprintf(s, "istore extend: %s", dims); TESTING(s); buf = (uint8_t *)HDmalloc(nx * ny * nz); check = (uint8_t *)HDmalloc(nx * ny * nz); @@ -294,10 +294,10 @@ test_extend(hid_t f, const char *prefix, max_corner[2] = 0; /* Build the new empty object */ - sprintf(name, "%s_%s", prefix, dims); + HDsprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, whole_size)) < 0) { - fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); - goto error; + HDfprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ @@ -327,21 +327,21 @@ test_extend(hid_t f, const char *prefix, #if 0 if (0 == ctr) - fprintf(stderr,"\n"); - fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); + HDfprintf(stderr,"\n"); + HDfprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); if (ndims > 1) - fprintf(stderr,",%ld", (long)offset[1]); + HDfprintf(stderr,",%ld", (long)offset[1]); if (ndims > 2) - fprintf(stderr,",%ld", (long)offset[2]); - fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); + HDfprintf(stderr,",%ld", (long)offset[2]); + HDfprintf(stderr,"), size=(%lu", (unsigned long)size[0]); if (ndims > 1) - fprintf(stderr,",%lu", (unsigned long)size[1]); + HDfprintf(stderr,",%lu", (unsigned long)size[1]); if (ndims > 2) - fprintf(stderr,",%lu", (unsigned long)size[2]); - fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); + HDfprintf(stderr,",%lu", (unsigned long)size[2]); + HDfprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); if (0 == nelmts) - fprintf(stderr," *SKIPPED*"); - fprintf(stderr,"\n"); + HDfprintf(stderr," *SKIPPED*"); + HDfprintf(stderr,"\n"); #endif /* Fill the source array */ @@ -357,7 +357,7 @@ test_extend(hid_t f, const char *prefix, /* Write to disk */ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { H5_FAILED(); - fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); + HDfprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); goto error; } @@ -365,16 +365,16 @@ test_extend(hid_t f, const char *prefix, HDmemset(check, 0xff, (size_t)nelmts); if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { H5_FAILED(); - fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); + HDfprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); goto error; } if (HDmemcmp(buf, check, (size_t)nelmts)) { H5_FAILED(); - fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); - fprintf(stderr," Wrote:\n"); + HDfprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); + HDfprintf(stderr," Wrote:\n"); print_array(buf, (size_t)size[0], (size_t)size[1], (size_t)size[2]); - fprintf(stderr," Read:\n"); + HDfprintf(stderr," Read:\n"); print_array(check, (size_t)size[0], (size_t)size[1], (size_t)size[2]); goto error; @@ -397,7 +397,7 @@ test_extend(hid_t f, const char *prefix, HDmemset(buf, 0xff, nx * ny * nz); if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5_FAILED(); - fprintf(stderr," Read failed for whole array.\n"); + HDfprintf(stderr," Read failed for whole array.\n"); goto error; } for (i=0; i<nx; i++) { @@ -405,16 +405,16 @@ test_extend(hid_t f, const char *prefix, for (k=0; k<nz; k++) { if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) { H5_FAILED(); - fprintf(stderr," Check failed at i=%lu", (unsigned long)i); + HDfprintf(stderr," Check failed at i=%lu", (unsigned long)i); if (ndims > 1) { - fprintf(stderr,", j=%lu", (unsigned long)j); + HDfprintf(stderr,", j=%lu", (unsigned long)j); } if (ndims > 2) { - fprintf(stderr,", k=%lu", (unsigned long)k); + HDfprintf(stderr,", k=%lu", (unsigned long)k); } - fprintf(stderr,"\n Check array is:\n"); + HDfprintf(stderr,"\n Check array is:\n"); print_array(whole, nx, ny, nz); - fprintf(stderr," Value read is:\n"); + HDfprintf(stderr," Value read is:\n"); print_array(buf, nx, ny, nz); goto error; } @@ -481,19 +481,19 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, if (!ny) { ndims = 1; ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); + HDsprintf(dims, "%lu", (unsigned long) nx); } else { ndims = 2; nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + HDsprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); } } else { ndims = 3; - sprintf(dims, "%lux%lux%lu", + HDsprintf(dims, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } - sprintf(s, "istore sparse: %s", dims); + HDsprintf(s, "istore sparse: %s", dims); TESTING(s); if(skip_test){ SKIPPED() @@ -512,10 +512,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size[2] = nz; /* Build the new empty object */ - sprintf(name, "%s_%s", prefix, dims); + HDsprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, chunk_dims)) < 0) { - printf(" Cannot create %u-d object `%s'\n", ndims, name); - goto error; + HDprintf(" Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ @@ -535,18 +535,18 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* write to disk */ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { H5_FAILED(); - printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); - printf(" offset=(%lu", (unsigned long) (offset[0])); + HDprintf(" Write failed: ctr=%lu\n", (unsigned long)ctr); + HDprintf(" offset=(%lu", (unsigned long) (offset[0])); if (ndims > 1) - printf(",%lu", (unsigned long) (offset[1])); + HDprintf(",%lu", (unsigned long) (offset[1])); if (ndims > 2) - printf(",%lu", (unsigned long) (offset[2])); - printf("), size=(%lu", (unsigned long) (size[0])); + HDprintf(",%lu", (unsigned long) (offset[2])); + HDprintf("), size=(%lu", (unsigned long) (size[0])); if (ndims > 1) - printf(",%lu", (unsigned long) (size[1])); + HDprintf(",%lu", (unsigned long) (size[1])); if (ndims > 2) - printf(",%lu", (unsigned long) (size[2])); - printf(")\n"); + HDprintf(",%lu", (unsigned long) (size[2])); + HDprintf(")\n"); goto error; } total += nx * ny * nz; @@ -579,17 +579,13 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Tests indexed storage stuff. - * - * Return: Success: exit(EXIT_SUCCESS) + * Purpose: Tests indexed storage * - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Wednesday, October 15, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -617,21 +613,18 @@ main(int argc, char *argv[]) } else if (!strcmp(argv[i], "large")) { size_of_test |= TEST_LARGE; } else { - printf("unrecognized argument: %s\n", argv[i]); -#if 0 - exit(EXIT_FAILURE); -#endif + HDprintf("unrecognized argument: %s\n", argv[i]); } } } - printf("Test sizes: "); + HDprintf("Test sizes: "); if (size_of_test & TEST_SMALL) - printf(" SMALL"); + HDprintf(" SMALL"); if (size_of_test & TEST_MEDIUM) - printf(" MEDIUM"); + HDprintf(" MEDIUM"); if (size_of_test & TEST_LARGE) - printf(" LARGE"); - printf("\n"); + HDprintf(" LARGE"); + HDprintf("\n"); /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -653,8 +646,8 @@ main(int argc, char *argv[]) /* Create the test file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { - printf("Cannot create file %s; test aborted\n", filename); - exit(EXIT_FAILURE); + HDprintf("Cannot create file %s; test aborted\n", filename); + HDexit(EXIT_FAILURE); } /* Initialize chunk dimensions */ @@ -708,7 +701,7 @@ main(int argc, char *argv[]) */ status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50, skip_test); if(skip_test) - printf(" The current VFD does not support sparse files on this platform.\n"); + HDprintf(" The current VFD does not support sparse files on this platform.\n"); nerrors += status < 0 ? 1 : 0; } @@ -720,15 +713,15 @@ main(int argc, char *argv[]) nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); if (nerrors) { - printf("***** %d I-STORE TEST%s FAILED! *****\n", + HDprintf("***** %d I-STORE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } - printf("All i-store tests passed.\n"); + HDprintf("All i-store tests passed.\n"); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); } diff --git a/test/lheap.c b/test/lheap.c index e9e626f..5f60dca 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -15,7 +15,7 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Tuesday, November 24, 1998 * - * Purpose: Test local heaps used by symbol tables (groups). + * Purpose: Test local heaps used by symbol tables (groups). */ #include "h5test.h" #include "H5srcdir.h" @@ -34,7 +34,7 @@ const char *FILENAME[] = { #define NOBJS 40 - + /*------------------------------------------------------------------------- * Function: main * @@ -100,7 +100,7 @@ main(void) goto error; } for(i = 0; i < NOBJS; i++) { - sprintf(buf, "%03d-", i); + HDsprintf(buf, "%03d-", i); for(j = 4; j < i; j++) buf[j] = (char)('0' + j % 10); if(j > 4) @@ -140,7 +140,7 @@ main(void) goto error; } for(i = 0; i < NOBJS; i++) { - sprintf(buf, "%03d-", i); + HDsprintf(buf, "%03d-", i); for(j = 4; j < i; j++) buf[j] = (char)('0' + j % 10); if(j > 4) diff --git a/test/links.c b/test/links.c index 2658101..4eb4126 100644 --- a/test/links.c +++ b/test/links.c @@ -12,38 +12,35 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke <matzke@llnl.gov> - * Friday, April 10, 1998 - * - * Purpose: Tests hard, soft (symbolic) & external links. + * Purpose: Tests hard, soft (symbolic) & external links. */ /* * This file needs to access private information from the H5FD package. * This file also needs to access the file driver testing code. */ -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING /* * This file needs to access private information from the H5G package. * This file also needs to access the group testing code. */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING #include "h5test.h" #include "H5srcdir.h" -#include "H5FDpkg.h" /* File drivers */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ +#include "H5FDpkg.h" /* File drivers */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" -#define TMPDIR "tmp/" -#define TMPDIR2 "tmp2/" +#define TMPDIR "tmp_links/" +#define TMPDIR2 "tmp2_links/" /* Symlinks for external link symlink test */ #define SYMLINK1 TMPDIR "sym1.h5" @@ -62,55 +59,55 @@ const char *FILENAME[] = { "links6", /* 9 */ "links7", /* 10 */ "links8", /* 11 */ - "extlinks0", /* 12: main files */ - TMPDIR "extlinks0", /* 13: */ - "extlinks1", /* 14: target files */ - TMPDIR "extlinks1", /* 15: */ - "extlinks2", /* 16: */ - TMPDIR "extlinks2", /* 17: */ - "extlinks3", /* 18: */ - TMPDIR "extlinks3", /* 19: */ - "extlinks4", /* 20: */ - TMPDIR "extlinks4", /* 21: */ - "extlinks5", /* 22: */ - TMPDIR "extlinks6", /* 23: */ - "extlinks7", /* 24: */ - TMPDIR "extlinks7", /* 25: */ - TMPDIR "extlinks8", /* 26: */ - "extlinks9", /* 27: */ - TMPDIR "extlinks9", /* 28: */ - "extlinks10", /* 29: */ /* TESTS for windows */ - TMPDIR "extlinks10",/* 30: */ - TMPDIR "extlinks11",/* 31: */ - TMPDIR "extlinks12",/* 32: */ - "extlinks13", /* 33: */ - TMPDIR "extlinks13",/* 34: */ - TMPDIR "extlinks14",/* 35: */ - TMPDIR "extlinks15",/* 36: */ - "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ - "extlinks16B", /* 38: */ - "extlinks17", /* 39: */ - "extlinks18A", /* 40: */ - "extlinks18B", /* 41: */ - "extlinks19A", /* 42: */ - "extlinks19B", /* 43: */ - "extlinks20", /* 44: */ - "extlinks21A", /* 45: Files for symlink() tests*/ - TMPDIR2 "extlinks21B",/* 46: */ - TMPDIR2 "extlinks21C",/* 47: */ - "extlinks21C", /* 48: (same as #47, only without the TMPDIR2 prefix) */ - TMPDIR "extlinks21D",/* 49: */ - TMPDIR "extlinks21E",/* 50: */ - "extlinks21E", /* 51: (same as #50, only without the TMPDIR prefix) */ + "extlinks0", /* 12: main files */ + TMPDIR "extlinks0", /* 13: */ + "extlinks1", /* 14: target files */ + TMPDIR "extlinks1", /* 15: */ + "extlinks2", /* 16: */ + TMPDIR "extlinks2", /* 17: */ + "extlinks3", /* 18: */ + TMPDIR "extlinks3", /* 19: */ + "extlinks4", /* 20: */ + TMPDIR "extlinks4", /* 21: */ + "extlinks5", /* 22: */ + TMPDIR "extlinks6", /* 23: */ + "extlinks7", /* 24: */ + TMPDIR "extlinks7", /* 25: */ + TMPDIR "extlinks8", /* 26: */ + "extlinks9", /* 27: */ + TMPDIR "extlinks9", /* 28: */ + "extlinks10", /* 29: */ /* TESTS for windows */ + TMPDIR "extlinks10", /* 30: */ + TMPDIR "extlinks11", /* 31: */ + TMPDIR "extlinks12", /* 32: */ + "extlinks13", /* 33: */ + TMPDIR "extlinks13", /* 34: */ + TMPDIR "extlinks14", /* 35: */ + TMPDIR "extlinks15", /* 36: */ + "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ + "extlinks16B", /* 38: */ + "extlinks17", /* 39: */ + "extlinks18A", /* 40: */ + "extlinks18B", /* 41: */ + "extlinks19A", /* 42: */ + "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ + "extlinks21A", /* 45: Files for symlink() tests*/ + TMPDIR2 "extlinks21B", /* 46: */ + TMPDIR2 "extlinks21C", /* 47: */ + "extlinks21C", /* 48: (same as #47, only without the TMPDIR2 prefix) */ + TMPDIR "extlinks21D", /* 49: */ + TMPDIR "extlinks21E", /* 50: */ + "extlinks21E", /* 51: (same as #50, only without the TMPDIR prefix) */ NULL }; -#define FAMILY_SIZE 1024 +#define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 -#define NUM40 40 +#define NUM40 40 -/* do not do check_all_closed() for "ext*" files and "tmp/ext*" */ -#define EXTSTOP 12 +/* do not do check_all_closed() for "ext*" files and "tmp_links/ext*" */ +#define EXTSTOP 12 #define LINK_BUF_SIZE 1024 #define NAME_BUF_SIZE 1024 @@ -318,7 +315,7 @@ typedef struct { static hid_t dcpl_g; /* for [un]minimized dataset object headers */ - + /*------------------------------------------------------------------------- * Function: fix_ext_filename * @@ -326,43 +323,32 @@ static hid_t dcpl_g; /* for [un]minimized dataset object headers */ * path name of Unix and Windows. * * Return: void - * - * Programmer: Raymond Lu - * 14 Jan. 2009 *------------------------------------------------------------------------- */ static void fix_ext_filename(char *path_name, char *cwd, const char *file_name) { HDstrcpy(path_name, cwd); - HDstrcat(path_name, "/"); HDstrcat(path_name, file_name); } - + /*------------------------------------------------------------------------- - * Function: mklinks - * - * Purpose: Build a file with assorted links. + * Function: mklinks * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Friday, August 14, 1998 - * - * Modifications: + * Purpose: Build a file with assorted links. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static int mklinks(hid_t fapl, hbool_t new_format) { - hid_t file, scalar, grp, d1; - hsize_t size[1] = {1}; - char filename[NAME_BUF_SIZE]; + hid_t file, scalar, grp, d1; + hsize_t size[1] = {1}; + char filename[NAME_BUF_SIZE]; if(new_format) TESTING("link creation (w/new group format)") @@ -399,38 +385,31 @@ mklinks(hid_t fapl, hbool_t new_format) if(H5Fclose(file) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: - return -1; + return FAIL; } - + /*------------------------------------------------------------------------- * Function: new_links * * Purpose: Build a file with assorted links for different locations. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Raymond Lu - * Friday, April 19, 2002 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int new_links(hid_t fapl, hbool_t new_format) { - hid_t file_a, file_b=(-1); - hid_t grp1_a=(-1), grp1_b=(-1), grp2_a=(-1), grp2_b=(-1); - hid_t scalar=(-1); - hid_t dset1=(-1), dset2=(-1); - char filename[NAME_BUF_SIZE]; - hsize_t size[1] = {1}; + hid_t file_a, file_b=(-1); + hid_t grp1_a=(-1), grp1_b=(-1), grp2_a=(-1), grp2_b=(-1); + hid_t scalar=(-1); + hid_t dset1=(-1), dset2=(-1); + char filename[NAME_BUF_SIZE]; + hsize_t size[1] = {1}; if(new_format) TESTING("H5Lcreate functions (w/new group format)") @@ -488,50 +467,43 @@ new_links(hid_t fapl, hbool_t new_format) if(H5Fclose(file_b) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Sclose(scalar); - H5Dclose(dset1); - H5Dclose(dset2); - H5Gclose(grp1_a); - H5Gclose(grp2_a); - H5Gclose(grp1_b); - H5Gclose(grp2_b); - H5Fclose(file_a); - H5Fclose(file_b); - } H5E_END_TRY; - return -1; + H5Sclose(scalar); + H5Dclose(dset1); + H5Dclose(dset2); + H5Gclose(grp1_a); + H5Gclose(grp2_a); + H5Gclose(grp1_b); + H5Gclose(grp2_b); + H5Fclose(file_a); + H5Fclose(file_b); + } H5E_END_TRY; + return FAIL; } - + /*------------------------------------------------------------------------- - * Function: cklinks - * - * Purpose: Open the file created in the first step and check that the - * links look correct. - * - * Return: Success: 0 + * Function: cklinks * - * Failure: -1 - * - * Programmer: Robb Matzke - * Friday, August 14, 1998 - * - * Modifications: + * Purpose: Open the file created in the first step and check that the + * links look correct. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static int cklinks(hid_t fapl, hbool_t new_format) { - hid_t file; - H5O_info_t oinfo1, oinfo2; - H5L_info_t linfo2; - char linkval[LINK_BUF_SIZE]; - char filename[NAME_BUF_SIZE]; - herr_t status; + hid_t file; + H5O_info_t oinfo1, oinfo2; + H5L_info_t linfo2; + char linkval[LINK_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; + herr_t status; if(new_format) TESTING("link queries (w/new group format)") @@ -546,15 +518,15 @@ cklinks(hid_t fapl, hbool_t new_format) if(H5Oget_info_by_name2(file, "d1", &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Oget_info_by_name2(file, "grp1/hard", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_TYPE_DATASET != oinfo2.type) { - H5_FAILED(); - HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); + TEST_ERROR } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { - H5_FAILED(); - HDputs(" Hard link test failed. Link seems not to point to the "); - HDputs(" expected file location."); - TEST_ERROR + H5_FAILED(); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); + TEST_ERROR } /* end if */ if(H5Lexists(file, "/", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -565,91 +537,91 @@ cklinks(hid_t fapl, hbool_t new_format) status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs(" H5Lexists() should have failed for a path with missing components."); - TEST_ERROR + H5_FAILED(); + HDputs(" H5Lexists() should have failed for a path with missing components."); + TEST_ERROR } /* end if */ H5E_BEGIN_TRY { status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs(" H5Lexists() should have failed for a path with missing components."); - TEST_ERROR + H5_FAILED(); + HDputs(" H5Lexists() should have failed for a path with missing components."); + TEST_ERROR } /* end if */ /* Symbolic link */ if(H5Oget_info_by_name2(file, "grp1/soft", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_TYPE_DATASET != oinfo2.type) { - H5_FAILED(); - HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); + TEST_ERROR } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { - H5_FAILED(); - HDputs(" Soft link test failed. Link seems not to point to the "); - HDputs(" expected file location."); - TEST_ERROR + H5_FAILED(); + HDputs(" Soft link test failed. Link seems not to point to the "); + HDputs(" expected file location."); + TEST_ERROR } /* end if */ if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(HDstrcmp(linkval, "/d1")) { - H5_FAILED(); - HDputs(" Soft link test failed. Wrong link value"); - TEST_ERROR + H5_FAILED(); + HDputs(" Soft link test failed. Wrong link value"); + TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR /* Dangling link */ H5E_BEGIN_TRY { - status = H5Oget_info_by_name2(file, "grp1/dangle", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); + status = H5Oget_info_by_name2(file, "grp1/dangle", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); - TEST_ERROR + H5_FAILED(); + HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); + TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5L_TYPE_SOFT != linfo2.type) { - H5_FAILED(); - HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); + TEST_ERROR } /* end if */ if(H5Lget_val(file, "grp1/dangle", linkval, sizeof linkval, H5P_DEFAULT) < 0) { - H5_FAILED(); - HDprintf(" %d: Can't retrieve link value\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Can't retrieve link value\n", __LINE__); + TEST_ERROR } /* end if */ if(HDstrcmp(linkval, "foobar")) { - H5_FAILED(); - HDputs(" Dangling link test failed. Wrong link value"); - TEST_ERROR + H5_FAILED(); + HDputs(" Dangling link test failed. Wrong link value"); + TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR /* Recursive link */ H5E_BEGIN_TRY { - status = H5Oget_info_by_name2(file, "grp1/recursive", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); + status = H5Oget_info_by_name2(file, "grp1/recursive", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { - H5_FAILED(); - HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); - TEST_ERROR + H5_FAILED(); + HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); + TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5L_TYPE_SOFT != linfo2.type) { - H5_FAILED(); - HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); + TEST_ERROR } /* end if */ if(H5Lget_val(file, "grp1/recursive", linkval, sizeof linkval, H5P_DEFAULT) < 0) { - H5_FAILED(); - HDprintf(" %d: Can't retrieve link value\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Can't retrieve link value\n", __LINE__); + TEST_ERROR } /* end if */ if(HDstrcmp(linkval, "/grp1/recursive")) { - H5_FAILED(); - HDputs(" Recursive link test failed. Wrong link value"); - TEST_ERROR + H5_FAILED(); + HDputs(" Recursive link test failed. Wrong link value"); + TEST_ERROR } /* end if */ /* Non-existent link */ @@ -659,13 +631,13 @@ cklinks(hid_t fapl, hbool_t new_format) if(H5Fclose(file) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: - return -1; + return FAIL; } - + /*------------------------------------------------------------------------- * Function: ck_new_links * @@ -673,20 +645,15 @@ error: * links look correct. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Raymond Lu - * Thursday, April 25, 2002 - * *------------------------------------------------------------------------- */ static int ck_new_links(hid_t fapl, hbool_t new_format) { - hid_t file; - H5O_info_t oi_dset, oi_hard1, oi_hard2; - char filename[NAME_BUF_SIZE]; + hid_t file; + H5O_info_t oi_dset, oi_hard1, oi_hard2; + char filename[NAME_BUF_SIZE]; if(new_format) TESTING("new link queries (w/new group format)") @@ -698,62 +665,52 @@ ck_new_links(hid_t fapl, hbool_t new_format) if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Get hard link info */ - if(H5Oget_info_by_name2(file, "/grp1/dataset2", &oi_dset, H5O_INFO_BASIC, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Oget_info_by_name2(file, "/grp1/hard1", &oi_hard1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Oget_info_by_name2(file, "/grp2/hard2", &oi_hard2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Oget_info_by_name2(file, "/grp1/dataset2", &oi_dset, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Oget_info_by_name2(file, "/grp1/hard1", &oi_hard1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Oget_info_by_name2(file, "/grp2/hard2", &oi_hard2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR /* Check hard links */ if(H5O_TYPE_DATASET != oi_hard1.type || H5O_TYPE_DATASET != oi_hard2.type) { - H5_FAILED(); - HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); - TEST_ERROR + H5_FAILED(); + HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); + TEST_ERROR } if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) { - H5_FAILED(); - HDputs(" Hard link test failed. Link seems not to point to the "); - HDputs(" expected file location."); - TEST_ERROR + H5_FAILED(); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); + TEST_ERROR } /* Cleanup */ if(H5Fclose(file) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: - return -1; + return FAIL; } - + /*------------------------------------------------------------------------- * Function: long_links * * Purpose: Build a file with long names * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Saturday, April 16, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int long_links(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ - char *objname = NULL; /* Name of object [Long] */ - size_t u; /* Local index variable */ - char filename[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t gid2 = -1; /* Datatype ID */ + char *objname = NULL; /* Name of object [Long] */ + size_t u; /* Local index variable */ + char filename[NAME_BUF_SIZE]; if(new_format) TESTING("long names for objects & links (w/new group format)") @@ -792,42 +749,35 @@ long_links(hid_t fapl, hbool_t new_format) HDfree(objname); PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose (gid2); - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid2); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; HDfree(objname); - return -1; + return FAIL; } - + /*------------------------------------------------------------------------- * Function: toomany * * Purpose: Build a file with too many symbolic links * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, August 9, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int toomany(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; if(new_format) TESTING("too many links (w/new group format)") @@ -917,9 +867,9 @@ toomany(hid_t fapl, hbool_t new_format) gid = H5Gopen2(fid, "soft17", H5P_DEFAULT); } H5E_END_TRY; if(gid >= 0) { - H5_FAILED(); - HDputs(" Should have failed for sequence of too many nested links."); - TEST_ERROR + H5_FAILED(); + HDputs(" Should have failed for sequence of too many nested links."); + TEST_ERROR } /* end if */ /* Open object through lesser soft link */ @@ -940,18 +890,18 @@ toomany(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end toomany() */ - + /*------------------------------------------------------------------------- * Function: test_lcpl * @@ -959,26 +909,20 @@ toomany(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: number of errors - * - * Programmer: James Laird - * Monday, January 30, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_lcpl(hid_t fapl, hbool_t new_format) { - hid_t file_id=-1; - hid_t group_id=-1; - hid_t space_id=-1; - hid_t dset_id=-1; - hid_t type_id=-1; - hid_t lcpl_id=-1; - H5L_info_t linfo; - char filename[1024]; - hsize_t dims[2]; + hid_t file_id = -1; + hid_t group_id = -1; + hid_t space_id = -1; + hid_t dset_id = -1; + hid_t type_id = -1; + hid_t lcpl_id = -1; + H5L_info_t linfo; + char filename[1024]; + hsize_t dims[2]; if(new_format) TESTING("link creation property lists (w/new group format)") @@ -1097,7 +1041,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Fclose(file_id) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -1111,29 +1055,22 @@ error: return 1; } /* end test_lcpl() */ - + /*------------------------------------------------------------------------- * Function: test_move * * Purpose: Tests H5Lmove() * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: James Laird - * Friday, March 30, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_move(hid_t fapl, hbool_t new_format) { - hid_t file_a, file_b=(-1); - hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1); - char filename[1024]; + hid_t file_a = -1, file_b = -1; + hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1; + char filename[1024]; if(new_format) TESTING("H5Lmove (w/new group format)") @@ -1142,11 +1079,9 @@ test_move(hid_t fapl, hbool_t new_format) /* Create two new files */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create groups in first file */ if((grp_1 = H5Gcreate2(file_a, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1154,99 +1089,75 @@ test_move(hid_t fapl, hbool_t new_format) if((grp_move = H5Gcreate2(grp_1, "group_move", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create hard, soft and external links. */ - if(H5Lcreate_hard(grp_1, "group_move", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_soft("/group1/group_move", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_hard(grp_1, "group_move", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_soft("/group1/group_move", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Move a group within the file. Both of source and destination use * H5L_SAME_LOC. Should fail. */ H5E_BEGIN_TRY { - if(H5Lmove(H5L_SAME_LOC, "group_move", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) - !=FAIL) TEST_ERROR + if(H5Lmove(H5L_SAME_LOC, "group_move", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT)!=FAIL) TEST_ERROR } H5E_END_TRY; /* Move a group across files. Should fail. */ H5E_BEGIN_TRY { - if(H5Lmove(grp_1, "group_move", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) - !=FAIL) TEST_ERROR + if(H5Lmove(grp_1, "group_move", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) !=FAIL) TEST_ERROR } H5E_END_TRY; /* Move a soft link across files. Should succeed. */ - if(H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE) - TEST_ERROR + if(H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR /* Move an external link across files. Should succeed. */ - if(H5Lmove(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE) - TEST_ERROR + if(H5Lmove(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR /* Move a group across groups in the same file while renaming it. */ - if(H5Lmove(grp_1, "group_move", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lmove(grp_1, "group_move", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group just moved to the new location. */ if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if( H5Gclose(moved_grp) < 0) - TEST_ERROR + FAIL_STACK_ERROR + if( H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is no longer in the original location */ H5E_BEGIN_TRY { moved_grp = H5Gopen2(grp_1, "group_move", H5P_DEFAULT); } H5E_END_TRY; if(moved_grp >= 0) { - H5_FAILED(); - HDputs(" Group still in original location?"); - TEST_ERROR + H5_FAILED(); + HDputs(" Group still in original location?"); + TEST_ERROR } /* end if */ /* Use H5Lmove to rename a group without moving it. */ - if(H5Lmove(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lmove(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group. */ - if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Use H5Lmove to move a group without renaming it. */ - if(H5Lmove(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lmove(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group . */ - if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Move the group while giving long paths. */ - if(H5Lmove(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lmove(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is in no previous locations */ H5E_BEGIN_TRY { - if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) >= 0) - FAIL_STACK_ERROR - if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) >= 0) - FAIL_STACK_ERROR - if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) >= 0) - FAIL_STACK_ERROR - if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) >= 0) - FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR } H5E_END_TRY; H5Gclose(grp_1); @@ -1256,44 +1167,37 @@ test_move(hid_t fapl, hbool_t new_format) H5Fclose(file_b); PASSED(); - return 0; + return SUCCEED; - error: +error: H5_FAILED(); H5E_BEGIN_TRY { - H5Gclose(grp_1); - H5Gclose(grp_2); - H5Gclose(grp_move); + H5Gclose(grp_1); + H5Gclose(grp_2); + H5Gclose(grp_move); H5Gclose(moved_grp); - H5Fclose(file_a); - H5Fclose(file_b); + H5Fclose(file_a); + H5Fclose(file_b); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_copy * * Purpose: Tests H5Lcopy() * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: James Laird - * Friday, March 30, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_copy(hid_t fapl, hbool_t new_format) { - hid_t file_a, file_b=(-1); - hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1); - char filename[1024]; + hid_t file_a = -1, file_b = -1; + hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1; + char filename[1024]; if(new_format) TESTING("H5Lcopy (w/new group format)") @@ -1302,11 +1206,9 @@ test_copy(hid_t fapl, hbool_t new_format) /* Create two new files */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create groups in first file */ if((grp_1 = H5Gcreate2(file_a, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1314,111 +1216,76 @@ test_copy(hid_t fapl, hbool_t new_format) if((grp_move = H5Gcreate2(grp_1, "group_copy", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create hard, soft and external links. */ - if(H5Lcreate_hard(grp_1, "group_copy", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_soft("/group1/group_copy", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_hard(grp_1, "group_copy", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_soft("/group1/group_copy", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Copy a group within the file. Both of source and destination use * H5L_SAME_LOC. Should fail. */ H5E_BEGIN_TRY { - if(H5Lcopy(H5L_SAME_LOC, "group_copy", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) - !=FAIL) TEST_ERROR + if(H5Lcopy(H5L_SAME_LOC, "group_copy", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) !=FAIL) TEST_ERROR } H5E_END_TRY; /* Copy a group across files. Should fail. */ H5E_BEGIN_TRY { - if(H5Lcopy(grp_1, "group_copy", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) - !=FAIL) TEST_ERROR + if(H5Lcopy(grp_1, "group_copy", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) !=FAIL) TEST_ERROR } H5E_END_TRY; /* Copy a soft link across files. Should succeed. */ - if(H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE) - TEST_ERROR + if(H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR /* Copy an external link across files. Should succeed. */ - if(H5Lcopy(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE) - TEST_ERROR + if(H5Lcopy(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR /* Move a group across groups in the same file while renaming it. */ - if(H5Lcopy(grp_1, "group_copy", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcopy(grp_1, "group_copy", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is also in the original location */ - if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Use H5Lcopy to create a group in the same location with a different name. */ - if(H5Lcopy(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcopy(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group. */ - if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is also in the original location */ - if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Use H5Lcopy to copy to a different location with the same name. */ - if(H5Lcopy(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcopy(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group . */ - if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is still in the previous location */ - if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Copy the group while giving long paths. */ - if(H5Lcopy(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcopy(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is still in all previous original locations */ - if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR - if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR - if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR - if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - if(H5Gclose(moved_grp) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR H5Gclose(grp_1); H5Gclose(grp_2); @@ -1427,22 +1294,22 @@ test_copy(hid_t fapl, hbool_t new_format) H5Fclose(file_b); PASSED(); - return 0; + return SUCCEED; - error: +error: H5_FAILED(); H5E_BEGIN_TRY { - H5Gclose(grp_1); - H5Gclose(grp_2); - H5Gclose(grp_move); + H5Gclose(grp_1); + H5Gclose(grp_2); + H5Gclose(grp_move); H5Gclose(moved_grp); - H5Fclose(file_a); - H5Fclose(file_b); + H5Fclose(file_a); + H5Fclose(file_b); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_move_preserves * @@ -1451,12 +1318,6 @@ test_copy(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: number of errors - * - * Programmer: James Laird - * Monday, January 30, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1604,20 +1465,20 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Fclose(file_id) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Pclose(fcpl_id); - H5Pclose(lcpl_id); - H5Pclose(lcpl2_id); + H5Pclose(fcpl_id); + H5Pclose(lcpl_id); + H5Pclose(lcpl2_id); H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; return 1; } /* end test_move_preserves() */ - + /*------------------------------------------------------------------------- * Function: test_deprec * @@ -1625,12 +1486,6 @@ error: * * Return: Success: 0 * Failure: number of errors - * - * Programmer: James Laird - * Wednesday, April 26 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -1640,7 +1495,7 @@ test_deprec(hid_t fapl, hbool_t new_format) hid_t file_id = -1; hid_t group1_id = -1; hid_t group2_id = -1; - H5G_stat_t sb_hard1, sb_hard2, sb_soft1, sb_soft2; + H5G_stat_t sb_hard1, sb_hard2, sb_soft1, sb_soft2; H5G_obj_t obj_type; /* Object type */ hsize_t num_objs; /* Number of objects in a group */ char filename[1024]; @@ -1756,7 +1611,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -1768,34 +1623,27 @@ error: } /* end test_deprec() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: external_link_root * * Purpose: Build a file with external link to root group in external file * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Wednesday, May 25, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_root(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - H5L_info_t linfo; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE]; - char filename2[NAME_BUF_SIZE]; - const char *file; /* File from external link */ - const char *path; /* Path from external link */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + H5L_info_t linfo; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE]; + char filename2[NAME_BUF_SIZE]; + const char *file; /* File from external link */ + const char *path; /* Path from external link */ if(new_format) TESTING("external link to root (w/new group format)") @@ -1824,21 +1672,21 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check information for external link */ if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { - H5_FAILED(); - HDputs(" Unexpected object type - should have been an external link"); - goto error; + H5_FAILED(); + HDputs(" Unexpected object type - should have been an external link"); + goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { - H5_FAILED(); - HDputs(" External link file name incorrect"); - goto error; + H5_FAILED(); + HDputs(" External link file name incorrect"); + goto error; } if(HDstrcmp(path, "/")) { - H5_FAILED(); - HDputs(" External link path incorrect"); - goto error; + H5_FAILED(); + HDputs(" External link path incorrect"); + goto error; } /* Create external link to object in first file */ @@ -1848,28 +1696,27 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check information for external link */ if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { - H5_FAILED(); - HDputs(" Unexpected object type - should have been an external link"); - goto error; + H5_FAILED(); + HDputs(" Unexpected object type - should have been an external link"); + goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { - H5_FAILED(); - HDputs(" External link file name incorrect"); - goto error; + H5_FAILED(); + HDputs(" External link file name incorrect"); + goto error; } if(HDstrcmp(path, "/")) { - H5_FAILED(); - HDputs(" External link path incorrect"); - goto error; + H5_FAILED(); + HDputs(" External link path incorrect"); + goto error; } /* Close and re-open file to ensure that data is written to disk */ if(H5Fclose(fid) < 0) TEST_ERROR if((fid = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - /* Open object through external link */ if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1941,18 +1788,18 @@ external_link_root(hid_t fapl, hbool_t new_format) H5F_sfile_assert_num(0); PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid2); - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid2); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_root() */ - + /*------------------------------------------------------------------------- * Function: external_link_path * @@ -1960,24 +1807,17 @@ external_link_root(hid_t fapl, hbool_t new_format) * external file * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, July 26, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_path(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE]; - char filename2[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE]; + char filename2[NAME_BUF_SIZE]; if(new_format) TESTING("external link to object on path (w/new group format)") @@ -2049,18 +1889,18 @@ external_link_path(hid_t fapl, hbool_t new_format) PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid2); - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid2); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_path() */ - + /*------------------------------------------------------------------------- * Function: external_link_mult * @@ -2068,26 +1908,19 @@ external_link_path(hid_t fapl, hbool_t new_format) * external file links * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, July 26, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_mult(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1), fid2 = (-1); /* File IDs */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - filename4[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = -1, fid2 = -1; /* File IDs */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + filename4[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("external links across multiple files (w/new group format)") @@ -2213,44 +2046,37 @@ external_link_mult(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid2); - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid2); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_mult() */ - + /*------------------------------------------------------------------------- * Function: external_link_self * * Purpose: Build a file with external link to itself * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: James Laird - * Wednesday, July 12, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_self(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - hid_t lcpl_id = (-1); /* Link Creation Property List ID */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE]; - char filename2[NAME_BUF_SIZE]; - char filename3[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t lcpl_id = -1; /* Link Creation Property List ID */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE]; + char filename2[NAME_BUF_SIZE]; + char filename3[NAME_BUF_SIZE]; if(new_format) TESTING("external link to self (w/new group format)") @@ -2311,8 +2137,8 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Complicate things. Use this file as an intermediate file in a chain - * of external links that will go: file2 -> file1 -> file1 -> file3 - */ + * of external links that will go: file2 -> file1 -> file1 -> file3 + */ /* Create file2 with an external link to file1 */ if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -2336,7 +2162,6 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Close file1 */ if(H5Fclose(fid) < 0) TEST_ERROR - /* Re-open file2 and traverse through file1 (with its recursive extlink) to file3 */ if((fid=H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR @@ -2361,19 +2186,19 @@ external_link_self(hid_t fapl, hbool_t new_format) PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Pclose(lcpl_id); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Pclose(lcpl_id); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_self() */ - + /*------------------------------------------------------------------------- * Function: external_link_pingpong * @@ -2401,11 +2226,11 @@ external_link_self(hid_t fapl, hbool_t new_format) static int external_link_pingpong(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1), gid2 = (-1); /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("external links back and forth (w/new group format)") @@ -2417,7 +2242,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2); /* Create first file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external links for chain */ if(H5Lcreate_external(filename2, "/link2", fid, "link1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -2432,7 +2257,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR /* Create second file */ - if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external links for chain */ if(H5Lcreate_external(filename1, "/link3", fid, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -2444,7 +2269,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) /* Open first file */ - if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open object through external link */ if((gid = H5Gopen2(fid, "link1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2465,7 +2290,6 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) /* Close first file */ if(H5Fclose(fid) < 0) TEST_ERROR - /* Open first file again and check on object created */ if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -2484,18 +2308,18 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_pingpong() */ - + /*------------------------------------------------------------------------- * Function: external_link_toomany * @@ -2523,24 +2347,17 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) * file1:/link17 -> file2: /final * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, August 8, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_toomany(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("too many external links (w/new group format)") @@ -2575,7 +2392,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR /* Create second file */ - if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external links for chain */ if(H5Lcreate_external(filename1, "/link3", fid, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -2596,16 +2413,16 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* Open first file */ - if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open object through external link */ H5E_BEGIN_TRY { gid = H5Gopen2(fid, "link1", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { - H5_FAILED(); - HDprintf("%d: Should have failed for sequence of too many nested links.", __LINE__); - goto error; + H5_FAILED(); + HDprintf("%d: Should have failed for sequence of too many nested links.", __LINE__); + goto error; } /* Open object through external link */ @@ -2628,18 +2445,18 @@ external_link_toomany(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid2); - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid2); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_toomany() */ - + /*------------------------------------------------------------------------- * Function: external_link_dangling * @@ -2647,25 +2464,18 @@ external_link_toomany(hid_t fapl, hbool_t new_format) * missing files and missing objects. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, August 9, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_dangling(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - hid_t rid = (-1); /* Root Group ID */ - hid_t status = (-1); /* Status */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + hid_t rid = -1; /* Root Group ID */ + hid_t status = -1; /* Status */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("dangling external links (w/new group format)") @@ -2677,7 +2487,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2); /* Create first file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create dangling external links */ if(H5Lcreate_external("missing", "/missing", fid, "no_file", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -2687,26 +2497,26 @@ external_link_dangling(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR /* Create second file (for dangling object test) */ - if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR /* Open first file */ - if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Get root group ID */ - if((rid=H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR; + if((rid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR; /* Open object through dangling file external link */ H5E_BEGIN_TRY { gid = H5Gopen2(fid, "no_file", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { - H5_FAILED(); - HDputs(" Should have failed for sequence of too many nested links."); - goto error; + H5_FAILED(); + HDputs(" Should have failed for sequence of too many nested links."); + goto error; } /* Open object through dangling object external link */ @@ -2714,9 +2524,9 @@ external_link_dangling(hid_t fapl, hbool_t new_format) gid = H5Gopen2(fid, "no_object", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { - H5_FAILED(); - HDputs(" Should have failed for sequence of too many nested links."); - goto error; + H5_FAILED(); + HDputs(" Should have failed for sequence of too many nested links."); + goto error; } /* Try to get name of object by index through dangling file external link */ @@ -2736,47 +2546,41 @@ external_link_dangling(hid_t fapl, hbool_t new_format) PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_dangling() */ - + /*------------------------------------------------------------------------- * Function: external_link_prefix * * Purpose: 1. target link: "extlinks2" - * 2. main file: "extlinks0" - * 3. target file: "tmp/extlinks2" - * 4. Set up external link prefix via H5Pset_elink_prefix() to be "tmp" - * Should be able to access the target file in tmp directory via the prefix set - * by H5Pset_elink_prefix() + * 2. main file: "extlinks0" + * 3. target file: "tmp_links/extlinks2" + * 4. Set up external link prefix via H5Pset_elink_prefix() to be "tmp_links" + * Should be able to access the target file in tmp_links directory via the prefix set + * by H5Pset_elink_prefix() * * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb 19, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_prefix(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - hid_t gapl_id = (-1); - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + hid_t gapl_id = -1; + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE]; if(new_format) TESTING("external links via H5Pset_elink_prefix()(w/new group format)") @@ -2788,16 +2592,16 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /* set up name for external linked target file: "extlinks2" */ h5_fixname(FILENAME[16], fapl, filename2, sizeof filename2); - /* create tmp directory and get current working directory path */ + /* create tmp_links directory and get current working directory path */ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR + TEST_ERROR - /* set up name for target file: "tmp/extlinks2" */ + /* set up name for target file: "tmp_links/extlinks2" */ h5_fixname(FILENAME[17], fapl, filename3, sizeof filename3); /* Create the target file */ - if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* closing for target file */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -2805,7 +2609,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /* Create the main file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file (without the absolute path) */ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -2821,9 +2625,9 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp directory."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links directory."); + goto error; } /* closing for main file */ @@ -2831,45 +2635,39 @@ external_link_prefix(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_prefix() */ - + /*------------------------------------------------------------------------- * Function: external_link_abs_mainpath: test 3 * * Purpose: 1. target link: "extlinks3" - * 2. main file: Linux:"/CWD/tmp/extlinks0"; Windows: "<cur drive>:/CWD/tmp/extlinks0" - * 3. target file: "tmp/extlinks3" - * Should be able to access the target file via the main file's absolute path + * 2. main file: Linux:"/CWD/tmp_links/extlinks0"; Windows: "<cur drive>:/CWD/tmp_links/extlinks0" + * 3. target file: "tmp_links/extlinks3" + * Should be able to access the target file via the main file's absolute path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb 19, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_abs_mainpath(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's absolute path (w/new group format)") @@ -2878,17 +2676,17 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) /* set up name for external linked target file: "extlinks3" */ h5_fixname(FILENAME[18], fapl, filename2, sizeof filename2); - /* set up name for target file: "tmp/extlinks3" */ + /* set up name for target file: "tmp_links/extlinks3" */ h5_fixname(FILENAME[19], fapl, filename3, sizeof filename3); - /* create tmp directory and get current working directory path */ + /* create tmp_links directory and get current working directory path */ if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))) TEST_ERROR /* * set up name for main file: - * Linux: "/CWD/tmp/extlinks0" - * Window: "<cur drive>:/CWD/tmp/extlinks0" + * Linux: "/CWD/tmp_links/extlinks0" + * Window: "<cur drive>:/CWD/tmp_links/extlinks0" */ fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); @@ -2915,9 +2713,9 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from absolute path set for main file */ if(gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp directory."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links directory."); + goto error; } /* closing for main file */ @@ -2925,43 +2723,37 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_abs_mainpath() */ - + /*------------------------------------------------------------------------- * Function: external_link_rel_mainpath: test 4 * - * Purpose: 1. target link: "extlinks4" - * 2. main file: "tmp/extlinks0" - * 3. target file: "tmp/extlinks4" - * Should be able to access the target file via the main file's CWD+relative path + * Purpose: 1. target link: "extlinks4" + * 2. main file: "tmp_links/extlinks0" + * 3. target file: "tmp_links/extlinks4" + * Should be able to access the target file via the main file's CWD+relative path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb 19, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_rel_mainpath(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's CWD + relative path(w/new group format)") @@ -2974,14 +2766,14 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR - /* set up name for main file: "tmp/extlinks0" */ + /* set up name for main file: "tmp_links/extlinks0" */ h5_fixname(FILENAME[13], fapl, filename1, sizeof filename1); - /* set up name for target file: "tmp/extlinks4" */ + /* set up name for target file: "tmp_links/extlinks4" */ h5_fixname(FILENAME[21], fapl, filename3, sizeof filename3); /* Create the target file */ - if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* closing for target file */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -2989,7 +2781,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) /* Create the main file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file */ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -3001,9 +2793,9 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the main file's relative pathname */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in current working directory"); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in current working directory"); + goto error; } /* closing for main file */ @@ -3011,45 +2803,37 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_rel_mainpath() */ - + /*------------------------------------------------------------------------- * Function: external_link_cwd: test 5 * * Purpose: 1. target link: "extlinks5" - * 2. main file: Linux:"/CWD/tmp/extlinks0"; Window: "<cur drive>:/CWD/tmp/extlinks0" - * 2. target file: "extlinks5" - * Should be able to access the target file in the current working directory - * + * 2. main file: Linux:"/CWD/tmp_links/extlinks0"; Window: "<cur drive>:/CWD/tmp_links/extlinks0" + * 3. target file: "extlinks5" + * Should be able to access the target file in the current working directory * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb 19, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_cwd(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; - + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via current working directory(w/new group format)") @@ -3065,8 +2849,8 @@ external_link_cwd(hid_t fapl, hbool_t new_format) /* * set up name for main file: - * Linux: "/CWD/tmp/extlinks0" - * Windows: "<cur drive>:/CWD/tmp/extlinks0" + * Linux: "/CWD/tmp_links/extlinks0" + * Windows: "<cur drive>:/CWD/tmp_links/extlinks0" */ fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); @@ -3093,9 +2877,9 @@ external_link_cwd(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the current working directory */ if(gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in current working directory"); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in current working directory"); + goto error; } /* closing for main file */ @@ -3103,46 +2887,39 @@ external_link_cwd(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_cwd() */ - /*------------------------------------------------------------------------- * Function: external_link_abstar: test 6 * - * Purpose: 1. target link: Linux:"/CWD/tmp/extlinks6"; Windows:"<cur drive>:/CWD/tmp/extlinks6" - * 2. main file: "extlinks0" - * 3. target file: "tmp/extlinks6" - * Should be able to access the target file's absolute path + * Purpose: 1. target link: Linux:"/CWD/tmp_links/extlinks6"; Windows:"<cur drive>:/CWD/tmp_links/extlinks6" + * 2. main file: "extlinks0" + * 3. target file: "tmp_links/extlinks6" + * Should be able to access the target file's absolute path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb. 20, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_abstar(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via target's absolute path (w/new group format)") @@ -3152,19 +2929,19 @@ external_link_abstar(hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - /* create tmp directory and get current working directory path */ + /* create tmp_links directory and get current working directory path */ if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))) TEST_ERROR /* * set up name for external linked target file: - * Linux: "/CWD/tmp/extlinks6" - * Windows: "<cur drive>:/CWD/tmp/extlinks6" + * Linux: "/CWD/tmp_links/extlinks6" + * Windows: "<cur drive>:/CWD/tmp_links/extlinks6" */ fix_ext_filename(tmpname, cwdpath, FILENAME[23]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); - /* set up name for target file: "tmp/extlinks6" */ + /* set up name for target file: "tmp_links/extlinks6" */ h5_fixname(FILENAME[23], fapl, filename3, sizeof filename3); /* Create the target file */ @@ -3175,7 +2952,6 @@ external_link_abstar(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -3189,9 +2965,9 @@ external_link_abstar(hid_t fapl, hbool_t new_format) /* should be able to find the target file with abolute path */ if(gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp directory."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links directory."); + goto error; } /* closing for main file */ @@ -3199,44 +2975,38 @@ external_link_abstar(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_abstar() */ /*------------------------------------------------------------------------- * Function: external_link_abstar_cur: test 7 * - * Purpose: 1. target link: Linux: "/CWD/tmp/extlinks7"; Windows: "<cur drive>:/CWD/tmp/extlinks7" - * 2. main file: "extlinks0" - * 3. target file: "extlinks7" - * Should be able to access the target file via the main file's CWD. + * Purpose: 1. target link: Linux: "/CWD/tmp_links/extlinks7"; Windows: "<cur drive>:/CWD/tmp_links/extlinks7" + * 2. main file: "extlinks0" + * 3. target file: "extlinks7" + * Should be able to access the target file via the main file's CWD. * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb. 20, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_abstar_cur(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's CWD (w/new group format)") @@ -3249,14 +3019,14 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) /* set up name for target file name: "extlinks7" */ h5_fixname(FILENAME[24], fapl, filename3, sizeof filename3); - /* create tmp directory and get current working directory path */ + /* create tmp_links directory and get current working directory path */ if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))) TEST_ERROR /* * set up name for external linked target file: - * Linux: "/CWD/tmp/extlinks7" - * Windows: "<cur drive>:/CWD/tmp/extlinks7" + * Linux: "/CWD/tmp_links/extlinks7" + * Windows: "<cur drive>:/CWD/tmp_links/extlinks7" */ fix_ext_filename(tmpname, cwdpath, FILENAME[25]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); @@ -3269,7 +3039,6 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -3283,9 +3052,9 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) /* should be able to find the target file from main file's current working directory */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in current working directory."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in current working directory."); + goto error; } /* closing for main file */ @@ -3293,42 +3062,36 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_abstar_cur() */ - + /*------------------------------------------------------------------------- * Function: external_link_reltar: test 8 * - * Purpose: 1. target link: Linux:"tmp/extlinks8" - * 2. main file: "extlinks0" - * 3. target file: "tmp/extlinks8" - * Should be able to access the target file via the main file's CWD+ target's relative path + * Purpose: 1. target link: Linux:"tmp_links/extlinks8" + * 2. main file: "extlinks0" + * 3. target file: "tmp_links/extlinks8" + * Should be able to access the target file via the main file's CWD+ target's relative path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb. 20, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_reltar(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's CWD + target's relative path(w/new group format)") @@ -3338,12 +3101,11 @@ external_link_reltar(hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - /* create tmp directory */ - if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR + /* create tmp_links directory */ + if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR - /* set up name for target file name: "tmp/extlinks8" */ - /* set up name for external linked target file: "tmp/extlinks8" */ + /* set up name for target file name: "tmp_links/extlinks8" */ + /* set up name for external linked target file: "tmp_links/extlinks8" */ h5_fixname(FILENAME[26], fapl, filename2, sizeof filename2); /* Create the target file */ @@ -3363,9 +3125,9 @@ external_link_reltar(hid_t fapl, hbool_t new_format) /* Open object through external link */ if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp directory."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links directory."); + goto error; } /* end if */ /* closing for main file */ @@ -3373,45 +3135,39 @@ external_link_reltar(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_reltar() */ - + /*------------------------------------------------------------------------- * Function: external_link_chdir: test 9 * * Purpose: - * 1. target link: "extlinks9" - * 2. main file: "extlinks0" - * 3. target file" "tmp/extlinks9" - * 3. chdir "tmp" - * Should be able to access the target file in current working directory + * 1. target link: "extlinks9" + * 2. main file: "extlinks0" + * 3. target file" "tmp_links/extlinks9" + * 3. chdir "tmp_links" + * Should be able to access the target file in current working directory * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Feb. 20, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_chdir(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE]; if(new_format) TESTING("external links via chdir and found in current working directory (w/new group format)") @@ -3423,11 +3179,10 @@ external_link_chdir(hid_t fapl, hbool_t new_format) /* set up name for external linked target file ("extlinks9") */ h5_fixname(FILENAME[27], fapl, filename2, sizeof filename2); - /* create tmp directory */ - if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR + /* create tmp_links directory */ + if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR - /* set up name for target file name ("tmp/extlinks9") */ + /* set up name for target file name ("tmp_links/extlinks9") */ h5_fixname(FILENAME[28], fapl, filename3, sizeof filename3); /* Create the target file */ @@ -3438,9 +3193,8 @@ external_link_chdir(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file */ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -3460,9 +3214,9 @@ external_link_chdir(hid_t fapl, hbool_t new_format) * main file's current working directory + pathname of external linked targetfile */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp directory."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links directory."); + goto error; } /* closing for main file */ @@ -3470,62 +3224,56 @@ external_link_chdir(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_chdir() */ - + /*------------------------------------------------------------------------- * Function: external_set_elink_fapl1: test 10 * * Purpose: To verify that the external linked target file with physical layout - * different from the parent can be successfully opened. - * - * 1. target link: "extlinks16" - * 2. target file: "extlinks16" - * 3. main file: Linux:"/CWD/tmp/extlinks0"; Window: "<cur drive>:/CWD/tmp/extlinks0" - * 4. Create target file A to be a "family" file: extlinks16A - * 4. Create target file B to be a "multi" file: extlinks16B - * 5. Create external link from main file to target file A: ext_linkA->extlinks16A:/A - * 5. Create external link from main file to target file B: ext_linkB->extlinks16B:/B - * 6. Should succeed in opening the target object: ext_extA - * 6. Should succeed in opening the target object: ext_extB + * different from the parent can be successfully opened. + * + * 1. target link: "extlinks16" + * 2. target file: "extlinks16" + * 3. main file: Linux:"/CWD/tmp_links/extlinks0"; Window: "<cur drive>:/CWD/tmp_links/extlinks0" + * 4. Create target file A to be a "family" file: extlinks16A + * 4. Create target file B to be a "multi" file: extlinks16B + * 5. Create external link from main file to target file A: ext_linkA->extlinks16A:/A + * 5. Create external link from main file to target file B: ext_linkB->extlinks16B:/B + * 6. Should succeed in opening the target object: ext_extA + * 6. Should succeed in opening the target object: ext_extB * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Sept. 12, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_set_elink_fapl1(hid_t fapl, hbool_t new_format) { - hid_t fid=(-1); - hid_t fidA=(-1), fidB=(-1); - hid_t gidA=(-1), gidB=(-1); - hid_t oidA=(-1), oidB=(-1); - char filename1[NAME_BUF_SIZE], - filename2A[NAME_BUF_SIZE], - filename2B[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; - hid_t fam_fapl=-1, multi_fapl=-1; - hid_t lapl_idA=-1, lapl_idB=-1; - H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; - hid_t memb_fapl[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][64]; - const char *memb_name[H5FD_MEM_NTYPES]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; + hid_t fid=(-1); + hid_t fidA=(-1), fidB=(-1); + hid_t gidA=(-1), gidB=(-1); + hid_t oidA=(-1), oidB=(-1); + char filename1[NAME_BUF_SIZE], + filename2A[NAME_BUF_SIZE], + filename2B[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; + hid_t fam_fapl=-1, multi_fapl=-1; + hid_t lapl_idA=-1, lapl_idB=-1; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + char sv[H5FD_MEM_NTYPES][64]; + H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; if(new_format) TESTING("H5Pset/get_elink_fapl() with different physical layouts (w/new group format)") @@ -3533,20 +3281,19 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) TESTING("H5Pset/get_elink_fapl() with different physical layouts") if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))) - TEST_ERROR + TEST_ERROR /* * set up name for main file: - * Linux: "/CWD/tmp/extlinks0" - * Windows: "<cur drive>:/CWD/tmp/extlinks0" + * Linux: "/CWD/tmp_links/extlinks0" + * Windows: "<cur drive>:/CWD/tmp_links/extlinks0" */ fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); /* create "family" fapl */ fam_fapl = h5_fileaccess(); - if(H5Pset_fapl_family(fam_fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) - TEST_ERROR; + if(H5Pset_fapl_family(fam_fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; /* set up name for external linked target file A: "extlinks16A" */ /* set up name for target file A: "extlinks16A" */ @@ -3560,8 +3307,8 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) HDmemset(sv, 0, sizeof sv); for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { - memb_map[mt] = H5FD_MEM_SUPER; - memb_fapl[mt] = H5P_DEFAULT; + memb_map[mt] = H5FD_MEM_SUPER; + memb_fapl[mt] = H5P_DEFAULT; } /* end for */ memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW; @@ -3595,8 +3342,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* create "multi" fapl */ multi_fapl = h5_fileaccess(); - if(H5Pset_fapl_multi(multi_fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0) - TEST_ERROR; + if(H5Pset_fapl_multi(multi_fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0) TEST_ERROR; /* set up name for external linked target file B: "extlinks16B" */ /* set up name for target file B: "extlinks16B" */ @@ -3620,11 +3366,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file A:/A */ - if(H5Lcreate_external(filename2A, "/A", fid, "ext_linkA", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2A, "/A", fid, "ext_linkA", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Create external link to target file B:/B */ - if(H5Lcreate_external(filename2B, "/B", fid, "ext_linkB", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2B, "/B", fid, "ext_linkB", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Set file access property list for link access to use the family driver */ if((lapl_idA = H5Pcreate(H5P_LINK_ACCESS)) < 0) TEST_ERROR @@ -3635,9 +3379,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object A in the current working directory */ if (oidA < 0) { - H5_FAILED(); - HDputs(" Should succeed in opening family target file A in current working directory"); - goto error; + H5_FAILED(); + HDputs(" Should succeed in opening family target file A in current working directory"); + goto error; } /* Set file access property list for link access to use the multi driver */ @@ -3649,9 +3393,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object B in the current working directory */ if (oidB < 0) { - H5_FAILED(); - HDputs(" Should succeed in opening multi target file B in current working directory"); - goto error; + H5_FAILED(); + HDputs(" Should succeed in opening multi target file B in current working directory"); + goto error; } /* closing */ @@ -3664,67 +3408,61 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Pclose (lapl_idA); - H5Pclose (lapl_idB); - H5Pclose (fam_fapl); - H5Pclose (multi_fapl); - H5Gclose (gidA); - H5Gclose (gidB); - H5Oclose (oidA); - H5Oclose (oidB); - H5Fclose (fid); - } H5E_END_TRY; - return -1; + H5Pclose (lapl_idA); + H5Pclose (lapl_idB); + H5Pclose (fam_fapl); + H5Pclose (multi_fapl); + H5Gclose (gidA); + H5Gclose (gidB); + H5Oclose (oidA); + H5Oclose (oidB); + H5Fclose (fid); + } H5E_END_TRY; + return FAIL; } /* end external_set_elink_fapl1() */ - + /*------------------------------------------------------------------------- * Function: external_set_elink_fapl2: test 11 * * Purpose: To verify that processing done to the external linked target object is - * correctly handled when the parent and target files have the same - * physical layout but different access methods. - * - * 1. target link: "extlinks17" - * 2. target file: "extlinks17" - * 3. main file: Linux:"/CWD/tmp/extlinks0"; Window: "<cur drive>:/CWD/tmp/extlinks0" - * 4. Create target file to be a "core" file:/A/Dataset - * 5. Create external link from main file to target file:ext_link->target file:/A/Dataset - * 6. Set the file access property list of the link access to use "core" file without - * backing store - * 6. Should succeed in opening the target dataset: ext_link - * 7. Write data to the target dataset - * 8. On closing, the file size of target should be the same as before since - * it is opened without backing store. + * correctly handled when the parent and target files have the same + * physical layout but different access methods. + * + * 1. target link: "extlinks17" + * 2. target file: "extlinks17" + * 3. main file: Linux:"/CWD/tmp_links/extlinks0"; Window: "<cur drive>:/CWD/tmp_links/extlinks0" + * 4. Create target file to be a "core" file:/A/Dataset + * 5. Create external link from main file to target file:ext_link->target file:/A/Dataset + * 6. Set the file access property list of the link access to use "core" file without + * backing store + * 7. Should succeed in opening the target dataset: ext_link + * 8. Write data to the target dataset + * 9. On closing, the file size of target should be the same as before since + * it is opened without backing store. * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Sept. 12, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_set_elink_fapl2(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - hid_t core_fapl = -1, space = -1, dset = -1, did = -1, dapl_id = -1, dcpl = -1; - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; - hsize_t dims[2]; - int points[NUM40][NUM40]; - h5_stat_size_t filesize, new_filesize; - int i, j, n; + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group IDs */ + hid_t core_fapl = -1, space = -1, dset = -1, did = -1, dapl_id = -1, dcpl = -1; + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; + hsize_t dims[2]; + int points[NUM40][NUM40]; + int i, j, n; + h5_stat_size_t filesize, new_filesize; if(new_format) TESTING("H5Pset/get_elink_fapl() with same physical layout (w/new group format)") @@ -3736,16 +3474,15 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) /* * set up name for main file: - * Linux: "/CWD/tmp/extlinks0" - * Windows: "<cur drive>:/CWD/tmp/extlinks0" + * Linux: "/CWD/tmp_links/extlinks0" + * Windows: "<cur drive>:/CWD/tmp_links/extlinks0" */ fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); /* create fapl for the target file to be a "core" file */ core_fapl = h5_fileaccess(); - if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0) - TEST_ERROR + if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR /* set up name for external linked target file: "extlinks17" */ /* set up name for target file: "extlinks17" */ @@ -3768,8 +3505,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) TEST_ERROR; /* create "Dataset" in group "A" of target file */ - if((dset = H5Dcreate2(gid, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - TEST_ERROR + if((dset = H5Dcreate2(gid, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR /* closing for target file */ if(H5Pclose(dcpl) < 0) TEST_ERROR @@ -3785,12 +3521,10 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file: ext_link->extlinks17:/A/Dataset */ - if(H5Lcreate_external(filename2, "/A/Dataset", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/A/Dataset", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* create fapl to be a "core" file without backing store */ - if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, FALSE) < 0) - TEST_ERROR + if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, FALSE) < 0) TEST_ERROR /* Set file access property list for link access to use the "core" driver */ if((dapl_id = H5Pcreate(H5P_DATASET_ACCESS)) < 0) TEST_ERROR @@ -3810,8 +3544,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) points[i][j] = n++; /* Write the data to the dataset */ - if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) - TEST_ERROR + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) TEST_ERROR if(H5Pclose(dapl_id) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR @@ -3825,59 +3558,53 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) if(H5Pclose(core_fapl) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Sclose(space); - H5Dclose(dset); - H5Pclose(core_fapl); - H5Pclose(dapl_id); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid); + H5Pclose(dcpl); + H5Sclose(space); + H5Dclose(dset); + H5Pclose(core_fapl); + H5Pclose(dapl_id); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_set_elink_fapl2() */ - + /*------------------------------------------------------------------------- * Function: external_set_elink_fapl3: test 12 * * Purpose: To verify that the file access property list for link access is - * set and closed correctly. - * - * 1. Create fapl for core driver - * 2. Create fapl for stdio driver - * 3. Set link access's fapl to use stdio driver - * 4. Verify that link access's fapl is the stdio driver - * 5. Reset the link access' fapl to use core driver - * 6. H5Pcopy() the link access - * 7. Get the fapl property value of the original link access - * 8. Close the original link access - * 9. H5Pclose() fapl should fail since closing in step #8 should also close its fapl - * 10. Verify that the copied link access's fapl is the core driver - * 11. Get the fapl property value of the copied link access - * 12. H5Premove() the fapl property from the copied link access - * 13. H5Pclose() fapl set in the copied link access should fail since the - * removal in #12 should also close its fapl + * set and closed correctly. + * + * 1. Create fapl for core driver + * 2. Create fapl for stdio driver + * 3. Set link access's fapl to use stdio driver + * 4. Verify that link access's fapl is the stdio driver + * 5. Reset the link access' fapl to use core driver + * 6. H5Pcopy() the link access + * 7. Get the fapl property value of the original link access + * 8. Close the original link access + * 9. H5Pclose() fapl should fail since closing in step #8 should also close its fapl + * 10. Verify that the copied link access's fapl is the core driver + * 11. Get the fapl property value of the copied link access + * 12. H5Premove() the fapl property from the copied link access + * 13. H5Pclose() fapl set in the copied link access should fail since the + * removal in #12 should also close its fapl * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * Sept. 12, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_set_elink_fapl3(hbool_t new_format) { - hid_t core_fapl = -1, stdio_fapl = -1; - hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl; + hid_t core_fapl = -1, stdio_fapl = -1; + hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl; if(new_format) TESTING("H5Pset/get_fapl() (w/new group format)") @@ -3886,12 +3613,10 @@ external_set_elink_fapl3(hbool_t new_format) /* create fapl for the target file to be a "core" file */ core_fapl = h5_fileaccess(); - if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0) - TEST_ERROR + if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR stdio_fapl = h5_fileaccess(); - if(H5Pset_fapl_stdio(stdio_fapl) < 0) - TEST_ERROR + if(H5Pset_fapl_stdio(stdio_fapl) < 0) TEST_ERROR /* Set file access property list for link access to use the "stdio" driver */ if((lapl_id = H5Pcreate(H5P_LINK_ACCESS)) < 0) TEST_ERROR @@ -3932,9 +3657,9 @@ external_set_elink_fapl3(hbool_t new_format) if(H5Pclose(stdio_fapl) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { H5Pclose(l_fapl); H5Pclose(lapl_id); @@ -3942,10 +3667,10 @@ external_set_elink_fapl3(hbool_t new_format) H5Pclose(core_fapl); H5Pclose(stdio_fapl); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_set_elink_fapl3() */ - + /*------------------------------------------------------------------------- * Function: external_set_elink_acc_flags * @@ -3953,12 +3678,6 @@ external_set_elink_fapl3(hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Jan. 5, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4153,9 +3872,9 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo if(H5Pclose(gapl) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { H5Gclose(group); H5Gclose(subgroup); @@ -4163,10 +3882,10 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo H5Fclose(file2); H5Pclose(gapl); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_set_elink_acc_flags() */ - + /*------------------------------------------------------------------------- * Function: external_set_elink_cb * @@ -4174,12 +3893,6 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Jan. 5, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ /* User data structure for callback function */ @@ -4217,7 +3930,7 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, if (op_data->code == 2) *flags = H5F_ACC_DEFAULT; - return 0; + return SUCCEED; } /* Main test function */ @@ -4226,7 +3939,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) { hid_t file1 = -1, file2 = -1, group = -1, gapl = -1, fam_fapl = -1, ret_fapl = -1, base_driver; set_elink_cb_t op_data, - *op_data_p; + *op_data_p; H5L_elink_traverse_t cb; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; @@ -4242,7 +3955,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) op_data.target_file = filename2; /* Core file driver has issues when used as the member file driver for a family file */ /* Family file driver cannot be used with family or multi drivers for member files */ - /* Also disable parallel member drivers, because H5F_HAS_FEATURE(H5FD_FEAT_HAS_MPI) + /* Also disable parallel member drivers, because H5F_HAS_FEATURE(H5FD_FEAT_HAS_MPI) would report FALSE, causing problems */ base_driver = H5Pget_driver(fapl); op_data.base_fapl = (base_driver == H5FD_FAMILY || base_driver == H5FD_MULTI @@ -4319,9 +4032,9 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) if(H5Pclose(gapl) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { H5Gclose(group); H5Fclose(file1); @@ -4330,10 +4043,10 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) H5Pclose(ret_fapl); H5Pclose(fam_fapl); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_set_elink_cb() */ - + /*------------------------------------------------------------------------- * Function: external_reset_register * @@ -4342,12 +4055,6 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Apr. 9, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4385,47 +4092,41 @@ external_reset_register(void) if(HDremove(filename) != 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { H5Fclose(file); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_reset_register() */ - + #ifdef H5_HAVE_WINDOW_PATH /*------------------------------------------------------------------------- * Function: external_link_win1 * * Purpose: - * 1. target link: "/CWD/tmp/extlinks10" - * 2. main file: "extlinks0" - * 3. target file: "extlinks10" - * Should be able to find the target file via main file's current drive/rel path + * 1. target link: "/CWD/tmp_links/extlinks10" + * 2. main file: "extlinks0" + * 3. target file: "extlinks10" + * Should be able to find the target file via main file's current drive/rel path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * April 15, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_win1(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's current drive/rel path(windows)(w/new group format)") @@ -4438,7 +4139,7 @@ external_link_win1(hid_t fapl, hbool_t new_format) if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR - /* set up name for target link: "/CWD/tmp/extlinks10" */ + /* set up name for target link: "/CWD/tmp_links/extlinks10" */ HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */ HDstrcat(tmpname, "/"); HDstrcat(tmpname, FILENAME[30]); @@ -4455,7 +4156,6 @@ external_link_win1(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -4469,9 +4169,9 @@ external_link_win1(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's CWD*/ if(gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in CWD."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in CWD."); + goto error; } /* closing for main file */ @@ -4479,46 +4179,40 @@ external_link_win1(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win1() */ - + /*------------------------------------------------------------------------- * Function: external_link_win2 * * Purpose: - * 1. target link: "/CWD/tmp/extlinks11" - * 2. main file: "extlinks0" - * 3. target file: "tmp/extlinks11" - * Should be able to access the target file directly (rel drive/abs path) + * 1. target link: "/CWD/tmp_links/extlinks11" + * 2. main file: "extlinks0" + * 3. target file: "tmp_links/extlinks11" + * Should be able to access the target file directly (rel drive/abs path) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * April 15, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_win2(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via target's rel drive/abs path directly(windows)(w/new group format)") @@ -4528,17 +4222,17 @@ external_link_win2(hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - /* create tmp directory and get current working directory path */ + /* create tmp_links directory and get current working directory path */ if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))) TEST_ERROR - /* set up name for target link: "/CWD/tmp/extlinks11" */ + /* set up name for target link: "/CWD/tmp_links/extlinks11" */ HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it relative drive but absolute path */ HDstrcat(tmpname, "/"); HDstrcat(tmpname, FILENAME[31]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); - /* set up name for target file: "tmp/extlinks11" */ + /* set up name for target file: "tmp_links/extlinks11" */ h5_fixname(FILENAME[31], fapl, filename3, sizeof filename3); /* Create the target file */ @@ -4563,9 +4257,9 @@ external_link_win2(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links."); + goto error; } /* closing for main file */ @@ -4573,46 +4267,40 @@ external_link_win2(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win2() */ - + /*------------------------------------------------------------------------- * Function: external_link_win3 * * Purpose: - * 1. target link: "<cur drive>:tmp/extlinks12" - * 2. main file: "extlinks0" - * 3. target file: "tmp/extlinks12" - * Should be able to access the target file directly (abs drive/rel path) + * 1. target link: "<cur drive>:tmp_links/extlinks12" + * 2. main file: "extlinks0" + * 3. target file: "tmp_links/extlinks12" + * Should be able to access the target file directly (abs drive/rel path) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * April i15 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_win3(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - int drive=0; - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + int drive = 0; + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE]; if(new_format) TESTING("external links via target's abs drive/rel path directly (windows)(w/new group format)") @@ -4622,16 +4310,16 @@ external_link_win3(hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - /* create tmp directory */ + /* create tmp_links directory */ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR - /* set up name for target link: "<drive-letter>:tmp/extlinks12" */ + /* set up name for target link: "<drive-letter>:tmp_links/extlinks12" */ drive = HDgetdrive(); HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[32]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); - /* set up name for target file: "tmp/extlinks12" */ + /* set up name for target file: "tmp_links/extlinks12" */ h5_fixname(FILENAME[32], fapl, filename3, sizeof filename3); /* Create the target file */ @@ -4656,9 +4344,9 @@ external_link_win3(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links."); + goto error; } /* closing for main file */ @@ -4666,52 +4354,46 @@ external_link_win3(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win3() */ - + /*------------------------------------------------------------------------- * Function: external_link_win4 * * Purpose: - * 1. target link: "<cur drive>:extlinks13" - * 2. main file: "<cur-drive>:tmp/extlinks0" - * 3. target file: tmp/extlinks13 - * Should be able to access the target file via main file's abs drive/rel path + * 1. target link: "<cur drive>:extlinks13" + * 2. main file: "<cur-drive>:tmp_links/extlinks0" + * 3. target file: tmp_links/extlinks13 + * Should be able to access the target file via main file's abs drive/rel path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * April 15, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_win4(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - int drive=0; - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + int drive=0; + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's abs drive/rel path (windows)(w/new group format)") else TESTING("external links via main file's abs drive/rel path (windows)") - /* set up name for main file: "<drive-letter>:tmp/extlinks0" */ + /* set up name for main file: "<drive-letter>:tmp_links/extlinks0" */ drive = HDgetdrive(); HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); @@ -4720,20 +4402,19 @@ external_link_win4(hid_t fapl, hbool_t new_format) HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[33]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); - /* set up name for target file: "tmp/extlinks13" */ + /* set up name for target file: "tmp_links/extlinks13" */ h5_fixname(FILENAME[34], fapl, filename3, sizeof filename3); /* Create the target file */ - if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* closing for target file */ if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file */ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -4745,9 +4426,9 @@ external_link_win4(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's absolute drive/relative path */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in CWD."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in CWD."); + goto error; } /* closing for main file */ @@ -4755,47 +4436,41 @@ external_link_win4(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win4() */ - + /*------------------------------------------------------------------------- * Function: external_link_win5 * * Purpose: - * 1. target link: "<cur drive+1>:tmp/extlinks14" - * 2. main file: "/CWD/extlinks0" - * 3. target file: "tmp/extlinks14" - * Should be able to access the target file via main file's relative drive/absolute path + * 1. target link: "<cur drive+1>:tmp_links/extlinks14" + * 2. main file: "/CWD/extlinks0" + * 3. target file: "tmp_links/extlinks14" + * Should be able to access the target file via main file's relative drive/absolute path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * April 15, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_win5(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - int drive=0; - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + int drive=0; + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's rel drive/abs path (windows)(w/new group format)") @@ -4805,6 +4480,10 @@ external_link_win5(hid_t fapl, hbool_t new_format) if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR drive = HDgetdrive(); + if (drive >= 26) + drive -= 1; /* account for drive Z */ + else + drive += 1; /* set up name for main file: "/CWD/extlinks0" */ HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */ @@ -4812,11 +4491,11 @@ external_link_win5(hid_t fapl, hbool_t new_format) HDstrcat(tmpname, FILENAME[12]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); - /* set up name for target link: "<drive-letter+1>:tmp/extlinks14" */ - HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", ((drive+1)+'A'-1), FILENAME[35]); + /* set up name for target link: "<drive-letter+1>:tmp_links/extlinks14" */ + HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[35]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); - /* set up name for target file: "tmp/extlinks14" */ + /* set up name for target file: "tmp_links/extlinks14" */ h5_fixname(FILENAME[35], fapl, filename3, sizeof filename3); /* Create the target file */ @@ -4827,7 +4506,6 @@ external_link_win5(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -4841,9 +4519,9 @@ external_link_win5(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's rel drive/abs path */ if(gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in CWD."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in CWD."); + goto error; } /* closing for main file */ @@ -4851,78 +4529,75 @@ external_link_win5(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win5() */ - + /*------------------------------------------------------------------------- * Function: external_link_win6 * * Purpose: - * 1. target link: "<cur drive+1>:tmp/extlinks15" - * 2. main file: "extlinks0" - * 3. target file: "tmp/extlinks15" - * Should be able to access the target file via target's current drive/rel path + * 1. target link: "<cur drive+1>:tmp_links/extlinks15" + * 2. main file: "extlinks0" + * 3. target file: "tmp_links/extlinks15" + * Should be able to access the target file via target's current drive/rel path * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi - * April 15, 2008 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_win6(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - int drive=0; - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + int drive=0; + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE]; if(new_format) TESTING("external links via target's current drive/rel path (windows)(w/new group format)") else TESTING("external links via target's current drive/rel path (windows)") - /* create tmp directory */ + /* create tmp_links directory */ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR drive = HDgetdrive(); + if (drive >= 26) + drive -= 1; /* account for drive Z */ + else + drive += 1; /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - /* set up name for target link: "<drive-letter+1>:tmp/extlinks15" */ - HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", ((drive+1)+'A'-1), FILENAME[36]); + /* set up name for target link: "<drive-letter+1>:tmp_links/extlinks15" */ + HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[36]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); /* set up name for target file: "tmp/extlinks15" */ h5_fixname(FILENAME[36], fapl, filename3, sizeof filename3); /* Create the target file */ - if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* closing for target file */ if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link to target file */ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -4934,9 +4609,9 @@ external_link_win6(hid_t fapl, hbool_t new_format) /* should be able to find the target file via target file's rel path in current drive */ if (gid < 0) { - H5_FAILED(); - HDputs(" Should have found the file in tmp."); - goto error; + H5_FAILED(); + HDputs(" Should have found the file in tmp_links."); + goto error; } /* closing for main file */ @@ -4944,25 +4619,25 @@ external_link_win6(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win6() */ - + /*------------------------------------------------------------------------- * Function: external_link_win7 * * Purpose: - * 1. UNC target link: "\\127.0.01\c$/tmp/extlinks10" + * 1. UNC target link: "\\127.0.01\c$/tmp_links/extlinks10" * 2. main file: "extlinks0" * 3. target file: "extlinks15" - * Should be able to find the target file via main file's local host/main drive/rel path + * Should be able to find the target file via main file's local host/main drive/rel path * * Return: Success: 0 * Failure: -1 @@ -4971,8 +4646,8 @@ external_link_win6(hid_t fapl, hbool_t new_format) static int external_link_win7(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], @@ -4990,7 +4665,7 @@ external_link_win7(hid_t fapl, hbool_t new_format) if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR - /* set up name for target link: "\\127.0.0.1\c$/tmp/extlinks10" */ + /* set up name for target link: "\\127.0.0.1\c$/tmp_links/extlinks10" */ HDstrcpy(tmpname, "\\\\127.0.0.1\\c$"); /* absolute path */ HDstrcat(tmpname, "/"); HDstrcat(tmpname, FILENAME[30]); @@ -5007,7 +4682,6 @@ external_link_win7(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -5031,17 +4705,17 @@ external_link_win7(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win7() */ - + /*------------------------------------------------------------------------- * Function: external_link_win8 * @@ -5049,7 +4723,7 @@ external_link_win7(hid_t fapl, hbool_t new_format) * 1. Long UNC target link: "\\?\<cur drive>:\CWD\extlinks10" * 2. main file: "extlinks0" * 3. target file: "extlinks10" - * Should be able to access the target file directly (abs drive/abs path) + * Should be able to access the target file directly (abs drive/abs path) * * Return: Success: 0 * Failure: -1 @@ -5059,9 +4733,9 @@ external_link_win7(hid_t fapl, hbool_t new_format) static int external_link_win8(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - int drive=0; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + int drive = 0; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], @@ -5076,12 +4750,10 @@ external_link_win8(hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) - TEST_ERROR + if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR - /* create tmp directory */ - if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR + /* create tmp_links directory */ + if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR /* set up name for target link: "<drive-letter>:\CWD\extlinks10" */ drive = HDgetdrive(); @@ -5099,7 +4771,6 @@ external_link_win8(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -5114,7 +4785,7 @@ external_link_win8(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - HDputs(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp_links."); goto error; } @@ -5123,25 +4794,25 @@ external_link_win8(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win8() */ - + /*------------------------------------------------------------------------- * Function: external_link_win9 * * Purpose: - * 1. Long UNC target link: "\\?\UNC\127.0.01\c$/tmp/extlinks10" + * 1. Long UNC target link: "\\?\UNC\127.0.01\c$/tmp_links/extlinks10" * 2. main file: "extlinks0" * 3. target file: "extlinks15" - * Should be able to find the target file via main file's local host/main drive/rel path + * Should be able to find the target file via main file's local host/main drive/rel path * * Return: Success: 0 * Failure: -1 @@ -5150,13 +4821,13 @@ external_link_win8(hid_t fapl, hbool_t new_format) static int external_link_win9(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; if(new_format) TESTING("external links via main file's Long UNC local host/main drive/rel path(windows)(w/new group format)") @@ -5166,10 +4837,9 @@ external_link_win9(hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks0" */ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1); - if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) - TEST_ERROR + if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR - /* set up name for target link: "\\?\UNC\127.0.0.1\c$/tmp/extlinks10" */ + /* set up name for target link: "\\?\UNC\127.0.0.1\c$/tmp_links/extlinks10" */ HDstrcpy(tmpname, "\\\\?\\UNC\127.0.0.1\\c$"); /* absolute path */ HDstrcat(tmpname, "/"); HDstrcat(tmpname, FILENAME[30]); @@ -5186,7 +4856,6 @@ external_link_win9(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - /* Create the main file */ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -5210,19 +4879,19 @@ external_link_win9(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_win9() */ #endif /* H5_HAVE_WINDOW_PATH */ - + /*------------------------------------------------------------------------- * Function: external_link_recursive * @@ -5230,20 +4899,14 @@ external_link_win9(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, August 15, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_recursive(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("recursive external links (w/new group format)") @@ -5254,7 +4917,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1); /* Create first file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create recursive external links */ if(H5Lcreate_external(filename1, "/recursive", fid, "recursive", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -5262,36 +4925,34 @@ external_link_recursive(hid_t fapl, hbool_t new_format) /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR - /* Open file */ - if((fid=H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open object through dangling file external link */ H5E_BEGIN_TRY { gid = H5Gopen2(fid, "recursive", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { - H5_FAILED(); - HDputs(" Should have failed for recursive external links."); - goto error; + H5_FAILED(); + HDputs(" Should have failed for recursive external links."); + goto error; } /* Close first file */ if(H5Fclose(fid) < 0) TEST_ERROR - PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_recursive() */ - + /*------------------------------------------------------------------------- * Function: external_link_query * @@ -5300,25 +4961,19 @@ external_link_recursive(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, August 15, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int external_link_query(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ const char *file_name; /* Name of the file the external link points to */ const char *object_name; /* Name of the object the external link points to */ - H5O_info_t oi; /* Object information */ + H5O_info_t oi; /* Object information */ H5L_info_t li; /* Link information */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ if(new_format) @@ -5331,7 +4986,7 @@ external_link_query(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2); /* Create first file, with external link to object in second file */ - if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create external link */ /* (add a few extra '/'s to make certain library normalizes external link object names) */ @@ -5341,16 +4996,16 @@ external_link_query(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if (H5L_TYPE_EXTERNAL != li.type) { - H5_FAILED(); - HDputs(" Unexpected link class - should have been an external link"); - goto error; + H5_FAILED(); + HDputs(" Unexpected link class - should have been an external link"); + goto error; } /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR /* Create second file to point to */ - if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create object to link to */ if((gid = H5Gcreate2(fid, "dst", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -5359,7 +5014,6 @@ external_link_query(hid_t fapl, hbool_t new_format) /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR - /* Open first file */ if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -5367,9 +5021,9 @@ external_link_query(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if(H5L_TYPE_EXTERNAL != li.type) { - H5_FAILED(); - HDputs(" Unexpected link class - should have been an external link"); - goto error; + H5_FAILED(); + HDputs(" Unexpected link class - should have been an external link"); + goto error; } /* Get information for external link. It should be two strings right after each other */ @@ -5385,9 +5039,9 @@ external_link_query(hid_t fapl, hbool_t new_format) /* Query information about object that external link points to */ if(H5Oget_info_by_name2(fid, "src", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_TYPE_GROUP != oi.type) { - H5_FAILED(); - HDputs(" Unexpected object type - should have been a group"); - goto error; + H5_FAILED(); + HDputs(" Unexpected object type - should have been a group"); + goto error; } /* Close first file */ @@ -5398,30 +5052,30 @@ external_link_query(hid_t fapl, hbool_t new_format) /* Make sure that bogus cases trigger errors in H5Lunpack_elink_val */ H5E_BEGIN_TRY { - if(H5Lunpack_elink_val(query_buf, li.u.val_size - 1, NULL, NULL, NULL) >= 0) TEST_ERROR + if(H5Lunpack_elink_val(query_buf, li.u.val_size - 1, NULL, NULL, NULL) >= 0) TEST_ERROR } H5E_END_TRY H5E_BEGIN_TRY { - if(H5Lunpack_elink_val(query_buf, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR + if(H5Lunpack_elink_val(query_buf, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR } H5E_END_TRY H5E_BEGIN_TRY { - if(H5Lunpack_elink_val(NULL, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR + if(H5Lunpack_elink_val(NULL, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR } H5E_END_TRY H5E_BEGIN_TRY { - if(H5Lunpack_elink_val(NULL, (size_t)1000, NULL, NULL, NULL) >= 0) TEST_ERROR + if(H5Lunpack_elink_val(NULL, (size_t)1000, NULL, NULL, NULL) >= 0) TEST_ERROR } H5E_END_TRY PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_query() */ - + /*------------------------------------------------------------------------- * Function: external_link_unlink_compact * @@ -5429,19 +5083,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Wednesday, January 18, 2006 - * *------------------------------------------------------------------------- */ static int external_link_unlink_compact(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("unlinking external link in compact group (w/new group format)") @@ -5471,9 +5121,6 @@ external_link_unlink_compact(hid_t fapl, hbool_t new_format) /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR - -/* Unlink external link */ - /* Open first file */ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -5496,18 +5143,18 @@ external_link_unlink_compact(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_unlink_compact() */ - + /*------------------------------------------------------------------------- * Function: external_link_unlink_dense * @@ -5515,25 +5162,21 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Wednesday, January 18, 2006 - * *------------------------------------------------------------------------- */ static int external_link_unlink_dense(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gcpl = (-1); /* Group creation property list ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ - unsigned nmsgs; /* Number of messages in group's header */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned u; /* Local index variable */ + hid_t fid = -1; /* File ID */ + hid_t gcpl = -1; /* Group creation property list ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + unsigned nmsgs; /* Number of messages in group's header */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned u; /* Local index variable */ if(new_format) TESTING("unlinking external link in dense group (w/new group format)") @@ -5598,9 +5241,6 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format) /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR - -/* Unlink external link */ - /* Open first file */ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -5642,18 +5282,18 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_unlink_dense() */ - + /*------------------------------------------------------------------------- * Function: external_link_move * @@ -5661,20 +5301,16 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, December 5, 2005 - * *------------------------------------------------------------------------- */ static int external_link_move(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if(new_format) TESTING("move external link (w/new group format)") @@ -5704,9 +5340,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR - /* Move external link to different name within same group */ - /* Open first file */ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -5790,7 +5424,6 @@ external_link_move(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR /* Move external link back to original group */ - /* Open first file */ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -5833,18 +5466,18 @@ external_link_move(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_move() */ - + /*------------------------------------------------------------------------- * Function: external_link_ride * @@ -5853,25 +5486,21 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Wednesday, January 18, 2006 - * *------------------------------------------------------------------------- */ static int external_link_ride(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gcpl = (-1); /* Group creation property list ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ - unsigned nmsgs; /* Number of messages in group's header */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned u; /* Local index variable */ + hid_t fid = -1; /* File ID */ + hid_t gcpl = -1; /* Group creation property list ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ + unsigned nmsgs; /* Number of messages in group's header */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned u; /* Local index variable */ if(new_format) TESTING("external link along for the ride (w/new group format)") @@ -6018,19 +5647,19 @@ external_link_ride(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Pclose(gcpl); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_ride() */ - + /*------------------------------------------------------------------------- * Function: external_link_closing * @@ -6039,10 +5668,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Wednesday, August 16, 2006 - * *------------------------------------------------------------------------- */ static int @@ -6052,11 +5677,11 @@ external_link_closing(hid_t fapl, hbool_t new_format) hid_t gid=(-1), tid=(-1), tid2=(-1), sid=(-1), did=(-1); hid_t lcpl_id=(-1); hsize_t dims[2]; - char filename1[NAME_BUF_SIZE], + char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE], - filename4[NAME_BUF_SIZE], /* Names of files to externally link across */ - buf[NAME_BUF_SIZE]; /* misc. buffer */ + filename3[NAME_BUF_SIZE], + filename4[NAME_BUF_SIZE], /* Names of files to externally link across */ + buf[NAME_BUF_SIZE]; /* misc. buffer */ H5L_info_t li; H5O_info_t oi; hobj_ref_t obj_ref; @@ -6246,7 +5871,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -6260,10 +5885,10 @@ error: H5Fclose(fid2); H5Fclose(fid1); } H5E_END_TRY; - return -1; + return FAIL; } /* external_link_closing() */ - + /*------------------------------------------------------------------------- * Function: ext_link_endian * @@ -6273,19 +5898,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ static int external_link_endian(hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - hid_t lapl_id = (-1); /* Prop List ID */ - const char *pathbuf = H5_get_srcdir(); /* Path to the files */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t lapl_id = -1; /* Prop List ID */ + const char *pathbuf = H5_get_srcdir(); /* Path to the files */ const char *namebuf; if(new_format) @@ -6327,18 +5948,18 @@ external_link_endian(hbool_t new_format) PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } - + /*------------------------------------------------------------------------- * Function: external_link_strong * @@ -6347,10 +5968,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, March 5, 2007 - * *------------------------------------------------------------------------- */ static int @@ -6360,7 +5977,7 @@ external_link_strong(hid_t fapl, hbool_t new_format) hid_t fid1 = (-1), fid2 = (-1); /* File ID */ hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - char filename1[NAME_BUF_SIZE], + char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; if(new_format) @@ -6409,7 +6026,7 @@ external_link_strong(hid_t fapl, hbool_t new_format) if(H5Pclose(my_fapl) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -6420,10 +6037,10 @@ error: H5Fclose(fid2); H5Fclose(fid1); } H5E_END_TRY; - return -1; + return FAIL; } /* end external_link_strong() */ - + /*------------------------------------------------------------------------- * Function: external_symlink * @@ -6432,10 +6049,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Nov. 23, 2009 - * *------------------------------------------------------------------------- */ static int @@ -6444,17 +6057,17 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) #ifdef H5_HAVE_SYMLINK hid_t file1 = -1, file2 = -1, file3 = -1, file4 = -1, file5 = -1; hid_t group2 = -1, group3 = -1, group4 = -1, group5 = -1; - char filename1[NAME_BUF_SIZE], - filename2a[NAME_BUF_SIZE], - filename2b[NAME_BUF_SIZE], - filename3a[NAME_BUF_SIZE], - filename3b[NAME_BUF_SIZE], - filename4a[NAME_BUF_SIZE], - filename4b[NAME_BUF_SIZE], - filename5a[NAME_BUF_SIZE], - filename5b[NAME_BUF_SIZE], - tmpname[NAME_BUF_SIZE], - cwdpath[NAME_BUF_SIZE]; + char filename1[NAME_BUF_SIZE], + filename2a[NAME_BUF_SIZE], + filename2b[NAME_BUF_SIZE], + filename3a[NAME_BUF_SIZE], + filename3b[NAME_BUF_SIZE], + filename4a[NAME_BUF_SIZE], + filename4b[NAME_BUF_SIZE], + filename5a[NAME_BUF_SIZE], + filename5b[NAME_BUF_SIZE], + tmpname[NAME_BUF_SIZE], + cwdpath[NAME_BUF_SIZE]; hbool_t have_posix_compat_vfd; /* Whether VFD used is compatible w/POSIX I/O calls */ #endif /* H5_HAVE_SYMLINK */ @@ -6474,7 +6087,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* set up name for main file: "extlinks21A" */ h5_fixname(FILENAME[45], fapl, filename1, sizeof(filename1)); - /* create tmp directory and get current working directory path */ + /* create tmp_links directory and get current working directory path */ if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR if(HDmkdir(TMPDIR2, (mode_t)0755) < 0 && errno != EEXIST) @@ -6484,33 +6097,32 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Set up names for files in the subdirectories */ - /* set up names for file #2 in temporary directory #2: "tmp2/extlinks21B" */ + /* set up names for file #2 in temporary directory #2: "tmp2_links/extlinks21B" */ h5_fixname(FILENAME[46], fapl, filename2a, sizeof(filename2a)); fix_ext_filename(tmpname, cwdpath, FILENAME[46]); h5_fixname(tmpname, fapl, filename2b, sizeof(filename2b)); /* Create symbolic link #1 in temporary directory #1 to file #2 in temporary directory #2 */ - /* (i.e. tmp/sym1.h5 -> <full path to>/tmp2/extlinks21B.h5) */ + /* (i.e. tmp_links/sym1.h5 -> <full path to>/tmp2_links/extlinks21B.h5) */ if(HDsymlink(filename2b, SYMLINK1) < 0 && errno != EEXIST) TEST_ERROR - /* set up name for file #3 in temporary directory #2: "tmp2/extlinks21C" */ + /* set up name for file #3 in temporary directory #2: "tmp2_links/extlinks21C" */ h5_fixname(FILENAME[47], fapl, filename3a, sizeof(filename3a)); h5_fixname(FILENAME[48], fapl, filename3b, sizeof(filename3b)); - /* set up name for file #4 in temporary directory #1: "tmp/extlinks21D" */ + /* set up name for file #4 in temporary directory #1: "tmp_links/extlinks21D" */ h5_fixname(FILENAME[49], fapl, filename4a, sizeof(filename4a)); fix_ext_filename(tmpname, cwdpath, FILENAME[49]); h5_fixname(tmpname, fapl, filename4b, sizeof(filename4b)); /* Create symbolic link #2 in temporary directory #2 to file #4 in temporary directory #1 */ - /* (i.e. tmp2/sym2.h5 -> <full path to>/tmp/extlinks21D.h5) */ + /* (i.e. tmp2_links/sym2.h5 -> <full path to>/tmp_links/extlinks21D.h5) */ if(HDsymlink(filename4b, SYMLINK2) < 0 && errno != EEXIST) TEST_ERROR - /* set up name for file #5 in temporary directory #1: "tmp/extlinks21E" */ + /* set up name for file #5 in temporary directory #1: "tmp_links/extlinks21E" */ h5_fixname(FILENAME[50], fapl, filename5a, sizeof(filename5a)); h5_fixname(FILENAME[51], fapl, filename5b, sizeof(filename5b)); - /* Create file #1 in current directory */ if((file1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -6520,12 +6132,11 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Close file #1 */ if(H5Fclose(file1) < 0) TEST_ERROR - - /* Create file #2 in tmp directory #2 */ + /* Create file #2 in tmp_links directory #2 */ if((file2 = H5Fcreate(filename2a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR if(H5Fclose(file2) < 0) TEST_ERROR - /* Re-open file #2 in tmp directory through symlink */ + /* Re-open file #2 in tmp_links directory through symlink */ if((file2 = H5Fopen(SYMLINK1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Create group in file #2 in temporary directory */ @@ -6540,7 +6151,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Close file #2 */ if(H5Fclose(file2) < 0) TEST_ERROR - /* Create file #3 in temp. directory #2 */ if((file3 = H5Fcreate(filename3a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -6556,7 +6166,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Close file #3 */ if(H5Fclose(file3) < 0) TEST_ERROR - /* Create file #4 in temporary directory #1 */ if((file4 = H5Fcreate(filename4b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -6572,7 +6181,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Close file #4 */ if(H5Fclose(file4) < 0) TEST_ERROR - /* Create file #5 in temporary directory #1 */ if((file5 = H5Fcreate(filename5a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -6583,7 +6191,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Close file #5 */ if(H5Fclose(file5) < 0) TEST_ERROR - /* Actual tests... */ /* Reopen file #1 */ @@ -6608,17 +6215,16 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Close file #1 */ if(H5Fclose(file1) < 0) TEST_ERROR - PASSED(); } /* end if */ else { - SKIPPED(); - HDputs(" Current VFD doesn't support POSIX I/O calls"); + SKIPPED(); + HDputs(" Current VFD doesn't support POSIX I/O calls"); } /* end else */ - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { H5Gclose(group5); H5Gclose(group4); @@ -6630,16 +6236,16 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) H5Fclose(file2); H5Fclose(file1); } H5E_END_TRY; - return -1; + return FAIL; #else /* H5_HAVE_SYMLINK */ SKIPPED(); HDputs(" Current file system or operating system doesn't support symbolic links"); - return 0; + return SUCCEED; #endif /* H5_HAVE_SYMLINK */ } /* end external_symlink() */ - + /*------------------------------------------------------------------------- * Function: external_copy_invalid_object * @@ -6650,18 +6256,14 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Wednesday, March 3, 2010 - * *------------------------------------------------------------------------- */ static int external_copy_invalid_object(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t ocpyplid = (-1); /* Object copy plist ID */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t ocpyplid = -1; /* Object copy plist ID */ char filename[NAME_BUF_SIZE]; if(new_format) @@ -6700,7 +6302,7 @@ external_copy_invalid_object(hid_t fapl, hbool_t new_format) if(H5Pclose(ocpyplid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -6709,10 +6311,10 @@ error: H5Pclose(ocpyplid); } H5E_END_TRY - return -1; + return FAIL; } /* end external_copy_invalid_object */ - + /*------------------------------------------------------------------------- * Function: external_dont_fail_to_source * @@ -6722,18 +6324,14 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Wednesday, March 3, 2010 - * *------------------------------------------------------------------------- */ static int external_dont_fail_to_source(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t oid = (-1); /* Object ID */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t oid = -1; /* Object ID */ char filename[NAME_BUF_SIZE]; if(new_format) @@ -6764,7 +6362,7 @@ external_dont_fail_to_source(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -6773,10 +6371,10 @@ error: H5Fclose(fid); } H5E_END_TRY - return -1; + return FAIL; } /* end external_dont_fail_to_source */ - + /*------------------------------------------------------------------------- * Function: external_file_cache * @@ -6786,21 +6384,17 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Thursday, January 13, 2011 - * *------------------------------------------------------------------------- */ static int external_file_cache(hid_t fapl, hbool_t new_format) { - hid_t my_fapl = (-1); /* Temporary FAPL */ - hid_t fid1 = (-1); /* File ID */ - hid_t fid2 = (-1); /* File ID */ - hid_t fid3 = (-1); /* File ID */ - hid_t fid4 = (-1); /* File ID */ - hid_t oid = (-1); /* Object ID */ + hid_t my_fapl = -1; /* Temporary FAPL */ + hid_t fid1 = -1; /* File ID */ + hid_t fid2 = -1; /* File ID */ + hid_t fid3 = -1; /* File ID */ + hid_t fid4 = -1; /* File ID */ + hid_t oid = -1; /* Object ID */ unsigned efc_size; char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; @@ -6819,333 +6413,229 @@ external_file_cache(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[3], fapl, filename4, sizeof filename4); /* Verify that the default EFC size is 0 */ - if(H5Pget_elink_file_cache_size(fapl, &efc_size) < 0) - TEST_ERROR + if(H5Pget_elink_file_cache_size(fapl, &efc_size) < 0) TEST_ERROR if(efc_size != 0) FAIL_PUTS_ERROR("default external file cache size is not 0") /* Copy FAPL and enable external file caching */ - if((my_fapl = H5Pcopy(fapl)) < 0) - TEST_ERROR - if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0) - TEST_ERROR + if((my_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR + if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0) TEST_ERROR /* Verify that the external file cache size has been set */ - if(H5Pget_elink_file_cache_size(my_fapl, &efc_size) < 0) - TEST_ERROR + if(H5Pget_elink_file_cache_size(my_fapl, &efc_size) < 0) TEST_ERROR if(efc_size != 8) FAIL_PUTS_ERROR("external file cache size different from expected") - - /* - * Test 1: One file caches another - */ + /* Test 1: One file caches another */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Create link */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file 2 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR /* Verify that only 1 file is open */ H5F_sfile_assert_num(1); /* Open and close the target of the external link */ - if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that both files are now open */ H5F_sfile_assert_num(2); /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 2: One file caches another, release parent's EFC - */ + /* Test 2: One file caches another, release parent's EFC */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Create link */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file 2 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR /* Verify that only 1 file is open */ H5F_sfile_assert_num(1); /* Open and close the target of the external link */ - if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that both files are now open */ H5F_sfile_assert_num(2); /* Release file 1's EFC */ - if(H5Fclear_elink_file_cache(fid1) < 0) - TEST_ERROR + if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR /* Verify that only the parent file is now open */ H5F_sfile_assert_num(1); /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 3: "Y" shaped tree - */ + /* Test 3: "Y" shaped tree */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Create links */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close files 2-4 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR - if(H5Fclose(fid3) < 0) - TEST_ERROR - if(H5Fclose(fid4) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR + if(H5Fclose(fid3) < 0) TEST_ERROR + if(H5Fclose(fid4) < 0) TEST_ERROR /* Verify that only 1 file is open */ H5F_sfile_assert_num(1); /* Open and close one branch of the tree */ - if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that files 2 and 3 are now open */ H5F_sfile_assert_num(3); /* Open and close the other branch of the tree */ - if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that all files are now open */ H5F_sfile_assert_num(4); /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 4: "Y" shaped tree, release parent's EFC - */ + /* Test 4: "Y" shaped tree, release parent's EFC */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Create links */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close files 2-4 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR - if(H5Fclose(fid3) < 0) - TEST_ERROR - if(H5Fclose(fid4) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR + if(H5Fclose(fid3) < 0) TEST_ERROR + if(H5Fclose(fid4) < 0) TEST_ERROR /* Verify that only 1 file is open */ H5F_sfile_assert_num(1); /* Open and close one branch of the tree */ - if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that files 2 and 3 are now open */ H5F_sfile_assert_num(3); /* Open and close the other branch of the tree */ - if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that all files are now open */ H5F_sfile_assert_num(4); /* Release file 1's EFC */ - if(H5Fclear_elink_file_cache(fid1) < 0) - TEST_ERROR + if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR /* Verify that only file 1 is now open */ H5F_sfile_assert_num(1); /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ H5F_sfile_assert_num(0); - /* - * Test 5: 3 file cycle - */ + /* Test 5: 3 file cycle */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Create links */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close files 2-3 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR - if(H5Fclose(fid3) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR + if(H5Fclose(fid3) < 0) TEST_ERROR /* Verify that only 1 file is open */ H5F_sfile_assert_num(1); /* Open and close one complete cycle */ - if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that all files are now open */ H5F_sfile_assert_num(3); /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 6: 3 file cycle, release parent's EFC - */ + /* Test 6: 3 file cycle, release parent's EFC */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR - if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Create links */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close files 2-3 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR - if(H5Fclose(fid3) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR + if(H5Fclose(fid3) < 0) TEST_ERROR /* Verify that only 1 file is open */ H5F_sfile_assert_num(1); /* Open and close one complete cycle */ - if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Oclose(oid) < 0) - TEST_ERROR + if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oclose(oid) < 0) TEST_ERROR /* Verify that all files are now open */ H5F_sfile_assert_num(3); /* Release file 1's EFC */ - if(H5Fclear_elink_file_cache(fid1) < 0) - TEST_ERROR + if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR /* Verify that only file 1 is now open */ H5F_sfile_assert_num(1); /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ H5F_sfile_assert_num(0); @@ -7154,7 +6644,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) H5Pclose(my_fapl); PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -7166,10 +6656,10 @@ error: H5Pclose(my_fapl); } H5E_END_TRY - return -1; + return FAIL; } /* end external_file_cache */ - + /*------------------------------------------------------------------------- * Function: external_open_twice * @@ -7178,21 +6668,17 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Saturday, April 30, 2011 - * *------------------------------------------------------------------------- */ static int external_open_twice(hid_t fapl, hbool_t new_format) { - hid_t fid1 = (-1); /* File ID */ - hid_t fid2 = (-1); /* File ID */ - hid_t oid1 = (-1); /* Object ID */ - hid_t oid2 = (-1); /* Object ID */ - hid_t type = (-1); /* Datatype ID */ - hid_t space = (-1); /* Dataspace ID */ + hid_t fid1 = -1; /* File ID */ + hid_t fid2 = -1; /* File ID */ + hid_t oid1 = -1; /* Object ID */ + hid_t oid2 = -1; /* Object ID */ + hid_t type = -1; /* Datatype ID */ + hid_t space = -1; /* Dataspace ID */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; @@ -7205,192 +6691,123 @@ external_open_twice(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - - /* - * Test 1: Open root group twice - */ + /* Test 1: Open root group twice */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create link */ - if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file 2 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR /* Open the target of the external link twice */ - if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR - if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR + if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR + if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR - /* Close both objects, in the reverse opening order (necessary to duplicate - * bug */ - if(H5Oclose(oid2) < 0) - TEST_ERROR - if(H5Oclose(oid1) < 0) - TEST_ERROR + /* Close both objects, in the reverse opening order (necessary to duplicate bug */ + if(H5Oclose(oid2) < 0) TEST_ERROR + if(H5Oclose(oid1) < 0) TEST_ERROR /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 2: Open group twice - */ + /* Test 2: Open group twice */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create target group */ - if((oid1 = H5Gcreate2(fid2, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) - < 0) - TEST_ERROR - if(H5Gclose(oid1) < 0) - TEST_ERROR + if((oid1 = H5Gcreate2(fid2, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Gclose(oid1) < 0) TEST_ERROR /* Create link */ - if(H5Lcreate_external(filename2, "/group", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/group", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file 2 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR /* Open the target of the external link twice */ - if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR - if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR + if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR + if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR - /* Close both objects, in the reverse opening order (necessary to duplicate - * bug */ - if(H5Oclose(oid2) < 0) - TEST_ERROR - if(H5Oclose(oid1) < 0) - TEST_ERROR + /* Close both objects, in the reverse opening order (necessary to duplicate bug */ + if(H5Oclose(oid2) < 0) TEST_ERROR + if(H5Oclose(oid1) < 0) TEST_ERROR /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 3: Open dataset twice - */ + /* Test 3: Open dataset twice */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create target dataset */ - if((space = H5Screate(H5S_SCALAR)) < 0) - TEST_ERROR - if((oid1 = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, space, H5P_DEFAULT, - dcpl_g, H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Dclose(oid1) < 0) - TEST_ERROR - if(H5Sclose(space) < 0) - TEST_ERROR + if((space = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR + if((oid1 = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Dclose(oid1) < 0) TEST_ERROR + if(H5Sclose(space) < 0) TEST_ERROR /* Create link */ - if(H5Lcreate_external(filename2, "/dset", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/dset", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file 2 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR /* Open the target of the external link twice */ - if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR - if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR + if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR + if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR - /* Close both objects, in the reverse opening order (necessary to duplicate - * bug */ - if(H5Oclose(oid2) < 0) - TEST_ERROR - if(H5Oclose(oid1) < 0) - TEST_ERROR + /* Close both objects, in the reverse opening order (necessary to duplicate bug */ + if(H5Oclose(oid2) < 0) TEST_ERROR + if(H5Oclose(oid1) < 0) TEST_ERROR /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ H5F_sfile_assert_num(0); - - /* - * Test 4: Open datatype twice - */ + /* Test 4: Open datatype twice */ /* Create files */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create target datatype */ - if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) - TEST_ERROR - if(H5Tcommit2(fid2, "dtype", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) - < 0) - TEST_ERROR - if(H5Tclose(type) < 0) - TEST_ERROR + if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR + if(H5Tcommit2(fid2, "dtype", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Tclose(type) < 0) TEST_ERROR /* Create link */ - if(H5Lcreate_external(filename2, "/dtype", fid1, "link_to_2", H5P_DEFAULT, - H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_external(filename2, "/dtype", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file 2 */ - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR /* Open the target of the external link twice */ - if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR - if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) - TEST_ERROR + if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR + if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR - /* Close both objects, in the reverse opening order (necessary to duplicate - * bug */ - if(H5Oclose(oid2) < 0) - TEST_ERROR - if(H5Oclose(oid1) < 0) - TEST_ERROR + /* Close both objects, in the reverse opening order (necessary to duplicate bug */ + if(H5Oclose(oid2) < 0) TEST_ERROR + if(H5Oclose(oid1) < 0) TEST_ERROR /* Close file 1 */ - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ H5F_sfile_assert_num(0); - PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -7402,10 +6819,10 @@ error: H5Sclose(space); } H5E_END_TRY - return -1; + return FAIL; } /* end external_open_twice() */ - + /*------------------------------------------------------------------------- * Function: external_link_with_committed_datatype * @@ -7428,24 +6845,24 @@ error: static int external_link_with_committed_datatype(hid_t fapl, hbool_t new_format) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gid1 = -1, gid2 = -1; /* Group IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t sid2 = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t atid = -1; /* Attribute's datatype ID */ - hid_t did = -1; /* Dataset ID */ - hid_t dtid = -1; /* Dataset's datatype ID */ - hid_t dcpl = -1; /* Dataset creation property list */ - int wdata = 99; /* Attribute data written */ - int wbuf[60]; /* Data buffer for writing */ - int rbuf[60]; /* Data buffer for reading */ - int i; /* Local index variable */ - char filename1[NAME_BUF_SIZE]; /* File name for main file */ - char filename2[NAME_BUF_SIZE]; /* File name for target file */ - hsize_t dims[2] = {5, 12}; /* Dimension sizes */ - hsize_t chunks[2] = {3, 7}; /* Chunk sizes */ + hid_t fid1 = -1, fid2 = -1; /* File IDs */ + hid_t gid1 = -1, gid2 = -1; /* Group IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t sid2 = -1; /* Dataspace ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t atid = -1; /* Attribute's datatype ID */ + hid_t did = -1; /* Dataset ID */ + hid_t dtid = -1; /* Dataset's datatype ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + int wdata = 99; /* Attribute data written */ + int wbuf[60]; /* Data buffer for writing */ + int rbuf[60]; /* Data buffer for reading */ + int i; /* Local index variable */ + char filename1[NAME_BUF_SIZE]; /* File name for main file */ + char filename2[NAME_BUF_SIZE]; /* File name for target file */ + hsize_t dims[2] = {5, 12}; /* Dimension sizes */ + hsize_t chunks[2] = {3, 7}; /* Chunk sizes */ if(new_format) TESTING("attach committed datatype to external group's attribute/dataset(w/new group format)") @@ -7456,209 +6873,157 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - /* Main file */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - FAIL_STACK_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create external link from main file to target file */ - if(H5Lcreate_external(filename2, "target_group", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR - + if(H5Lcreate_external(filename2, "target_group", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Create target file */ - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - FAIL_STACK_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create group in target file */ - if((gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close the group */ - if(H5Gclose(gid2) < 0) - FAIL_STACK_ERROR + if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR /* Close the file */ - if(H5Fclose(fid2) < 0) - FAIL_STACK_ERROR + if(H5Fclose(fid2) < 0) FAIL_STACK_ERROR /* Open the group which is externally linked to target file */ - if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a copy of integer datatype */ - if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) - FAIL_STACK_ERROR + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR /* Commit the datatype to the main file root group */ - if(H5Tcommit2(fid1, "myDatatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + if(H5Tcommit2(fid1, "myDatatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Create dataspace */ - if((sid = H5Screate(H5S_SCALAR)) < 0) - FAIL_STACK_ERROR + if((sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR /* Attach an attribute with the committed datatype to the group */ - if((aid = H5Acreate2(gid1, "myAttribute", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((aid = H5Acreate2(gid1, "myAttribute", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Write data to the attribute */ - if(H5Awrite(aid, tid, &wdata) < 0) - FAIL_STACK_ERROR + if(H5Awrite(aid, tid, &wdata) < 0) FAIL_STACK_ERROR /* Get the attribute's datatype */ - if((atid = H5Aget_type(aid)) < 0) - FAIL_STACK_ERROR + if((atid = H5Aget_type(aid)) < 0) FAIL_STACK_ERROR /* Verify the datatype is not committed */ - if(H5Tcommitted(atid) == TRUE) - FAIL_STACK_ERROR + if(H5Tcommitted(atid) == TRUE) FAIL_STACK_ERROR /* Close the attribute */ - if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR + if(H5Aclose(aid) < 0) FAIL_STACK_ERROR /* Create a chunked dataset */ - if((sid2 = H5Screate_simple(2, dims, NULL)) < 0) - FAIL_STACK_ERROR + if((sid2 = H5Screate_simple(2, dims, NULL)) < 0) FAIL_STACK_ERROR if (dcpl_g == H5P_DEFAULT) dcpl = H5Pcreate(H5P_DATASET_CREATE); else dcpl = H5Pcopy(dcpl_g); if (0 > dcpl) FAIL_STACK_ERROR - if(H5Pset_chunk(dcpl, 2, chunks) < 0) - FAIL_STACK_ERROR + if(H5Pset_chunk(dcpl, 2, chunks) < 0) FAIL_STACK_ERROR /* Initialize data buffers */ for(i = 0; i < 60; i++) { - wbuf[i] = i; - rbuf[i] = 0; + wbuf[i] = i; + rbuf[i] = 0; } /* Create a dataset with the committed datatype in the group */ - if((did = H5Dcreate2(gid1, "myDataset", tid, sid2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((did = H5Dcreate2(gid1, "myDataset", tid, sid2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Write to the dataset */ - if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) - FAIL_STACK_ERROR + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) FAIL_STACK_ERROR /* Get the dataset's datatype */ - if((dtid = H5Dget_type(did)) < 0) - FAIL_STACK_ERROR + if((dtid = H5Dget_type(did)) < 0) FAIL_STACK_ERROR /* Verify the datatype is not committed */ - if(H5Tcommitted(dtid) == TRUE) - FAIL_STACK_ERROR + if(H5Tcommitted(dtid) == TRUE) FAIL_STACK_ERROR /* Close the dataset */ - if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + if(H5Dclose(did) < 0) FAIL_STACK_ERROR /* Close the dataset creation property list */ - if(H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR /* Close the dataspaces */ - if(H5Sclose(sid) < 0) - FAIL_STACK_ERROR - if(H5Sclose(sid2) < 0) - FAIL_STACK_ERROR + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid2) < 0) FAIL_STACK_ERROR /* Close the datatypes */ - if(H5Tclose(tid) < 0) - FAIL_STACK_ERROR - if(H5Tclose(atid) < 0) - FAIL_STACK_ERROR - if(H5Tclose(dtid) < 0) - FAIL_STACK_ERROR + if(H5Tclose(tid) < 0) FAIL_STACK_ERROR + if(H5Tclose(atid) < 0) FAIL_STACK_ERROR + if(H5Tclose(dtid) < 0) FAIL_STACK_ERROR /* Close the group */ - if(H5Gclose(gid1) < 0) - FAIL_STACK_ERROR + if(H5Gclose(gid1) < 0) FAIL_STACK_ERROR /* Close the file */ - if(H5Fclose(fid1) < 0) - FAIL_STACK_ERROR - + if(H5Fclose(fid1) < 0) FAIL_STACK_ERROR /* Open the mainfile */ - if((fid1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) - FAIL_STACK_ERROR + if((fid1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR /* Open the committed datatype in the mainfile */ - if((tid = H5Topen2(fid1, "myDatatype", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((tid = H5Topen2(fid1, "myDatatype", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify the datatype is committed */ - if(H5Tcommitted(tid) == FALSE) - FAIL_STACK_ERROR + if(H5Tcommitted(tid) == FALSE) FAIL_STACK_ERROR /* Open the group which is externally linked to target file */ - if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Open the attribute attached to the group */ - if((aid = H5Aopen(gid1, "myAttribute", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((aid = H5Aopen(gid1, "myAttribute", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get the attribute's datatype */ - if((atid = H5Aget_type(aid)) < 0) - FAIL_STACK_ERROR + if((atid = H5Aget_type(aid)) < 0) FAIL_STACK_ERROR /* Verify the attribute's datatype is not committed */ - if(H5Tcommitted(atid) == TRUE) - FAIL_STACK_ERROR + if(H5Tcommitted(atid) == TRUE) FAIL_STACK_ERROR /* Close the attribute */ - if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR + if(H5Aclose(aid) < 0) FAIL_STACK_ERROR /* Delete the attribute */ - if(H5Adelete(gid1, "myAttribute") < 0) - FAIL_STACK_ERROR + if(H5Adelete(gid1, "myAttribute") < 0) FAIL_STACK_ERROR /* Open the dataset in the group */ - if((did = H5Dopen2(gid1, "myDataset", H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((did = H5Dopen2(gid1, "myDataset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get the dataset's datatype */ - if((dtid = H5Dget_type(did)) < 0) - FAIL_STACK_ERROR + if((dtid = H5Dget_type(did)) < 0) FAIL_STACK_ERROR /* Verify the dataset's datatype is not committed */ - if(H5Tcommitted(dtid) == TRUE) - FAIL_STACK_ERROR + if(H5Tcommitted(dtid) == TRUE) FAIL_STACK_ERROR /* Read the dataset */ - if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) - FAIL_STACK_ERROR + if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR /* Compare the data read should be the same as wbuf */ - if(HDmemcmp(wbuf, rbuf, sizeof(wbuf)) != 0) - FAIL_STACK_ERROR + if(HDmemcmp(wbuf, rbuf, sizeof(wbuf)) != 0) FAIL_STACK_ERROR /* Close the dataset */ - if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + if(H5Dclose(did) < 0) FAIL_STACK_ERROR /* Close the group */ - if(H5Gclose(gid1) < 0) - FAIL_STACK_ERROR + if(H5Gclose(gid1) < 0) FAIL_STACK_ERROR /* Close the datatypes */ - if(H5Tclose(tid) < 0) - FAIL_STACK_ERROR - if(H5Tclose(atid) < 0) - FAIL_STACK_ERROR - if(H5Tclose(dtid) < 0) - FAIL_STACK_ERROR + if(H5Tclose(tid) < 0) FAIL_STACK_ERROR + if(H5Tclose(atid) < 0) FAIL_STACK_ERROR + if(H5Tclose(dtid) < 0) FAIL_STACK_ERROR /* Close the file */ if(H5Fclose(fid1) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -7677,13 +7042,13 @@ error: H5Aclose(atid); H5Aclose(dtid); - H5Pclose(dcpl); + H5Pclose(dcpl); } H5E_END_TRY - return -1; + return FAIL; } /* end external_link_with_committed_datatype() */ - + /*------------------------------------------------------------------------- * Function: ud_hard_links * @@ -7692,10 +7057,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ /* Callback functions for UD hard links. */ @@ -7747,6 +7108,9 @@ done: ret_value = -1; break; + case H5I_MAP: + /* TODO: Not supported in native file format yet */ + case H5I_UNINIT: case H5I_BADID: case H5I_FILE: @@ -7762,7 +7126,7 @@ done: case H5I_SPACE_SEL_ITER: case H5I_NTYPES: default: - return -1; + return FAIL; } /* end switch */ } /* end if */ @@ -7779,7 +7143,7 @@ UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, hid_t ret_value = -1; if(udata_size != sizeof(haddr_t)) - return -1; + return FAIL; addr = *((const haddr_t *) udata); @@ -7836,6 +7200,9 @@ done: ret_value = -1; break; + case H5I_MAP: + /* TODO: Not supported in native file format yet */ + case H5I_UNINIT: case H5I_BADID: case H5I_FILE: @@ -7851,7 +7218,7 @@ done: case H5I_SPACE_SEL_ITER: case H5I_NTYPES: default: - return -1; + return FAIL; } /* end switch */ } /* end if */ @@ -7873,12 +7240,12 @@ const H5L_class_t UD_hard_class[1] = {{ static int ud_hard_links(hid_t fapl) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - H5L_info_t li; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + H5L_info_t li; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ h5_stat_size_t empty_size; /* Size of an empty file */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; TESTING("user-defined hard link (w/new group format)") @@ -7912,7 +7279,6 @@ ud_hard_links(hid_t fapl) if(H5Gclose(gid) < 0) TEST_ERROR - /* Create a user-defined "hard link" to the group using the address we got * from H5Lget_info */ if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_HARD_TYPE, &(li.u.address), (size_t)sizeof(haddr_t), H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -7950,9 +7316,9 @@ ud_hard_links(hid_t fapl) /* UD hard links have no query function, thus return a "link length" of 0 */ if(li.u.val_size != 0) TEST_ERROR if(UD_HARD_TYPE != li.type) { - H5_FAILED(); - HDputs(" Unexpected link class - should have been a UD hard link"); - goto error; + H5_FAILED(); + HDputs(" Unexpected link class - should have been a UD hard link"); + goto error; } /* end if */ /* Unlink the group pointed to by the UD link. It shouldn't be @@ -7979,18 +7345,18 @@ ud_hard_links(hid_t fapl) if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end ud_hard_links() */ - + /*------------------------------------------------------------------------- * Function: UD_rereg_traverse * @@ -7999,10 +7365,6 @@ ud_hard_links(hid_t fapl) * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ /* A traversal function that ignores any udata and simply opens an object @@ -8020,7 +7382,7 @@ UD_rereg_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, return ret_value; error: - return -1; + return FAIL; } /* end UD_rereg_traverse() */ /* This link class has the same ID number as the UD hard links but @@ -8040,23 +7402,23 @@ const H5L_class_t UD_rereg_class[1] = {{ static int ud_link_reregister(hid_t fapl) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - H5L_info_t li; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; - h5_stat_size_t empty_size; /* Size of an empty file */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + H5L_info_t li; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; + h5_stat_size_t empty_size; /* Size of an empty file */ TESTING("registering a new class for existing UD links (w/new group format)") /* Set up filename and create file*/ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Get the size of the empty file for reference */ if(H5Fclose(fid) < 0) TEST_ERROR - if((empty_size=h5_get_file_size(filename, fapl))<0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl))<0) TEST_ERROR if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -8095,9 +7457,9 @@ ud_link_reregister(hid_t fapl) /* Verify that we can't create any new links of this type */ H5E_BEGIN_TRY { - if(H5Lcreate_ud(fid, "ud_link2", (H5L_type_t)UD_HARD_TYPE, &(li.u.address), + if(H5Lcreate_ud(fid, "ud_link2", (H5L_type_t)UD_HARD_TYPE, &(li.u.address), sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT) >= 0) - TEST_ERROR + TEST_ERROR } H5E_END_TRY /* Register a new kind of link with the same ID number */ @@ -8165,18 +7527,18 @@ ud_link_reregister(hid_t fapl) if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end ud_link_reregister() */ - + /*------------------------------------------------------------------------- * Function: ud_callbacks * @@ -8185,10 +7547,6 @@ ud_link_reregister(hid_t fapl) * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ /* Callback functions for UD "callback" links. */ @@ -8206,10 +7564,10 @@ UD_cb_create(const char * link_name, hid_t loc_group, const void *udata, if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /* end UD_cb_create() */ static hid_t @@ -8233,7 +7591,7 @@ UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata, return ret_value; error: - return -1; + return FAIL; } /* end UD_cb_traverse() */ /* Callback for when the link is moved or renamed */ @@ -8249,10 +7607,10 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata, if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /* end UD_cb_move() */ /* Callback for when the link is deleted. Also called during move */ @@ -8268,10 +7626,10 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata, if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /* end UD_cb_delete() */ /* Callback for when the link is queried */ @@ -8295,7 +7653,7 @@ UD_cb_query(const char * link_name, const void *udata, size_t udata_size, return 16; error: - return -1; + return FAIL; } /* end UD_cb_query() */ const H5L_class_t UD_cb_class[1] = {{ @@ -8313,12 +7671,12 @@ const H5L_class_t UD_cb_class[1] = {{ static int ud_callbacks(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t lcpl = (-1); /* Link Creation PL */ - H5L_info_t li; /* Link information */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t lcpl = -1; /* Link Creation PL */ + H5L_info_t li; /* Link information */ char ud_target_name[] = UD_CB_TARGET; /* Link target name */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; char query_buf[NAME_BUF_SIZE]; if(new_format) @@ -8341,8 +7699,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) * no problems. */ if(H5Lregister(UD_hard_class) < 0) TEST_ERROR - /* Register user-defined link class. This is the one we'll actually - * be using. */ + /* Register user-defined link class. This is the one we'll actually be using. */ if(H5Lregister(UD_cb_class) < 0) TEST_ERROR /* Check that registered link classes are, and unregistered ones aren't */ @@ -8384,7 +7741,6 @@ ud_callbacks(hid_t fapl, hbool_t new_format) /* Remove UD link */ if(H5Ldelete(fid, NEW_UD_CB_LINK_NAME, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - /* Test that the callbacks don't work if the link class is not registered */ /* Create a new link. Just for fun, give it a non-default character @@ -8422,18 +7778,18 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Pclose (lcpl); - H5Gclose (gid); - H5Fclose (fid); + H5Pclose (lcpl); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end ud_callbacks() */ - + /*------------------------------------------------------------------------- * Function: lapl_udata * @@ -8442,10 +7798,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ static hid_t @@ -8461,13 +7813,12 @@ UD_plist_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, /* Get the name of the target from the property list. */ if(H5Pget(lapl_id, DEST_PROP_NAME, target) < 0) TEST_ERROR - if((ret_value = H5Oopen(cur_group, target, lapl_id)) < 0) - TEST_ERROR + if((ret_value = H5Oopen(cur_group, target, lapl_id)) < 0) TEST_ERROR return ret_value; error: - return -1; + return FAIL; } /* end UD_plist_traverse() */ const H5L_class_t UD_plist_class[1] = {{ @@ -8485,12 +7836,12 @@ const H5L_class_t UD_plist_class[1] = {{ static int lapl_udata(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - hid_t plist_id = (-1); /* Property List ID */ - char group_a_name[NAME_BUF_SIZE]; - char group_b_name[NAME_BUF_SIZE]; - char filename[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t plist_id = -1; /* Property List ID */ + char group_a_name[NAME_BUF_SIZE]; + char group_b_name[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; if(new_format) TESTING("user data passed through lapl (w/new group format)") @@ -8561,19 +7912,19 @@ lapl_udata(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Pclose (plist_id); - H5Gclose (gid); - H5Gclose (gid2); - H5Fclose (fid); + H5Pclose (plist_id); + H5Gclose (gid); + H5Gclose (gid2); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end lapl_udata() */ - + /*------------------------------------------------------------------------- * Function: ud_link_errors * @@ -8582,10 +7933,6 @@ lapl_udata(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ static herr_t @@ -8593,10 +7940,9 @@ UD_cbsucc_create(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED loc const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id) { /* Check to make sure that this "soft link" has a target */ - if(udata_size < 1 || !udata) - return -1; + if(udata_size < 1 || !udata) return FAIL; - return 0; + return SUCCEED; } /* end UD_cbsucc_create() */ static hid_t @@ -8614,7 +7960,7 @@ UD_cbsucc_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, return ret_value; error: - return -1; + return FAIL; } /* end UD_cbsucc_traverse() */ /* Failure callback for when the link is moved or renamed */ @@ -8623,7 +7969,7 @@ UD_cbfail_move(const char H5_ATTR_UNUSED *new_name, hid_t H5_ATTR_UNUSED new_loc const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This traversal function will always fail. */ - return -1; + return FAIL; } /* end UD_cbfail_move() */ /* SuccessCallback for when the link is moved or renamed */ @@ -8632,7 +7978,7 @@ UD_cbsucc_move(const char H5_ATTR_UNUSED *new_name, hid_t H5_ATTR_UNUSED new_loc const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This traversal function will always succeed. */ - return 0; + return SUCCEED; } /* end UD_cbsucc_move() */ /* Callback for when the link is deleted. Also called during move */ @@ -8641,7 +7987,7 @@ UD_cbsucc_delete(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED file const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This callback will always succeed */ - return 0; + return SUCCEED; } /* end UD_cbsucc_delete() */ /* Callback for when the link is deleted. Also called during move */ @@ -8651,7 +7997,7 @@ UD_cbfail_delete(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED file { /* This traversal function will always fail. */ /* Note: un-deletable links are in general a very bad idea! */ - return -1; + return FAIL; } /* end UD_cbfail_delete() */ /* Callback for when the link is queried */ @@ -8660,7 +8006,7 @@ UD_cbfail_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATTR_UNUSED size_t H5_ATTR_UNUSED udata_size, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNUSED buf_size) { /* This traversal function will always fail. */ - return -1; + return FAIL; } /* end UD_cbfail_query() */ /* Callback for when the link is queried */ @@ -8673,10 +8019,9 @@ UD_cbfail_on_write_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATT * fails */ - if(buf != NULL) - return -1; + if(buf != NULL) return FAIL; - return 0; + return SUCCEED; } /* end UD_cbfail_on_write_query() */ /* Callback for when the link is queried */ @@ -8783,12 +8128,12 @@ const H5L_class_t UD_error4_class[1] = {{ static int ud_link_errors(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - char group_name[NAME_BUF_SIZE]; - char filename[NAME_BUF_SIZE]; - char query_buf[NAME_BUF_SIZE]; - H5L_info_t li; /* Link information */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + char group_name[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; + char query_buf[NAME_BUF_SIZE]; + H5L_info_t li; /* Link information */ if(new_format) TESTING("user-defined link error conditions (w/new group format)") @@ -8801,10 +8146,10 @@ ud_link_errors(hid_t fapl, hbool_t new_format) /* Try to register some invalid link classes */ H5E_BEGIN_TRY { - if(H5Lregister(UD_error1_class) >= 0) TEST_ERROR - if(H5Lregister(UD_error2_class) >= 0) TEST_ERROR - if(H5Lregister(UD_error3_class) >= 0) TEST_ERROR - if(H5Lregister(UD_error4_class) >= 0) TEST_ERROR + if(H5Lregister(UD_error1_class) >= 0) TEST_ERROR + if(H5Lregister(UD_error2_class) >= 0) TEST_ERROR + if(H5Lregister(UD_error3_class) >= 0) TEST_ERROR + if(H5Lregister(UD_error4_class) >= 0) TEST_ERROR } H5E_END_TRY /* Register the UD plist class. */ @@ -8819,16 +8164,13 @@ ud_link_errors(hid_t fapl, hbool_t new_format) /* Try to create internally defined links with H5Lcreate_ud */ H5E_BEGIN_TRY { - if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_HARD, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) >= 0) - TEST_ERROR - if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_SOFT, "str", (size_t)4, H5P_DEFAULT, H5P_DEFAULT) >= 0) - TEST_ERROR + if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_HARD, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR + if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_SOFT, "str", (size_t)4, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR } H5E_END_TRY /* Try to create a link with H5Lcreate_ud that has a NULL udata pointer, but a non-zero udata_size value */ H5E_BEGIN_TRY { - if(H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, NULL, 1, H5P_DEFAULT, H5P_DEFAULT) >= 0) - TEST_ERROR + if(H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, NULL, 1, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR } H5E_END_TRY; /* Create a user-defined link to the group. */ @@ -8896,17 +8238,17 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end ud_link_errors() */ - + /*------------------------------------------------------------------------- * Function: lapl_nlinks * @@ -8914,28 +8256,21 @@ error: * by the user using the Link Access Property List. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int lapl_nlinks(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - hid_t plist = (-1); /* lapl ID */ - hid_t tid = (-1), sid = (-1), did = (-1); /* Other IDs */ - hid_t gapl = (-1), dapl = (-1), tapl = (-1); /* Other property lists */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; - size_t nlinks; /* nlinks for H5Pset_nlinks */ - hsize_t dims[2]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t plist = -1; /* lapl ID */ + hid_t tid = -1, sid = -1, did = -1; /* Other IDs */ + hid_t gapl = -1, dapl = -1, tapl = -1; /* Other property lists */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; + size_t nlinks; /* nlinks for H5Pset_nlinks */ + hsize_t dims[2]; if(new_format) TESTING("adjusting nlinks with LAPL (w/new group format)") @@ -8950,7 +8285,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Create file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create group with short name in file (used as target for links) */ if((gid = H5Gcreate2(fid, "final", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -8979,7 +8314,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR /* Open file */ - if((fid=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Create LAPL with higher-than-usual nlinks value */ /* Create a non-default lapl with udata set to point to the first group */ @@ -9033,7 +8368,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/soft4")) TEST_ERROR - /* Test other functions that should use a LAPL */ nlinks = 20; if(H5Pset_nlinks(plist, nlinks) < 0) TEST_ERROR @@ -9066,7 +8400,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Close plist */ if(H5Pclose(plist) < 0) TEST_ERROR - /* Create a datatype and dataset as targets inside the group */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR if(H5Tcommit2(gid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -9125,25 +8458,25 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Pclose(gapl); - H5Pclose(dapl); - H5Pclose(tapl); - H5Dclose(did); - H5Sclose(sid); - H5Tclose(tid); - H5Gclose(gid2); - H5Gclose(gid); - H5Pclose(plist); - H5Fclose(fid); - } H5E_END_TRY; - return -1; + H5Pclose(gapl); + H5Pclose(dapl); + H5Pclose(tapl); + H5Dclose(did); + H5Sclose(sid); + H5Tclose(tid); + H5Gclose(gid2); + H5Gclose(gid); + H5Pclose(plist); + H5Fclose(fid); + } H5E_END_TRY; + return FAIL; } /* end lapl_nlinks() */ - + /*------------------------------------------------------------------------- * Function: linkinfo * @@ -9151,21 +8484,17 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Tuesday, June 6, 2006 - * *------------------------------------------------------------------------- */ static int linkinfo(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t tid = (-1); /* Type ID */ - hid_t sid = (-1), did = -(1); /* Dataspace and dataset IDs */ - H5L_info_t li; /* Link information */ - char filename[NAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t tid = -1; /* Type ID */ + hid_t sid = -1, did = -1; /* Dataspace and dataset IDs */ + H5L_info_t li; /* Link information */ + char filename[NAME_BUF_SIZE]; if(new_format) TESTING("link type field in H5Lget_info (w/new group format)") @@ -9218,19 +8547,19 @@ linkinfo(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; - error: +error: H5E_BEGIN_TRY { - H5Tclose (tid); - H5Dclose (did); - H5Gclose (gid); - H5Fclose (fid); + H5Tclose (tid); + H5Dclose (did); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end linkinfo() */ - + /*------------------------------------------------------------------------- * Function: check_all_closed * @@ -9243,10 +8572,6 @@ linkinfo(hid_t fapl, hbool_t new_format) * * Return: Success: 0 * Failure: -1 - * - * Programmer: James Laird - * Thursday, August 17, 2006 - * *------------------------------------------------------------------------- */ static int @@ -9266,8 +8591,7 @@ check_all_closed(hid_t fapl, hbool_t new_format, int stopat) * To check this, try to create every file used in this test. If * a file is already open, creating it will fail. */ - for(x=0; FILENAME[x] != NULL && x < stopat; x++) - { + for(x=0; FILENAME[x] != NULL && x < stopat; x++) { h5_fixname(FILENAME[x], fapl, filename, sizeof filename); if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -9275,17 +8599,15 @@ check_all_closed(hid_t fapl, hbool_t new_format, int stopat) } PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end check_all_closed() */ - - /*------------------------------------------------------------------------- * Function: build_visit_file * @@ -9293,10 +8615,6 @@ error: * * Return: Success: >0, File ID for file built * Failure: -1 - * - * Programmer: Quincey Koziol - * Saturday, November 24, 2007 - * *------------------------------------------------------------------------- */ static hid_t @@ -9304,9 +8622,9 @@ build_visit_file(hid_t fapl) { hid_t fid = -1; /* File ID */ hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t sid = (-1); /* Dataspace ID */ - hid_t did = (-1); /* Dataset ID */ - hid_t tid = (-1); /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t tid = -1; /* Datatype ID */ char filename[NAME_BUF_SIZE]; const char *pathname = H5_get_srcdir_filename(LINKED_FILE); /* Corrected test file name */ @@ -9325,7 +8643,6 @@ build_visit_file(hid_t fapl) if(H5Gclose(gid2) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR - /* Create soft links to groups created */ if(H5Lcreate_soft("/Group1", fid, "/soft_one", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Lcreate_soft("/Group1/Group2", fid, "/soft_two", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -9333,7 +8650,6 @@ build_visit_file(hid_t fapl) /* Create dangling soft link */ if(H5Lcreate_soft("nowhere", fid, "/soft_dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - /* Create hard links to all groups */ if(H5Lcreate_hard(fid, "/", fid, "hard_zero", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Lcreate_hard(fid, "/Group1", fid, "hard_one", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -9382,10 +8698,10 @@ error: H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end build_visit_file() */ - + /*------------------------------------------------------------------------- * Function: visit_link_cb * @@ -9393,15 +8709,10 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Saturday, November 24, 2007 - * *------------------------------------------------------------------------- */ static int -visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t *linfo, - void *_op_data) +visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t *linfo, void *_op_data) { lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data; @@ -9415,7 +8726,7 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t return(H5_ITER_CONT); } /* end visit_link_cb() */ - + /*------------------------------------------------------------------------- * Function: link_visit * @@ -9423,10 +8734,6 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Saturday, November 24, 2007 - * *------------------------------------------------------------------------- */ static int @@ -9456,7 +8763,6 @@ link_visit(hid_t fapl, hbool_t new_format) if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Visit all the links reachable from each internal group */ if((gid = H5Gopen2(fid, "/Group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR udata.idx = 0; @@ -9470,22 +8776,21 @@ link_visit(hid_t fapl, hbool_t new_format) if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Close file created */ if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end link_visit() */ - + /*------------------------------------------------------------------------- * Function: link_visit_by_name * @@ -9493,10 +8798,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Saturday, November 24, 2007 - * *------------------------------------------------------------------------- */ static int @@ -9526,7 +8827,6 @@ link_visit_by_name(hid_t fapl, hbool_t new_format) if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Visit all the links reachable from each internal group */ udata.idx = 0; udata.info = lvisit1; @@ -9548,22 +8848,21 @@ link_visit_by_name(hid_t fapl, hbool_t new_format) if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Close file created */ if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end link_visit_by_name() */ - + /*------------------------------------------------------------------------- * Function: visit_obj_cb * @@ -9571,15 +8870,10 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Sunday, November 25, 2007 - * *------------------------------------------------------------------------- */ static int -visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *oinfo, - void *_op_data) +visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *oinfo, void *_op_data) { ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data; @@ -9593,7 +8887,7 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t * return(H5_ITER_CONT); } /* end visit_obj_cb() */ - + /*------------------------------------------------------------------------- * Function: obj_visit * @@ -9601,10 +8895,6 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t * * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Sunday, November 25, 2007 - * *------------------------------------------------------------------------- */ static int @@ -9634,7 +8924,6 @@ obj_visit(hid_t fapl, hbool_t new_format) if(H5Ovisit2(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Visit all the objects reachable from each internal group */ if((gid = H5Gopen2(fid, "/Group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR udata.idx = 0; @@ -9648,22 +8937,21 @@ obj_visit(hid_t fapl, hbool_t new_format) if(H5Ovisit2(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Close file created */ if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end obj_visit() */ - + /*------------------------------------------------------------------------- * Function: obj_visit_by_name * @@ -9671,10 +8959,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Sunday, November 25, 2007 - * *------------------------------------------------------------------------- */ static int @@ -9704,7 +8988,6 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format) if(H5Ovisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Visit all the objects reachable from each internal group */ udata.idx = 0; udata.info = new_format ? ovisit1_new : ovisit1_old; @@ -9716,7 +8999,6 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format) if(H5Ovisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - udata.idx = 0; udata.info = new_format ? ovisit2_new : ovisit2_old; if(H5Ovisit_by_name2(fid, "/Group1/Group2", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -9727,37 +9009,31 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format) if(H5Ovisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR - /* Close file created */ if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end obj_visit_by_name() */ - + /*------------------------------------------------------------------------- * Function: visit_obj_stop_cb * * Purpose: Callback routine for visiting objects in a file * * Return: 1 (H5_ITER_STOP) - * - * Programmer: Neil Fortner - * Sunday, November 2, 2008 - * *------------------------------------------------------------------------- */ static int -visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name, const H5O_info_t H5_ATTR_UNUSED *oinfo, - void *_op_data) +visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name, const H5O_info_t H5_ATTR_UNUSED *oinfo, void *_op_data) { unsigned *op_data = (unsigned *)_op_data; @@ -9767,7 +9043,7 @@ visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name return(H5_ITER_STOP); } /* end visit_obj_stop_cb() */ - + /*------------------------------------------------------------------------- * Function: obj_visit_stop * @@ -9776,10 +9052,6 @@ visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Sunday, November 2, 2008 - * *------------------------------------------------------------------------- */ static int @@ -9809,7 +9081,7 @@ obj_visit_stop(hid_t fapl, hbool_t new_format) /* Same test with H5Ovisit_by_name */ nvisited = 0; if((ret = H5Ovisit_by_name2(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_obj_stop_cb, - &nvisited, H5O_INFO_BASIC, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + &nvisited, H5O_INFO_BASIC, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(ret != H5_ITER_STOP) TEST_ERROR if(nvisited != 1) TEST_ERROR @@ -9817,16 +9089,16 @@ obj_visit_stop(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end obj_visit_stop() */ - + /*------------------------------------------------------------------------- * Function: link_filters * @@ -9835,10 +9107,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Neil Fortner - * Tuesday, June 16, 2009 - * *------------------------------------------------------------------------- */ static enum { @@ -9851,14 +9119,11 @@ static enum { static htri_t link_filter_can_apply(hid_t dcpl_id, hid_t type_id, hid_t space_id) { - if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0) - return -1; + if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0) return -1; - if(link_filter_state >= LFS_ENCODED) - return 1; + if(link_filter_state >= LFS_ENCODED) return 1; - if(link_filter_state != LFS_INIT) - return -1; + if(link_filter_state != LFS_INIT) return -1; link_filter_state = LFS_CAN_APPLY_CALLED; @@ -9867,14 +9132,11 @@ static htri_t link_filter_can_apply(hid_t dcpl_id, hid_t type_id, hid_t space_id static herr_t link_filter_set_local(hid_t dcpl_id, hid_t type_id, hid_t space_id) { - if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0) - return -1; + if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0) return -1; - if(link_filter_state >= LFS_ENCODED) - return 0; + if(link_filter_state >= LFS_ENCODED) return 0; - if(link_filter_state != LFS_CAN_APPLY_CALLED) - return -1; + if(link_filter_state != LFS_CAN_APPLY_CALLED) return -1; link_filter_state = LFS_SET_LOCAL_CALLED; @@ -9885,19 +9147,16 @@ static size_t link_filter_filter(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[], size_t nbytes, size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { - if(flags & H5Z_FLAG_OPTIONAL || cd_nelmts != 1 || cd_values[0] != 2112) - return 0; + if(flags & H5Z_FLAG_OPTIONAL || cd_nelmts != 1 || cd_values[0] != 2112) return 0; - if(link_filter_state == LFS_DECODED) - return nbytes; + if(link_filter_state == LFS_DECODED) return nbytes; if(flags & H5Z_FLAG_REVERSE) { - if(link_filter_state != LFS_ENCODED) - return 0; + if(link_filter_state != LFS_ENCODED) return 0; link_filter_state = LFS_DECODED; - } else { - if(link_filter_state < LFS_SET_LOCAL_CALLED) - return 0; + } + else { + if(link_filter_state < LFS_SET_LOCAL_CALLED) return 0; link_filter_state = LFS_ENCODED; } /* end else */ @@ -9918,7 +9177,7 @@ link_filters(hid_t fapl, hbool_t new_format) int nfilters = 0; H5Z_class2_t filter_class; char name_out[24]; - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; htri_t tri_ret; herr_t status; @@ -9936,8 +9195,7 @@ link_filters(hid_t fapl, hbool_t new_format) /* Set up filename and create file*/ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create gcpl, force use of dense storage */ if((gcpl1 = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR @@ -9965,8 +9223,7 @@ link_filters(hid_t fapl, hbool_t new_format) filter_class.set_local = link_filter_set_local; filter_class.filter = link_filter_filter; if(H5Zregister(&filter_class) < 0) TEST_ERROR - if(H5Pset_filter(gcpl1, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0) - TEST_ERROR + if(H5Pset_filter(gcpl1, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0) TEST_ERROR nfilters++; /* Test various other filter functions for use on gcpl's */ @@ -9974,14 +9231,10 @@ link_filters(hid_t fapl, hbool_t new_format) if(H5Pall_filters_avail(gcpl1) != TRUE) TEST_ERROR /* Create a group using this filter, add some soft links to it */ - if((gid1 = H5Gcreate2(fid, "group1", H5P_DEFAULT, gcpl1, H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Lcreate_soft("/", gid1, "link1", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if((gid1 = H5Gcreate2(fid, "group1", H5P_DEFAULT, gcpl1, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Lcreate_soft("/", gid1, "link1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file and group */ if(H5Gclose(gid1) < 0) TEST_ERROR @@ -10005,12 +9258,10 @@ link_filters(hid_t fapl, hbool_t new_format) if(H5Pclose(gcpl2) < 0) TEST_ERROR /* Add another soft link */ - if(H5Lcreate_soft("/", gid1, "link4", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_soft("/", gid1, "link4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Copy the group */ - if(H5Ocopy(fid, "group1", fid, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Ocopy(fid, "group1", fid, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if((gid2 = H5Gopen2(fid, "group2", H5P_DEFAULT)) <0) TEST_ERROR /* Verify that all links have been copied */ @@ -10039,10 +9290,8 @@ link_filters(hid_t fapl, hbool_t new_format) /* Reopen file and group, add 2 links */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR if((gid1 = H5Gopen2(fid, "group1", H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close file and group */ if(H5Gclose(gid1) < 0) TEST_ERROR @@ -10053,34 +9302,27 @@ link_filters(hid_t fapl, hbool_t new_format) /* Test H5Pget_filter_by_id2 and H5Pget_filter2 */ if(H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, - &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) - TEST_ERROR + &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR if(flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED - | H5Z_FILTER_CONFIG_DECODE_ENABLED)) - TEST_ERROR + | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR if(H5Pget_filter2(gcpl2, (unsigned)(nfilters - 1), &flags_out, &cd_nelmts, - &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) - TEST_ERROR + &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR if(flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED - | H5Z_FILTER_CONFIG_DECODE_ENABLED)) - TEST_ERROR + | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR /* Test H5Pmodify_filter */ cd_value++; - if(H5Pmodify_filter(gcpl2, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0) - TEST_ERROR + if(H5Pmodify_filter(gcpl2, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0) TEST_ERROR if(H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, - &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) - TEST_ERROR + &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR if(flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED - | H5Z_FILTER_CONFIG_DECODE_ENABLED)) - TEST_ERROR + | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR /* Test H5Premove_filter */ if(H5Premove_filter(gcpl2, H5Z_FILTER_RESERVED + 42) < 0) TEST_ERROR @@ -10106,8 +9348,7 @@ link_filters(hid_t fapl, hbool_t new_format) if(H5Pset_create_intermediate_group(lcpl, (unsigned)TRUE) < 0) TEST_ERROR /* Create new group, with missing intermediate groups, in compressed group */ - if((gid1 = H5Gcreate2(fid, "group1/group2/group3/group4", lcpl, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + if((gid1 = H5Gcreate2(fid, "group1/group2/group3/group4", lcpl, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close LCPL ID */ if(H5Pclose(lcpl) < 0) TEST_ERROR @@ -10135,7 +9376,6 @@ link_filters(hid_t fapl, hbool_t new_format) /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR - /* Now create the same file with and without deflate, and verify that the * file size is smaller with deflate */ /* But only if the deflate filter is available */ @@ -10149,8 +9389,7 @@ link_filters(hid_t fapl, hbool_t new_format) if(H5Pset_link_phase_change(fcpl, 2, 2) < 0) TEST_ERROR /* Create file */ - if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - TEST_ERROR + if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR /* Create links in file */ if(H5Lcreate_soft("/", fid, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", H5P_DEFAULT, H5P_DEFAULT) < 0) @@ -10168,8 +9407,7 @@ link_filters(hid_t fapl, hbool_t new_format) if(H5Pset_deflate(fcpl, 6) < 0) TEST_ERROR /* Recreate the same file with the deflate filter */ - if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - TEST_ERROR + if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR if(H5Lcreate_soft("/", fid, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Lcreate_soft("/", fid, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", H5P_DEFAULT, H5P_DEFAULT) < 0) @@ -10182,16 +9420,14 @@ link_filters(hid_t fapl, hbool_t new_format) filesize_filtered = h5_get_file_size(filename, fapl); /* Check that the file size is smaller with the filter */ - if((double)filesize_filtered - > ((double)filesize_unfiltered * FILTER_FILESIZE_MAX_FRACTION)) - TEST_ERROR + if((double)filesize_filtered > ((double)filesize_unfiltered * FILTER_FILESIZE_MAX_FRACTION)) TEST_ERROR /* Close */ if(H5Pclose(fcpl) < 0) TEST_ERROR } /* end if */ PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -10203,10 +9439,10 @@ error: H5Pclose(gcpl2); H5Pclose(fcpl); } H5E_END_TRY; - return -1; + return FAIL; } /* end link_filters() */ - + /*------------------------------------------------------------------------- * Function: obj_exists * @@ -10214,19 +9450,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, February 2, 2010 - * *------------------------------------------------------------------------- */ static int obj_exists(hid_t fapl, hbool_t new_format) { - char filename[NAME_BUF_SIZE]; /* Buffer for file name */ - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - herr_t status; /* Generic return value */ + char filename[NAME_BUF_SIZE]; /* Buffer for file name */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + herr_t status; /* Generic return value */ if(new_format) TESTING("object exists (w/new group format)") @@ -10236,8 +9468,7 @@ obj_exists(hid_t fapl, hbool_t new_format) /* Set up filename and create file*/ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - FAIL_STACK_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Hard links */ /* Verify that H5Oexists_by_name() fails for non-existent link in root group */ @@ -10247,13 +9478,11 @@ obj_exists(hid_t fapl, hbool_t new_format) if(status >= 0) TEST_ERROR /* Create a group, as a destination for testing */ - if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() succeeds for hard linked object */ - if(TRUE != H5Oexists_by_name(fid, "group", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "group", H5P_DEFAULT)) TEST_ERROR /* Verify that H5Oexists_by_name() fails for non-existent link in non-root group */ H5E_BEGIN_TRY { @@ -10261,240 +9490,205 @@ obj_exists(hid_t fapl, hbool_t new_format) } H5E_END_TRY if(status >= 0) TEST_ERROR - /* Soft links */ /* Create dangling soft-link in root group */ if(H5Lcreate_soft("dangle", fid, "soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE for dangling soft-link in root group */ - if(FALSE != H5Oexists_by_name(fid, "soft1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "soft1", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in root group that points to object */ if(H5Lcreate_soft("/group", fid, "soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns TRUE for soft-link in root group that points to object */ - if(TRUE != H5Oexists_by_name(fid, "soft2", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "soft2", H5P_DEFAULT)) TEST_ERROR /* Create dangling soft-link in non-root group */ if(H5Lcreate_soft("dangle", fid, "group/soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE for dangling soft-link in non-root group */ - if(FALSE != H5Oexists_by_name(fid, "group/soft1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/soft1", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to object */ if(H5Lcreate_soft("/group", fid, "group/soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns TRUE for soft-link in non-root group that points to object */ - if(TRUE != H5Oexists_by_name(fid, "group/soft2", H5P_DEFAULT)) - TEST_ERROR - + if(TRUE != H5Oexists_by_name(fid, "group/soft2", H5P_DEFAULT)) TEST_ERROR /* External links */ /* Create dangling (file doesn't exist) external link in root group */ if(H5Lcreate_external("nofile", "dangle", fid, "external1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE for dangling (file doesn't exist) external link in root group */ - if(FALSE != H5Oexists_by_name(fid, "external1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "external1", H5P_DEFAULT)) TEST_ERROR /* Create dangling (object doesn't exist) external link in root group */ if(H5Lcreate_external(filename, "dangle", fid, "external2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE for dangling (object doesn't exist) external link in root group */ - if(FALSE != H5Oexists_by_name(fid, "external2", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "external2", H5P_DEFAULT)) TEST_ERROR /* Create external link in root group that points to object */ if(H5Lcreate_external(filename, "group", fid, "external3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns TRUE for external link in root group that points to object */ - if(TRUE != H5Oexists_by_name(fid, "external3", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "external3", H5P_DEFAULT)) TEST_ERROR /* Create dangling (file doesn't exist) external link in non-root group */ if(H5Lcreate_external("nofile", "dangle", fid, "group/external1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE for dangling (file doesn't exist) external link in non-root group */ - if(FALSE != H5Oexists_by_name(fid, "group/external1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/external1", H5P_DEFAULT)) TEST_ERROR /* Create dangling (object doesn't exist) external link in non-root group */ if(H5Lcreate_external(filename, "dangle", fid, "group/external2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE for dangling (object doesn't exist) external link in non-root group */ - if(FALSE != H5Oexists_by_name(fid, "group/external2", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/external2", H5P_DEFAULT)) TEST_ERROR /* Create external link in non-root group that points to object */ if(H5Lcreate_external(filename, "group", fid, "group/external3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns TRUE for external link in non-root group that points to object */ - if(TRUE != H5Oexists_by_name(fid, "group/external3", H5P_DEFAULT)) - TEST_ERROR - + if(TRUE != H5Oexists_by_name(fid, "group/external3", H5P_DEFAULT)) TEST_ERROR /* Soft->External links */ /* Create soft-link in root group that points to dangling (file doesn't exist) external link */ if(H5Lcreate_soft("external1", fid, "soft-elink1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "soft-elink1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "soft-elink1", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in root group that points to dangling (object doesn't exist) external link */ if(H5Lcreate_soft("external2", fid, "soft-elink2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "soft-elink2", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "soft-elink2", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in root group that points to external link that points to object */ if(H5Lcreate_soft("external3", fid, "soft-elink3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "soft-elink3", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "soft-elink3", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in root group that points to dangling (file doesn't exist) external link in non-root group */ if(H5Lcreate_soft("group/external1", fid, "soft-elink4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "soft-elink4", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "soft-elink4", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in root group that points to dangling (object doesn't exist) external link in non-root group */ if(H5Lcreate_soft("group/external2", fid, "soft-elink5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "soft-elink5", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "soft-elink5", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in root group that points to external link in non-root group that points to object */ if(H5Lcreate_soft("group/external3", fid, "soft-elink6", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "soft-elink6", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "soft-elink6", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to dangling (file doesn't exist) external link */ if(H5Lcreate_soft("/external1", fid, "group/soft-elink1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "group/soft-elink1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/soft-elink1", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to dangling (object doesn't exist) external link */ if(H5Lcreate_soft("/external2", fid, "group/soft-elink2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "group/soft-elink2", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/soft-elink2", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to external link that points to object */ if(H5Lcreate_soft("/external3", fid, "group/soft-elink3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "group/soft-elink3", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "group/soft-elink3", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to dangling (file doesn't exist) external link in non-root group */ if(H5Lcreate_soft("/group/external1", fid, "group/soft-elink4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "group/soft-elink4", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/soft-elink4", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to dangling (object doesn't exist) external link in non-root group */ if(H5Lcreate_soft("/group/external2", fid, "group/soft-elink5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "group/soft-elink5", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/soft-elink5", H5P_DEFAULT)) TEST_ERROR /* Create soft-link in non-root group that points to external link in non-root group that points to object */ if(H5Lcreate_soft("/group/external3", fid, "group/soft-elink6", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "group/soft-elink6", H5P_DEFAULT)) - TEST_ERROR - + if(TRUE != H5Oexists_by_name(fid, "group/soft-elink6", H5P_DEFAULT)) TEST_ERROR /* External->Soft links */ /* Create external link in root group that points to dangling soft link in root group */ if(H5Lcreate_external(filename, "soft1", fid, "elink-soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "elink-soft1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "elink-soft1", H5P_DEFAULT)) TEST_ERROR /* Create external link in root group that points to soft link in root group that points to object */ if(H5Lcreate_external(filename, "soft2", fid, "elink-soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "elink-soft2", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "elink-soft2", H5P_DEFAULT)) TEST_ERROR /* Create external link in root group that points to dangling soft link in non-root group */ if(H5Lcreate_external(filename, "group/soft1", fid, "elink-soft3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "elink-soft3", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "elink-soft3", H5P_DEFAULT)) TEST_ERROR /* Create external link in root group that points to soft link in root group that points to object */ if(H5Lcreate_external(filename, "group/soft2", fid, "elink-soft4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "elink-soft4", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "elink-soft4", H5P_DEFAULT)) TEST_ERROR /* Create external link in non-root group that points to dangling soft link in root group */ if(H5Lcreate_external(filename, "soft1", fid, "group/elink-soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "group/elink-soft1", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/elink-soft1", H5P_DEFAULT)) TEST_ERROR /* Create external link in non-root group that points to soft link in root group that points to object */ if(H5Lcreate_external(filename, "soft2", fid, "group/elink-soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "group/elink-soft2", H5P_DEFAULT)) - TEST_ERROR + if(TRUE != H5Oexists_by_name(fid, "group/elink-soft2", H5P_DEFAULT)) TEST_ERROR /* Create external link in non-root group that points to dangling soft link in non-root group */ if(H5Lcreate_external(filename, "group/soft1", fid, "group/elink-soft3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns FALSE */ - if(FALSE != H5Oexists_by_name(fid, "group/elink-soft3", H5P_DEFAULT)) - TEST_ERROR + if(FALSE != H5Oexists_by_name(fid, "group/elink-soft3", H5P_DEFAULT)) TEST_ERROR /* Create external link in non-root group that points to soft link in non-root group that points to object */ if(H5Lcreate_external(filename, "group/soft2", fid, "group/elink-soft4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify that H5Oexists_by_name() returns TRUE */ - if(TRUE != H5Oexists_by_name(fid, "group/elink-soft4", H5P_DEFAULT)) - TEST_ERROR - + if(TRUE != H5Oexists_by_name(fid, "group/elink-soft4", H5P_DEFAULT)) TEST_ERROR /* Close file created */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; - return -1; + return FAIL; } /* end obj_exists() */ - + /*------------------------------------------------------------------------- * Function: corder_create_empty * @@ -10502,19 +9696,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, October 30, 2006 - * *------------------------------------------------------------------------- */ static int corder_create_empty(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - unsigned crt_order_flags; /* Status of creation order info for GCPL */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t gcpl_id = -1; /* Group creation property list ID */ + unsigned crt_order_flags; /* Status of creation order info for GCPL */ herr_t ret; /* Generic return value */ char filename[NAME_BUF_SIZE];/* File name */ @@ -10536,9 +9726,9 @@ corder_create_empty(hid_t fapl) ret = H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_INDEXED); } H5E_END_TRY; if(ret > 0) { - H5_FAILED(); - HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); - TEST_ERROR + H5_FAILED(); + HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); + TEST_ERROR } /* end if */ /* Set creation order tracking & indexing on group */ @@ -10563,7 +9753,6 @@ corder_create_empty(hid_t fapl) /* Close the file */ if(H5Fclose(file_id) < 0) TEST_ERROR - /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -10590,7 +9779,7 @@ corder_create_empty(hid_t fapl) if(H5Fclose(file_id) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -10598,10 +9787,10 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end corder_create_empty() */ - + /*------------------------------------------------------------------------- * Function: corder_create_compact * @@ -10610,21 +9799,17 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, October 30, 2006 - * *------------------------------------------------------------------------- */ static int corder_create_compact(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1, group_id2 = -1; /* Group IDs */ + hid_t gcpl_id = -1; /* Group creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ + unsigned nlinks; /* Number of link messages in group's header */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE];/* File name */ unsigned u; /* Local index variable */ @@ -10674,7 +9859,6 @@ corder_create_compact(hid_t fapl) /* Close the file */ if(H5Fclose(file_id) < 0) TEST_ERROR - /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -10708,7 +9892,7 @@ corder_create_compact(hid_t fapl) if(H5Fclose(file_id) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -10716,10 +9900,10 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end corder_create_compact() */ - + /*------------------------------------------------------------------------- * Function: corder_create_dense * @@ -10728,21 +9912,17 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, October 30, 2006 - * *------------------------------------------------------------------------- */ static int corder_create_dense(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1, group_id2 = -1; /* Group IDs */ + hid_t gcpl_id = -1; /* Group creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ + unsigned nlinks; /* Number of link messages in group's header */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -10808,7 +9988,6 @@ corder_create_dense(hid_t fapl) /* Close the file */ if(H5Fclose(file_id) < 0) TEST_ERROR - /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -10841,7 +10020,7 @@ corder_create_dense(hid_t fapl) if(H5Fclose(file_id) < 0) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -10849,10 +10028,10 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end corder_create_dense() */ - + /*------------------------------------------------------------------------- * Function: corder_transition * @@ -10861,25 +10040,21 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, October 30, 2006 - * *------------------------------------------------------------------------- */ static int corder_transition(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1, group_id2 = -1; /* Group IDs */ + hid_t gcpl_id = -1; /* Group creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ + unsigned nlinks; /* Number of link messages in group's header */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - h5_stat_size_t empty_size; /* Size of empty file */ - h5_stat_size_t file_size; /* Size of file after operating on it */ + h5_stat_size_t empty_size; /* Size of empty file */ + h5_stat_size_t file_size; /* Size of file after operating on it */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE];/* File name */ unsigned u; /* Local index variable */ @@ -10919,7 +10094,6 @@ corder_transition(hid_t fapl) /* Get the size of the file with an empty group */ if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR - /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -10994,7 +10168,6 @@ corder_transition(hid_t fapl) /* Close the file */ if(H5Fclose(file_id) < 0) TEST_ERROR - /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR @@ -11070,7 +10243,7 @@ corder_transition(hid_t fapl) if(file_size != empty_size) TEST_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -11078,10 +10251,10 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end corder_transition() */ - + /*------------------------------------------------------------------------- * Function: corder_delete * @@ -11091,25 +10264,21 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, October 30, 2006 - * *------------------------------------------------------------------------- */ static int corder_delete(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1, group_id2 = -1; /* Group IDs */ + hid_t gcpl_id = -1; /* Group creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ unsigned reopen_file; /* Whether to re-open the file before deleting group */ - h5_stat_size_t empty_size; /* Size of empty file */ - h5_stat_size_t file_size; /* Size of file after operating on it */ + h5_stat_size_t empty_size; /* Size of empty file */ + h5_stat_size_t file_size; /* Size of file after operating on it */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE];/* File name */ unsigned u; /* Local index variable */ @@ -11122,7 +10291,7 @@ corder_delete(hid_t fapl) /* Create file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - /* Creating file with latest format will enable paged aggregation with persistent fs */ + /* Creating file with latest format will enable paged aggregation with persistent fs */ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Close file */ @@ -11199,7 +10368,7 @@ corder_delete(hid_t fapl) } /* end for */ PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -11207,25 +10376,21 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end corder_delete() */ - + /*------------------------------------------------------------------------- * Function: link_info_by_idx_check * * Purpose: Support routine for link_info_by_idx, to verify the link * info is correct for a link * - * Note: This routine assumes that the links have been inserted in the + * Note: This routine assumes that the links have been inserted in the * group in alphabetical order. * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 7, 2006 - * *------------------------------------------------------------------------- */ static int @@ -11369,7 +10534,7 @@ error: return(-1); } /* end link_info_by_idx_check() */ - + /*------------------------------------------------------------------------- * Function: link_info_by_idx * @@ -11378,18 +10543,14 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 6, 2006 - * *------------------------------------------------------------------------- */ static int link_info_by_idx(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t gcpl_id = -1; /* Group creation property list ID */ unsigned hard_link; /* Create hard or soft link? */ unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ @@ -11453,7 +10614,7 @@ link_info_by_idx(hid_t fapl) /* Check for creating hard or soft link */ if(hard_link) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Create hard link, with group object */ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -11495,7 +10656,7 @@ link_info_by_idx(hid_t fapl) /* Check for creating hard or soft link */ if(hard_link) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Create hard link, with group object */ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -11543,7 +10704,7 @@ link_info_by_idx(hid_t fapl) } /* end for */ } /* end for */ - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -11551,10 +10712,10 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end link_info_by_idx() */ - + /*------------------------------------------------------------------------- * Function: link_info_by_idx_old * @@ -11563,17 +10724,13 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 7, 2006 - * *------------------------------------------------------------------------- */ static int link_info_by_idx_old(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1, group_id2 = -1; /* Group IDs */ unsigned hard_link; /* Create hard or soft link? */ H5L_info_t linfo; /* Link info struct */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -11711,17 +10868,17 @@ link_info_by_idx_old(hid_t fapl) PASSED(); } /* end for */ - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end link_info_by_idx_old() */ - + /*------------------------------------------------------------------------- * Function: delete_by_idx * @@ -11730,19 +10887,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 14, 2006 - * *------------------------------------------------------------------------- */ static int delete_by_idx(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t gcpl_id = -1; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ @@ -11806,10 +10959,8 @@ delete_by_idx(hid_t fapl) /* Query the group creation properties */ if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR - /* Delete links from one end */ - /* Check for deletion on empty group */ H5E_BEGIN_TRY { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); @@ -11824,7 +10975,7 @@ delete_by_idx(hid_t fapl) /* Create several links, up to limit of compact form */ for(u = 0; u < max_compact; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -11879,7 +11030,7 @@ delete_by_idx(hid_t fapl) /* Create more links, to push group into dense form */ for(u = 0; u < (max_compact * 2); u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -11940,13 +11091,11 @@ delete_by_idx(hid_t fapl) } H5E_END_TRY; if(ret >= 0) TEST_ERROR - /* Delete links in middle */ - /* Create more links, to push group into dense form */ for(u = 0; u < (max_compact * 2); u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -12020,8 +11169,6 @@ delete_by_idx(hid_t fapl) if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR - - /* Close the group */ if(H5Gclose(group_id) < 0) TEST_ERROR @@ -12036,7 +11183,7 @@ delete_by_idx(hid_t fapl) } /* end for */ } /* end for */ - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -12044,10 +11191,10 @@ error: H5Gclose(group_id); H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end delete_by_idx() */ - + /*------------------------------------------------------------------------- * Function: delete_by_idx_old * @@ -12056,17 +11203,13 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Wednesday, November 15, 2006 - * *------------------------------------------------------------------------- */ static int delete_by_idx_old(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1, group_id2 = -1; /* Group IDs */ H5L_info_t linfo; /* Link info struct */ H5_iter_order_t order; /* Order within in the index */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -12091,10 +11234,8 @@ delete_by_idx_old(hid_t fapl) /* Create group to operate on */ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - /* Delete links from one end */ - /* Check for deletion in empty group */ H5E_BEGIN_TRY { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); @@ -12170,10 +11311,8 @@ delete_by_idx_old(hid_t fapl) /* Verify state of group */ if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR - /* Delete links in middle */ - /* Create several links */ for(u = 0; u < CORDER_NLINKS; u++) { H5O_info_t oi; /* Buffer for querying object's info */ @@ -12261,7 +11400,7 @@ delete_by_idx_old(hid_t fapl) PASSED(); } /* end for */ - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -12269,10 +11408,10 @@ error: H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end delete_by_idx_old() */ - + /*------------------------------------------------------------------------- * Function: link_iterate_cb * @@ -12280,10 +11419,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int @@ -12292,14 +11427,14 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, { link_iter_info_t *op_data = (link_iter_info_t *)_op_data; /* User data */ char objname[NAME_BUF_SIZE]; /* Object name */ - H5L_info_t my_info; /* Local link info */ + H5L_info_t my_info; /* Local link info */ /* Increment # of times the callback was called */ op_data->ncalled++; /* Get the link information directly to compare */ if(H5Lget_info(group_id, link_name, &my_info, H5P_DEFAULT) < 0) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; /* Check more things for link iteration (vs. group iteration) */ if(info) { @@ -12307,31 +11442,31 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, /* (if we are operating in increasing or decreasing order) */ if(op_data->order != H5_ITER_NATIVE) if(info->corder != op_data->curr) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; /* Compare link info structs */ if(info->type != my_info.type) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(info->corder_valid != my_info.corder_valid) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(info->corder != my_info.corder) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(info->cset != my_info.cset) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(H5F_addr_ne(info->u.address, my_info.u.address)) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; } /* end if */ /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder); if(HDstrcmp(link_name, objname)) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; /* Check if we've visited this link before */ if((size_t)op_data->curr >= op_data->max_visit) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(op_data->visited[op_data->curr]) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; op_data->visited[op_data->curr] = TRUE; /* Advance to next value, in correct direction */ @@ -12343,13 +11478,13 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, /* Check for stopping in the middle of iterating */ if(op_data->stop > 0) if(--op_data->stop == 0) - return(CORDER_ITER_STOP); + return CORDER_ITER_STOP; - return(H5_ITER_CONT); + return H5_ITER_CONT; } /* end link_iterate_cb() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /*------------------------------------------------------------------------- * Function: group_iterate_cb * @@ -12358,20 +11493,16 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int group_iterate_cb(hid_t group_id, const char *link_name, void *_op_data) { - return(link_iterate_cb(group_id, link_name, NULL, _op_data)); + return link_iterate_cb(group_id, link_name, NULL, _op_data); } /* end group_iterate_cb() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: link_iterate_fail_cb * @@ -12380,20 +11511,16 @@ group_iterate_cb(hid_t group_id, const char *link_name, void *_op_data) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int link_iterate_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *link_name, const H5L_info_t H5_ATTR_UNUSED *info, void H5_ATTR_UNUSED *_op_data) { - return(H5_ITER_ERROR); + return H5_ITER_ERROR; } /* end link_iterate_fail_cb() */ - + /*------------------------------------------------------------------------- * Function: link_iterate_check * @@ -12401,10 +11528,6 @@ link_iterate_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *l * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int @@ -12432,7 +11555,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, for(v = 0; v < max_links; v++) if(iter_info->visited[v] == FALSE) TEST_ERROR - #ifndef H5_NO_DEPRECATED_SYMBOLS /* Iterate over links in group, with H5Giterate */ iter_info->nskipped = (unsigned)(gskip = 0); @@ -12449,7 +11571,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, if(iter_info->visited[v] == FALSE) TEST_ERROR #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Skip over some links in group */ iter_info->nskipped = (unsigned)(skip = max_links / 2); iter_info->order = order; @@ -12480,7 +11601,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, if(nvisit != (max_links / 2)) TEST_ERROR } /* end else */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /* Skip over some links in group, with H5Giterate */ iter_info->nskipped = (unsigned)(gskip = (int)(max_links / 2)); @@ -12513,7 +11633,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Iterate over links in group, stopping in the middle */ iter_info->nskipped = (unsigned)(skip = 0); iter_info->order = order; @@ -12525,7 +11644,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, if(ret != CORDER_ITER_STOP) TEST_ERROR if(iter_info->ncalled != 3) TEST_ERROR - #ifndef H5_NO_DEPRECATED_SYMBOLS /* Iterate over links in group, stopping in the middle, with H5Giterate() */ iter_info->nskipped = (unsigned)(gskip = 0); @@ -12539,7 +11657,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, if(iter_info->ncalled != 3) TEST_ERROR #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Check for iteration routine indicating failure */ skip = 0; H5E_BEGIN_TRY { @@ -12548,13 +11665,13 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, if(ret >= 0) TEST_ERROR /* Success */ - return(0); + return SUCCEED; error: - return(-1); + return FAIL; } /* end link_iterate_check() */ - + /*------------------------------------------------------------------------- * Function: link_iterate * @@ -12572,9 +11689,9 @@ error: static int link_iterate(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ + hid_t file_id = (-1); /* File ID */ + hid_t group_id = (-1); /* Group ID */ + hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ @@ -12659,14 +11776,13 @@ link_iterate(hid_t fapl) /* Create group with creation order tracking on */ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR - /* Check for iteration on empty group */ /* (should be OK) */ if(H5Literate(group_id, idx_type, order, NULL, link_iterate_cb, NULL) < 0) TEST_ERROR /* Create several links, up to limit of compact form */ for(u = 0; u < max_compact; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -12689,10 +11805,9 @@ link_iterate(hid_t fapl) /* Test iteration over links in compact group */ if(link_iterate_check(group_id, idx_type, order, u, &iter_info) < 0) TEST_ERROR - /* Create more links, to push group into dense form */ for(; u < (max_compact * 2); u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -12734,7 +11849,7 @@ link_iterate(hid_t fapl) if(visited) HDfree(visited); - return 0; + return SUCCEED; error: /* Free resources */ @@ -12747,10 +11862,10 @@ error: if(visited) HDfree(visited); - return -1; + return FAIL; } /* end link_iterate() */ - + /*------------------------------------------------------------------------- * Function: link_iterate_old_cb * @@ -12758,52 +11873,47 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int -link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, - void *_op_data) +link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, void *_op_data) { link_iter_info_t *op_data = (link_iter_info_t *)_op_data; /* User data */ char objname[NAME_BUF_SIZE]; /* Object name */ - H5L_info_t my_info; /* Local link info */ + H5L_info_t my_info; /* Local link info */ /* Increment # of times the callback was called */ op_data->ncalled++; /* Get the link information directly to compare */ if(H5Lget_info(group_id, link_name, &my_info, H5P_DEFAULT) < 0) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; /* Check more things for link iteration (vs. group iteration) */ if(info) { /* Compare link info structs */ if(info->type != my_info.type) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(info->corder_valid != my_info.corder_valid) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(info->corder != my_info.corder) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(info->cset != my_info.cset) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(H5F_addr_ne(info->u.address, my_info.u.address)) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; } /* end if */ /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped))); if(HDstrcmp(link_name, objname)) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; /* Check if we've visited this link before */ if((size_t)op_data->curr >= op_data->max_visit) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; if(op_data->visited[op_data->curr]) - return(H5_ITER_ERROR); + return H5_ITER_ERROR; op_data->visited[op_data->curr] = TRUE; /* Advance to next value, in correct direction */ @@ -12815,13 +11925,13 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *inf /* Check for stopping in the middle of iterating */ if(op_data->stop > 0) if(--op_data->stop == 0) - return(CORDER_ITER_STOP); + return CORDER_ITER_STOP; - return(H5_ITER_CONT); + return H5_ITER_CONT; } /* end link_iterate_old_cb() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /*------------------------------------------------------------------------- * Function: group_iterate_old_cb * @@ -12830,20 +11940,16 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *inf * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int group_iterate_old_cb(hid_t group_id, const char *link_name, void *_op_data) { - return(link_iterate_old_cb(group_id, link_name, NULL, _op_data)); + return link_iterate_old_cb(group_id, link_name, NULL, _op_data); } /* end group_iterate_old_cb() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: link_iterate_old_check * @@ -12851,15 +11957,10 @@ group_iterate_old_cb(hid_t group_id, const char *link_name, void *_op_data) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 20, 2006 - * *------------------------------------------------------------------------- */ static int -link_iterate_old_check(hid_t group_id, H5_iter_order_t order, - unsigned max_links, link_iter_info_t *iter_info) +link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links, link_iter_info_t *iter_info) { unsigned v; /* Local index variable */ hsize_t skip; /* # of links to skip in group */ @@ -12882,7 +11983,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, for(v = 0; v < max_links; v++) if(iter_info->visited[v] == FALSE) TEST_ERROR - #ifndef H5_NO_DEPRECATED_SYMBOLS /* Iterate over links in group, with H5Giterate */ iter_info->nskipped = (unsigned)(gskip = 0); @@ -12899,7 +11999,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, if(iter_info->visited[v] == FALSE) TEST_ERROR #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Skip over some links in group */ iter_info->nskipped = (unsigned)(skip = max_links / 2); iter_info->order = order; @@ -12930,7 +12029,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, if(nvisit != (max_links / 2)) TEST_ERROR } /* end else */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /* Skip over some links in group, with H5Giterate */ iter_info->nskipped = (unsigned)(gskip = (int)(max_links / 2)); @@ -12963,7 +12061,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Iterate over links in group, stopping in the middle */ iter_info->nskipped = (unsigned)(skip = 0); iter_info->order = order; @@ -12975,7 +12072,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, if(ret != CORDER_ITER_STOP) TEST_ERROR if(iter_info->ncalled != 3) TEST_ERROR - #ifndef H5_NO_DEPRECATED_SYMBOLS /* Iterate over links in group, stopping in the middle, with H5Giterate() */ iter_info->nskipped = (unsigned)(gskip = 0); @@ -12989,7 +12085,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, if(iter_info->ncalled != 3) TEST_ERROR #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Check for iteration routine indicating failure */ skip = 0; H5E_BEGIN_TRY { @@ -13012,13 +12107,13 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Success */ - return(0); + return SUCCEED; error: - return(-1); + return FAIL; } /* end link_iterate_old_check() */ - + /*------------------------------------------------------------------------- * Function: link_iterate_old * @@ -13026,17 +12121,13 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 14, 2006 - * *------------------------------------------------------------------------- */ static int link_iterate_old(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ H5_iter_order_t order; /* Order within in the index */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE];/* File name */ @@ -13072,14 +12163,13 @@ link_iterate_old(hid_t fapl) /* Create group with creation order tracking on */ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - /* Check for iteration on empty group */ /* (should be OK) */ if(H5Literate(group_id, H5_INDEX_NAME, order, NULL, link_iterate_old_cb, NULL) < 0) TEST_ERROR /* Create several links */ for(u = 0; u < CORDER_NLINKS; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -13110,7 +12200,6 @@ link_iterate_old(hid_t fapl) /* Test iteration over links in group */ if(link_iterate_old_check(group_id, order, u, &iter_info) < 0) TEST_ERROR - /* Close the group */ if(H5Gclose(group_id) < 0) TEST_ERROR @@ -13124,7 +12213,7 @@ link_iterate_old(hid_t fapl) if(visited) HDfree(visited); - return 0; + return SUCCEED; error: /* Free resources */ @@ -13136,10 +12225,10 @@ error: if(visited) HDfree(visited); - return -1; + return FAIL; } /* end link_iterate_old() */ - + /*------------------------------------------------------------------------- * Function: open_by_idx_check * @@ -13147,19 +12236,14 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 21, 2006 - * *------------------------------------------------------------------------- */ static int open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, - H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, - haddr_t *objno) + H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, haddr_t *objno) { char mntname[NAME_BUF_SIZE]; /* Link value */ - hid_t group_id = (-1); /* ID of group to test */ + hid_t group_id = -1; /* ID of group to test */ H5O_info_t oi; /* Buffer for querying object's info */ haddr_t mnt_root_addr; /* Address of root group in file to mount */ hid_t obj_id; /* ID of object opened */ @@ -13200,10 +12284,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, } /* end for */ } /* end for */ - - /* - * Verify opening correct object by index when file mounting is present - */ + /* Verify opening correct object by index when file mounting is present */ /* Get the address of the root group in the file to mount */ if(H5Oget_info2(mount_file_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR @@ -13230,15 +12311,14 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, /* Unmount the file */ if(H5Funmount(main_group_id, mntname) < 0) TEST_ERROR - /* Success */ - return(0); + return SUCCEED; error: - return(-1); + return FAIL; } /* end open_by_idx_check() */ - + /*------------------------------------------------------------------------- * Function: open_by_idx * @@ -13247,21 +12327,17 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 21, 2006 - * *------------------------------------------------------------------------- */ static int open_by_idx(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t mount_file_id = (-1); /* File ID for file to mount */ - hid_t group_id = (-1); /* Group ID */ - hid_t soft_group_id = (-1); /* Group ID for soft links */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ + hid_t file_id = -1; /* File ID */ + hid_t mount_file_id = -1; /* File ID for file to mount */ + hid_t group_id = -1; /* Group ID */ + hid_t soft_group_id = -1; /* Group ID for soft links */ + hid_t gcpl_id = -1; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ @@ -13350,17 +12426,15 @@ open_by_idx(hid_t fapl) /* Create group with creation order tracking on for soft links */ if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR - /* Try to open on object in an empty group */ H5E_BEGIN_TRY { ret = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); } H5E_END_TRY; if(ret >= 0) TEST_ERROR - /* Create several links, up to limit of compact form */ for(u = 0; u < max_compact; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -13392,10 +12466,9 @@ open_by_idx(hid_t fapl) /* Verify opening objects by index */ if(open_by_idx_check(group_id, soft_group_id, mount_file_id, idx_type, order, u, objno) < 0) TEST_ERROR - /* Create more links, to push group into dense form */ for(; u < (max_compact * 2); u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -13427,7 +12500,6 @@ open_by_idx(hid_t fapl) /* Verify opening objects by index */ if(open_by_idx_check(group_id, soft_group_id, mount_file_id, idx_type, order, u, objno) < 0) TEST_ERROR - /* Close the groups */ if(H5Gclose(group_id) < 0) TEST_ERROR if(H5Gclose(soft_group_id) < 0) TEST_ERROR @@ -13450,7 +12522,7 @@ open_by_idx(hid_t fapl) if(objno) HDfree(objno); - return 0; + return SUCCEED; error: /* Free resources */ @@ -13465,10 +12537,10 @@ error: if(objno) HDfree(objno); - return -1; + return FAIL; } /* end open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: open_by_idx_old * @@ -13477,19 +12549,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Tuesday, November 21, 2006 - * *------------------------------------------------------------------------- */ static int open_by_idx_old(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t mount_file_id = (-1); /* File ID for file to mount */ - hid_t group_id = (-1); /* Group ID */ - hid_t soft_group_id = (-1); /* Group ID for soft links */ + hid_t file_id = -1; /* File ID */ + hid_t mount_file_id = -1; /* File ID for file to mount */ + hid_t group_id = -1; /* Group ID */ + hid_t soft_group_id = -1; /* Group ID for soft links */ H5_iter_order_t order; /* Order within in the index */ H5O_info_t oi; /* Buffer for querying object's info */ char filename[NAME_BUF_SIZE];/* File name */ @@ -13534,10 +12602,9 @@ open_by_idx_old(hid_t fapl) } H5E_END_TRY; if(ret >= 0) TEST_ERROR - /* Create several links */ for(u = 0; u < CORDER_NLINKS; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -13575,7 +12642,6 @@ open_by_idx_old(hid_t fapl) /* Verify opening objects by index */ if(open_by_idx_check(group_id, soft_group_id, mount_file_id, H5_INDEX_NAME, order, u, objno) < 0) TEST_ERROR - /* Close the groups */ if(H5Gclose(group_id) < 0) TEST_ERROR if(H5Gclose(soft_group_id) < 0) TEST_ERROR @@ -13589,7 +12655,7 @@ open_by_idx_old(hid_t fapl) /* Close the file for mounting */ if(H5Fclose(mount_file_id) < 0) TEST_ERROR - return 0; + return SUCCEED; error: /* Free resources */ @@ -13600,10 +12666,10 @@ error: H5Fclose(mount_file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end open_by_idx_old() */ - + /*------------------------------------------------------------------------- * Function: object_info_check * @@ -13611,10 +12677,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Sunday, November 26, 2006 - * *------------------------------------------------------------------------- */ static int @@ -13622,7 +12684,7 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, haddr_t *objno) { char objname[NAME_BUF_SIZE]; /* Object name */ - hid_t group_id = (-1); /* ID of group to test */ + hid_t group_id = -1; /* ID of group to test */ H5O_info_t oinfo; /* Buffer for querying object's info */ unsigned u, v; /* Local index variables */ @@ -13668,13 +12730,13 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, } /* end for */ /* Success */ - return(0); + return SUCCEED; error: - return(-1); + return FAIL; } /* end object_info_check() */ - + /*------------------------------------------------------------------------- * Function: object_info * @@ -13683,21 +12745,17 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Sunday, November 26, 2006 - * *------------------------------------------------------------------------- */ static int object_info(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t soft_group_id = (-1); /* Group ID for soft links */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - hid_t space_id = (-1); /* Dataspace ID (for attributes) */ - H5_index_t idx_type; /* Type of index to operate on */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t soft_group_id = -1; /* Group ID for soft links */ + hid_t gcpl_id = -1; /* Group creation property list ID */ + hid_t space_id = -1; /* Dataspace ID (for attributes) */ + H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ @@ -13795,7 +12853,7 @@ object_info(hid_t fapl) /* Create several links, up to limit of compact form */ for(u = 0; u < max_compact; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ hid_t attr_id; /* Attribute ID */ /* Make name for link */ @@ -13843,7 +12901,7 @@ object_info(hid_t fapl) /* Create more links, to push group into dense form */ for(; u < (max_compact * 2); u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ hid_t attr_id; /* Attribute ID */ /* Make name for link */ @@ -13907,7 +12965,7 @@ object_info(hid_t fapl) if(objno) HDfree(objno); - return 0; + return SUCCEED; error: /* Free resources */ @@ -13922,10 +12980,10 @@ error: if(objno) HDfree(objno); - return -1; + return FAIL; } /* end object_info() */ - + /*------------------------------------------------------------------------- * Function: object_info_old * @@ -13933,19 +12991,15 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Sunday, November 26, 2006 - * *------------------------------------------------------------------------- */ static int object_info_old(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t soft_group_id = (-1); /* Group ID for soft links */ - hid_t space_id = (-1); /* Dataspace ID (for attributes) */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t soft_group_id = -1; /* Group ID for soft links */ + hid_t space_id = -1; /* Dataspace ID (for attributes) */ H5_iter_order_t order; /* Order within in the index */ H5O_info_t oinfo; /* Buffer for querying object's info */ char filename[NAME_BUF_SIZE];/* File name */ @@ -13983,7 +13037,6 @@ object_info_old(hid_t fapl) /* Create old-style group for soft links */ if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - /* Check for out of bound query by index on empty group */ H5E_BEGIN_TRY { ret = H5Oget_info_by_idx2(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); @@ -13992,7 +13045,7 @@ object_info_old(hid_t fapl) /* Create several links */ for(u = 0; u < CORDER_NLINKS; u++) { - hid_t group_id2; /* Group ID */ + hid_t group_id2; /* Group ID */ hid_t attr_id; /* Attribute ID */ /* Make name for link */ @@ -14043,7 +13096,6 @@ object_info_old(hid_t fapl) /* Verify querying objects by name */ if(object_info_check(group_id, soft_group_id, H5_INDEX_NAME, order, u, objno) < 0) TEST_ERROR - /* Close the groups */ if(H5Gclose(group_id) < 0) TEST_ERROR if(H5Gclose(soft_group_id) < 0) TEST_ERROR @@ -14057,7 +13109,7 @@ object_info_old(hid_t fapl) /* Free resources */ if(H5Sclose(space_id) < 0) TEST_ERROR - return 0; + return SUCCEED; error: /* Free resources */ @@ -14068,10 +13120,10 @@ error: H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end object_info_old() */ - + /*------------------------------------------------------------------------- * Function: group_info * @@ -14080,20 +13132,16 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 27, 2006 - * *------------------------------------------------------------------------- */ static int group_info(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t soft_group_id = (-1); /* Group ID for soft links */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t soft_group_id = -1; /* Group ID for soft links */ + hid_t gcpl_id = -1; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ @@ -14175,7 +13223,6 @@ group_info(hid_t fapl) /* Create group with creation order tracking on for soft links */ if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR - /* Check for out of bound query by index on empty group */ H5E_BEGIN_TRY { ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &grp_info, H5P_DEFAULT); @@ -14184,7 +13231,7 @@ group_info(hid_t fapl) /* Create several links, up to limit of compact form */ for(u = 0; u < max_compact; u++) { - hid_t group_id2, group_id3; /* Group IDs */ + hid_t group_id2, group_id3; /* Group IDs */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -14192,7 +13239,6 @@ group_info(hid_t fapl) /* Create hard link, with group object */ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR - /* Retrieve group's information */ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR @@ -14217,7 +13263,6 @@ group_info(hid_t fapl) if(grp_info.max_corder != 0) TEST_ERROR if(grp_info.nlinks != 0) TEST_ERROR - /* Create objects in new group created */ for(v = 0; v <= u; v++) { /* Make name for link */ @@ -14230,7 +13275,6 @@ group_info(hid_t fapl) if(H5Gclose(group_id3) < 0) TEST_ERROR } /* end for */ - /* Retrieve group's information */ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR @@ -14255,7 +13299,6 @@ group_info(hid_t fapl) if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR - /* Retrieve group's information */ if(order != H5_ITER_NATIVE) { if(order == H5_ITER_INC) { @@ -14274,7 +13317,6 @@ group_info(hid_t fapl) /* Close group created */ if(H5Gclose(group_id2) < 0) TEST_ERROR - /* Retrieve main group's information */ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR @@ -14299,7 +13341,6 @@ group_info(hid_t fapl) if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR - /* Create soft link in another group, to objects in main group */ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname); if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -14322,10 +13363,9 @@ group_info(hid_t fapl) } H5E_END_TRY; if(ret >= 0) TEST_ERROR - /* Create more links, to push group into dense form */ for(; u < (max_compact * 2); u++) { - hid_t group_id2, group_id3; /* Group IDs */ + hid_t group_id2, group_id3; /* Group IDs */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -14333,7 +13373,6 @@ group_info(hid_t fapl) /* Create hard link, with group object */ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR - /* Retrieve group's information */ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR @@ -14358,7 +13397,6 @@ group_info(hid_t fapl) if(grp_info.max_corder != 0) TEST_ERROR if(grp_info.nlinks != 0) TEST_ERROR - /* Create objects in new group created */ for(v = 0; v <= u; v++) { /* Make name for link */ @@ -14371,7 +13409,6 @@ group_info(hid_t fapl) if(H5Gclose(group_id3) < 0) TEST_ERROR } /* end for */ - /* Retrieve group's information */ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR @@ -14396,7 +13433,6 @@ group_info(hid_t fapl) if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR - /* Retrieve group's information */ if(order != H5_ITER_NATIVE) { if(order == H5_ITER_INC) { @@ -14415,7 +13451,6 @@ group_info(hid_t fapl) /* Close group created */ if(H5Gclose(group_id2) < 0) TEST_ERROR - /* Retrieve main group's information */ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR @@ -14440,7 +13475,6 @@ group_info(hid_t fapl) if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR - /* Create soft link in another group, to objects in main group */ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname); if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -14463,7 +13497,6 @@ group_info(hid_t fapl) } H5E_END_TRY; if(ret >= 0) TEST_ERROR - /* Close the groups */ if(H5Gclose(group_id) < 0) TEST_ERROR if(H5Gclose(soft_group_id) < 0) TEST_ERROR @@ -14479,7 +13512,7 @@ group_info(hid_t fapl) /* Free resources */ if(H5Pclose(gcpl_id) < 0) TEST_ERROR - return 0; + return SUCCEED; error: /* Free resources */ @@ -14490,10 +13523,10 @@ error: H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end group_info() */ - + /*------------------------------------------------------------------------- * Function: group_info_old * @@ -14502,18 +13535,14 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Monday, November 27, 2006 - * *------------------------------------------------------------------------- */ static int group_info_old(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t soft_group_id = (-1); /* Group ID for soft links */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t soft_group_id = -1; /* Group ID for soft links */ H5_iter_order_t order; /* Order within in the index */ H5G_info_t grp_info; /* Buffer for querying object's info */ char filename[NAME_BUF_SIZE];/* File name */ @@ -14546,7 +13575,6 @@ group_info_old(hid_t fapl) /* Create old-style group for soft links */ if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - /* Check for out of bound query by index on empty group */ H5E_BEGIN_TRY { ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &grp_info, H5P_DEFAULT); @@ -14555,7 +13583,7 @@ group_info_old(hid_t fapl) /* Create several links */ for(u = 0; u < CORDER_NLINKS; u++) { - hid_t group_id2, group_id3; /* Group IDs */ + hid_t group_id2, group_id3; /* Group IDs */ /* Make name for link */ HDsnprintf(objname, sizeof(objname), "filler %02u", u); @@ -14563,7 +13591,6 @@ group_info_old(hid_t fapl) /* Create hard link, with group object */ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - /* Retrieve group's information */ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR @@ -14588,7 +13615,6 @@ group_info_old(hid_t fapl) if(grp_info.max_corder != 0) TEST_ERROR if(grp_info.nlinks != 0) TEST_ERROR - /* Create objects in new group created */ for(v = 0; v <= u; v++) { /* Make name for link */ @@ -14601,7 +13627,6 @@ group_info_old(hid_t fapl) if(H5Gclose(group_id3) < 0) TEST_ERROR } /* end for */ - /* Retrieve group's information */ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR @@ -14626,7 +13651,6 @@ group_info_old(hid_t fapl) if(grp_info.max_corder != 0) TEST_ERROR if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR - /* Retrieve group's information */ if(order != H5_ITER_NATIVE) { if(order == H5_ITER_INC) { @@ -14645,7 +13669,6 @@ group_info_old(hid_t fapl) /* Close group created */ if(H5Gclose(group_id2) < 0) TEST_ERROR - /* Retrieve main group's information */ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR @@ -14670,7 +13693,6 @@ group_info_old(hid_t fapl) if(grp_info.max_corder != 0) TEST_ERROR if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR - /* Create soft link in another group, to objects in main group */ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname); if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -14699,7 +13721,6 @@ group_info_old(hid_t fapl) } H5E_END_TRY; if(ret >= 0) TEST_ERROR - /* Close the groups */ if(H5Gclose(group_id) < 0) TEST_ERROR if(H5Gclose(soft_group_id) < 0) TEST_ERROR @@ -14710,7 +13731,7 @@ group_info_old(hid_t fapl) PASSED(); } /* end for */ - return 0; + return SUCCEED; error: /* Free resources */ @@ -14720,10 +13741,10 @@ error: H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end group_info_old() */ - + /*------------------------------------------------------------------------- * Function: timestamps * @@ -14732,20 +13753,16 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Quincey Koziol - * Saturday, March 3, 2007 - * *------------------------------------------------------------------------- */ static int timestamps(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t group_id2 = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - hid_t gcpl_id2 = (-1); /* Group creation property list ID */ + hid_t file_id = -1; /* File ID */ + hid_t group_id = -1; /* Group ID */ + hid_t group_id2 = -1; /* Group ID */ + hid_t gcpl_id = -1; /* Group creation property list ID */ + hid_t gcpl_id2 = -1; /* Group creation property list ID */ H5O_info_t oinfo, oinfo2; /* Object info for groups created */ char filename[NAME_BUF_SIZE];/* File name */ hbool_t track_times; /* The object timestamp setting */ @@ -14771,7 +13788,6 @@ timestamps(hid_t fapl) /* Check default timestamp information */ if(track_times != FALSE) TEST_ERROR - /* Create file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -14824,7 +13840,6 @@ timestamps(hid_t fapl) /* Close the file */ if(H5Fclose(file_id) < 0) TEST_ERROR - /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -14873,7 +13888,7 @@ timestamps(hid_t fapl) PASSED(); - return 0; + return SUCCEED; error: /* Free resources */ @@ -14883,32 +13898,26 @@ error: H5Fclose(file_id); } H5E_END_TRY; - return -1; + return FAIL; } /* end timestamps() */ - + /*------------------------------------------------------------------------- - * Function: main - * - * Purpose: Test links - * - * Return: Success: exit(EXIT_SUCCESS) - * - * Failure: exit(EXIT_FAILURE) + * Function: main * - * Programmer: Robb Matzke - * Friday, August 14, 1998 + * Purpose: Test links * + * Return: EXIT_SUCCESS/EXIT_FAILURE *------------------------------------------------------------------------- */ int main(void) { - hid_t fapl, fapl2; /* File access property lists */ - int nerrors = 0; - unsigned new_format; /* Whether to use the new format or not */ - unsigned minimize_dset_oh; - unsigned efc; /* Whether to use the external file cache */ + hid_t fapl = -1, fapl2 = -1; /* File access property lists */ + int nerrors = 0; + unsigned new_format; /* Whether to use the new format or not */ + unsigned minimize_dset_oh; + unsigned efc; /* Whether to use the external file cache */ const char *env_h5_drvr; /* File Driver value from environment */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -14927,7 +13936,8 @@ main(void) HDprintf("\n-Testing with minimzed dataset object headers-\n"); dcpl_g = H5Pcreate(H5P_DATASET_CREATE); if (0 > dcpl_g) TEST_ERROR - } else { + } + else { HDprintf("\n-Testing with unminimzed dataset object headers-\n"); dcpl_g = H5P_DEFAULT; } @@ -14939,14 +13949,14 @@ main(void) if(new_format) { my_fapl = fapl2; HDprintf("\n--Testing with 'new format'--\n"); - } else { + } + else { my_fapl = fapl; HDprintf("\n--Testing with 'old format'--\n"); } /* always enter tests without external cache */ - if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) - TEST_ERROR + if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) TEST_ERROR /* General tests... (on both old & new format groups */ nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0; @@ -14966,29 +13976,28 @@ main(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* tests for external link */ - /* Test external file cache first, so it sees the default efc setting on - * the fapl */ + /* Test external file cache first, so it sees the default efc setting on the fapl + */ nerrors += external_file_cache(my_fapl, new_format) < 0 ? 1 : 0; /* This test cannot run with the EFC because it assumes that an - * intermediate file is not held open */ + * intermediate file is not held open + */ nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0; /* This test cannot run with the EFC because the EFC cannot currently - * reopen a cached file with a different intent */ + * reopen a cached file with a different intent + */ nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0; - /* Try external link tests both with and without the external file cache - */ + /* Try external link tests both with and without the external file cache */ for(efc = FALSE; efc <= TRUE; efc++) { if(efc) { - if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0) - TEST_ERROR + if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0) TEST_ERROR HDprintf("\n---Testing with external file cache---\n"); } /* end if */ else { - if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) - TEST_ERROR + if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) TEST_ERROR HDprintf("\n---Testing without external file cache---\n"); } /* end else */ @@ -15035,7 +14044,7 @@ main(void) nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0; } /* with/without external file cache */ /* These tests assume that external links are a form of UD links, @@ -15070,9 +14079,9 @@ main(void) nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0; /* XXX: when creation order indexing is fully working, go back and add checks -* to these tests to make certain that the creation order values are -* correct. -*/ + * to these tests to make certain that the creation order values are + * correct. + */ nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0; nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0; nerrors += corder_transition(fapl2) < 0 ? 1 : 0; @@ -15094,8 +14103,7 @@ main(void) nerrors += group_info_old(fapl) < 0 ? 1 : 0; if (minimize_dset_oh) { - if (H5Pclose(dcpl_g) < 0) - TEST_ERROR; + if (H5Pclose(dcpl_g) < 0) TEST_ERROR; dcpl_g = -1; } } /* [un]minimized dataset object headers */ @@ -15115,8 +14123,7 @@ main(void) /* Results */ if(nerrors) { - HDprintf("***** %d LINK TEST%s FAILED! *****\n", - nerrors, 1 == nerrors ? "" : "S"); + HDprintf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); HDexit(EXIT_FAILURE); } HDprintf("All link tests passed.\n"); @@ -15125,14 +14132,14 @@ main(void) HDremove(SYMLINK1); HDremove(SYMLINK2); - /* clean up tmp directory created by external link tests */ + /* clean up tmp_links and tmp2_links directory created by external link tests */ HDrmdir(TMPDIR); HDrmdir(TMPDIR2); - return 0; + HDexit(EXIT_SUCCESS); error: HDputs("*** TESTS FAILED ***"); - return 1; + HDexit(EXIT_FAILURE); } diff --git a/test/links_env.c b/test/links_env.c index 0cd690a..efb8cfd 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -12,39 +12,39 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Purpose: Tests hard, soft (symbolic) & external links. + * Purpose: Tests hard, soft (symbolic) & external links. */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING #include "h5test.h" -#include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ -#define TMPDIR "tmp/" +#define TMPDIR "tmp_links_env/" #define NAME_BUF_SIZE 1024 const char *FILENAME[] = { - "extlinks_env0", /* 0: main file */ - "extlinks_env1", /* 1: target file */ + "extlinks_env0", /* 0: main file */ + "extlinks_env1", /* 1: target file */ TMPDIR "extlinks_env1", /* 2 */ NULL }; static int external_link_env(hid_t fapl, hbool_t new_format); - + /*------------------------------------------------------------------------- * Function: external_link_env (moved from links.c) * - * Purpose: Verify that the target file is found successfully in "tmp" directory - * via searching the pathnames set in the environment variable HDF5_EXT_PREFIX. - * 1. Target link: "extlinks_env1" - * 2. Main file: "extlinks_env0" - * 3. Target file is created in: "tmp/extlinks_env1" - * 4. The environment variable "HDF5_EXT_PREFIX" is set to ".:tmp" + * Purpose: Verify that the target file is found successfully in "tmp_links_env" directory + * via searching the pathnames set in the environment variable HDF5_EXT_PREFIX. + * 1. Target link: "extlinks_env1" + * 2. Main file: "extlinks_env0" + * 3. Target file is created in: "tmp_links_env/extlinks_env1" + * 4. The environment variable "HDF5_EXT_PREFIX" is set to ".:tmp_links_env" * * Return: Success: 0 * Failure: -1 @@ -59,12 +59,12 @@ static int external_link_env(hid_t fapl, hbool_t new_format); static int external_link_env(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - const char *envval = NULL; /* Pointer to environment variable */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], - filename3[NAME_BUF_SIZE]; /* Holders for filename */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group IDs */ + const char *envval = NULL; /* Pointer to environment variable */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], + filename3[NAME_BUF_SIZE]; /* Holders for filename */ if(new_format) TESTING("external links via environment variable (w/new group format)") @@ -73,7 +73,7 @@ external_link_env(hid_t fapl, hbool_t new_format) if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL) envval = "nomatch"; - if (HDstrcmp(envval, ".:tmp")) TEST_ERROR + if (HDstrcmp(envval, ".:tmp_links_env")) TEST_ERROR /* Set up name for main file:"extlinks_env0" */ h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); @@ -81,14 +81,14 @@ external_link_env(hid_t fapl, hbool_t new_format) /* Set up name for external linked target file: "extlinks_env1" */ h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - /* Create "tmp" directory */ + /* Create "tmp_links_env" directory */ if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR + TEST_ERROR - /* Set up name (location) for the target file: "tmp/extlinks1" */ + /* Set up name (location) for the target file: "tmp_links_env/extlinks1" */ h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); - /* Create the target file in "tmp" directory */ + /* Create the target file in "tmp_links_env" directory */ if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -110,9 +110,9 @@ external_link_env(hid_t fapl, hbool_t new_format) /* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */ if (gid < 0) { - H5_FAILED(); - puts(" Should have found the file in tmp directory."); - goto error; + H5_FAILED(); + puts(" Should have found the file in tmp_links_env directory."); + goto error; } /* closing for main file */ @@ -124,30 +124,29 @@ external_link_env(hid_t fapl, hbool_t new_format) error: H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; return -1; } /* end external_link_env() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test external link with environment variable HDF5_EXT_PREFIX + * Purpose: Test external link with environment variable HDF5_EXT_PREFIX * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * - * Programmer: Vailin Choi; Nov 2010 + * Programmer: Vailin Choi; Nov 2010 * *------------------------------------------------------------------------- */ int main(void) { - hid_t fapl; /* File access property lists */ - int nerrors = 0; /* Error from tests */ + hid_t fapl; /* File access property lists */ + int nerrors = 0; /* Error from tests */ h5_reset(); fapl = h5_fileaccess(); @@ -172,12 +171,13 @@ main(void) } HDprintf("All external Link (HDF5_EXT_PREFIX) tests passed.\n"); - /* clean up tmp directory created by external link tests */ + /* clean up tmp_links_env directory created by external link tests */ HDrmdir(TMPDIR); - return 0; + HDexit(EXIT_SUCCESS); error: HDputs("*** TESTS FAILED ***"); - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ + @@ -13,23 +13,23 @@ /* * Tests for file memory management consist of 3 parts: - * test_mf_eoa_*() tests for file meomory that interact with file allocation - * test_mf_fs_*() tests for file memory that interact with the free-space manager - * test_mf_aggr_*() tests for file memory that interact with the aggregators - * test_mf_align_*() tests for file memory with alignment setting - * test_filespace_*() tests for file space management - * test_page_*() tests for file space paging + * test_mf_eoa_*() tests for file meomory that interact with file allocation + * test_mf_fs_*() tests for file memory that interact with the free-space manager + * test_mf_aggr_*() tests for file memory that interact with the aggregators + * test_mf_align_*() tests for file memory with alignment setting + * test_filespace_*() tests for file space management + * test_page_*() tests for file space paging */ #include "h5test.h" -#define H5MF_FRIEND /*suppress error about including H5MFpkg */ +#define H5MF_FRIEND /*suppress error about including H5MFpkg */ #include "H5MFpkg.h" -#define H5FS_FRIEND /*suppress error about including H5FSpkg */ +#define H5FS_FRIEND /*suppress error about including H5FSpkg */ #include "H5FSpkg.h" -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" @@ -138,7 +138,7 @@ static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl); static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl); static unsigned test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); -static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); +static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); @@ -212,15 +212,15 @@ error: static unsigned test_mf_eoa(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr1, addr2; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MM_alloc() of file allocation"); @@ -321,8 +321,8 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + SKIPPED(); + HDputs(" Current VFD doesn't support continuous address space"); } /* end else */ return(0); @@ -330,7 +330,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_eoa() */ @@ -340,32 +340,32 @@ error: * To verify that an allocated block from file allocation is shrunk. * * Set up: - * Turn off using meta/small data aggregator - * There is nothing in free-space manager - * - * Test 1: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 30 : succeed - * Test 2: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 20 : fail - * Test 3: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 40 : fail - * Test 4: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 20 from the end: succeed + * Turn off using meta/small data aggregator + * There is nothing in free-space manager + * + * Test 1: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 30 : succeed + * Test 2: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 20 : fail + * Test 3: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 40 : fail + * Test 4: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 20 from the end: succeed * *------------------------------------------------------------------------- */ static unsigned test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size = 0, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr = 0; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; + H5FD_mem_t type; + haddr_t addr = 0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_shrink() of file allocation: test 1"); @@ -463,8 +463,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of file allocation: test 2"); @@ -511,8 +511,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ @@ -555,8 +555,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of file allocation: test 4"); @@ -603,8 +603,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); @@ -612,7 +612,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_eoa_shrink() */ @@ -622,29 +622,29 @@ error: * To verify that an allocated block from file allocation is extended. * * Set up: - * Turn off using meta/small data aggregator - * There is nothing in free-space manager + * Turn off using meta/small data aggregator + * There is nothing in free-space manager * * Test 1: Allocate a block of 30 - * H5MF_try_extend() the block of size 30 by 50: succeed + * H5MF_try_extend() the block of size 30 by 50: succeed * * Test 2: Allocate a block of 30 - * H5MF_try_extend() the block of size 20 by 50: fail + * H5MF_try_extend() the block of size 20 by 50: fail *------------------------------------------------------------------------- */ static unsigned test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* File size */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* File size */ H5FD_mem_t type; - haddr_t addr; + haddr_t addr; htri_t was_extended; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_extend() of file allocation: test 1"); @@ -741,8 +741,8 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_extend() of file allocation: test 2"); @@ -804,8 +804,8 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); @@ -813,7 +813,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_eoa_extend() */ @@ -823,7 +823,7 @@ error: * To verify that temporary blocks are allocated correctly * * Set up: - * There is nothing in free-space manager + * There is nothing in free-space manager * * Tests: * Allocate a reasonable-sized temporary block @@ -855,13 +855,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Can't run this test with multi-file VFDs */ if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ haddr_t maxaddr; /* File's max. address */ - haddr_t tmp_addr; /* Temporary space file address */ - haddr_t norm_addr; /* Normal space file address */ - haddr_t check_addr; /* File address for checking for errors */ + haddr_t tmp_addr; /* Temporary space file address */ + haddr_t norm_addr; /* Normal space file address */ + haddr_t check_addr; /* File address for checking for errors */ unsigned char buf = 0; /* Buffer to read/write with */ herr_t status; /* Generic status value */ @@ -1002,15 +1002,15 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + SKIPPED(); + HDputs(" Current VFD doesn't support continuous address space"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_tmp() */ @@ -1020,16 +1020,16 @@ error: * To verify that the free-space manager is created or opened * * Set up: - * Turn off using meta/small data aggregator + * Turn off using meta/small data aggregator *------------------------------------------------------------------------- */ static unsigned test_mf_fs_start(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ H5FS_stat_t state; @@ -1088,7 +1088,7 @@ test_mf_fs_start(hid_t fapl) /* Verify the file is the correct size */ if(new_file_size != file_size) - TEST_ERROR + TEST_ERROR if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR @@ -1100,7 +1100,7 @@ test_mf_fs_start(hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_start() */ @@ -1111,36 +1111,36 @@ error: * To verify that a block is allocated/freed from/to the free-space manager * * Set up: - * Turn off using meta/small data aggregator + * Turn off using meta/small data aggregator * * Test 1: - * Add section A to free-space manager (addr=70, size=30) - * Allocate a block of size=30 - * The returned space's address should be same as section A's address - * Deallocate the block which will be returned to the free-space manager + * Add section A to free-space manager (addr=70, size=30) + * Allocate a block of size=30 + * The returned space's address should be same as section A's address + * Deallocate the block which will be returned to the free-space manager * Test 2: - * Add section A to free-space manager (addr=70, size=30) - * Allocate a block of size=20 - * The returned space's address should be same as section A's address - * There should still be space of 10 left in the free-space manager - * Deallocate the block which will be returned to free-space manager + * Add section A to free-space manager (addr=70, size=30) + * Allocate a block of size=20 + * The returned space's address should be same as section A's address + * There should still be space of 10 left in the free-space manager + * Deallocate the block which will be returned to free-space manager * Test 3: - * Add section A to free-space manager (addr=70, size=30) - * Allocate a block of size=40 - * The free-space manager is unable to fulfill the request - * The block is allocated from file allocation - * Deallocate the block which will be returned to free-space manager - * (the space is shrunk and freed since it is at end of file) + * Add section A to free-space manager (addr=70, size=30) + * Allocate a block of size=40 + * The free-space manager is unable to fulfill the request + * The block is allocated from file allocation + * Deallocate the block which will be returned to free-space manager + * (the space is shrunk and freed since it is at end of file) *------------------------------------------------------------------------- */ static unsigned test_mf_fs_alloc_free(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* file size */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* file size */ H5MF_free_section_t *sect_node = NULL; haddr_t addr; haddr_t tmp; @@ -1206,7 +1206,7 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify that the allocated block is section A in free-space */ if(addr != TBLOCK_ADDR70) - TEST_ERROR + TEST_ERROR state.tot_space -= TBLOCK_SIZE30; state.tot_sect_count -= 1; @@ -1240,7 +1240,7 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR PASSED() @@ -1283,7 +1283,7 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) - TEST_ERROR + TEST_ERROR /* should still have 1 section of size 10 left in free-space manager */ state.tot_space -= (TBLOCK_SIZE20); @@ -1315,7 +1315,7 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR PASSED() @@ -1400,7 +1400,7 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify the file is the correct size */ if(new_file_size != file_size) - TEST_ERROR + TEST_ERROR if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR @@ -1412,7 +1412,7 @@ test_mf_fs_alloc_free(hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_alloc_free() */ @@ -1423,47 +1423,47 @@ error: * To verify that a block allocated from the free-space manager can be extended * * Set up: - * Turn off using meta/small data aggregator + * Turn off using meta/small data aggregator * * Test 1: - * Add section A to free-space manager: addr=70, size=30 - * Allocate a block of size 30 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by requested-size=50 - * Succeed: section A adjoins section B (70+30=100 which is section B's address) and - * requested-size (50) is equal to the size of section B + * Add section A to free-space manager: addr=70, size=30 + * Allocate a block of size 30 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by requested-size=50 + * Succeed: section A adjoins section B (70+30=100 which is section B's address) and + * requested-size (50) is equal to the size of section B * Test 2: - * Add section A to free-space manager: addr=70, size=30 - * Allocate a block of size 30 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by requested-size=60 - * Fail: section A adjoins section B (70+30=100 which is section B's address) but - * requested-size (60) > size of section B (50) + * Add section A to free-space manager: addr=70, size=30 + * Allocate a block of size 30 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by requested-size=60 + * Fail: section A adjoins section B (70+30=100 which is section B's address) but + * requested-size (60) > size of section B (50) * * Test 3: - * Add section A to free-space manager: addr=70, size=30 - * Allocate a block of size 30 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by requested-size=40 - * Succeed: section A adjoins section B (70+30=100 which is section B's address) and - * requested-size (40) < size of section B (50), therefore, - * a section of 10 is left in the free-space manager + * Add section A to free-space manager: addr=70, size=30 + * Allocate a block of size 30 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by requested-size=40 + * Succeed: section A adjoins section B (70+30=100 which is section B's address) and + * requested-size (40) < size of section B (50), therefore, + * a section of 10 is left in the free-space manager * Test 4: - * Add section A to free-space manager: addr=70, size=20 - * Allocate a block of size 20 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by 50 from the free-space_manager: - * Fail: section A does not adjoin section B (70+20 != address of section B) even though - * the requested-size (50) equal to size of section B (50) + * Add section A to free-space manager: addr=70, size=20 + * Allocate a block of size 20 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by 50 from the free-space_manager: + * Fail: section A does not adjoin section B (70+20 != address of section B) even though + * the requested-size (50) equal to size of section B (50) *------------------------------------------------------------------------- */ static unsigned test_mf_fs_extend(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ H5MF_free_section_t *sect_node1 = NULL, *sect_node2=NULL; haddr_t addr; @@ -1559,7 +1559,7 @@ test_mf_fs_extend(hid_t fapl) /* should succeed */ if(was_extended <= 0) - TEST_ERROR + TEST_ERROR /* Section B is removed from free-space manager */ state.tot_space -= TBLOCK_SIZE50; @@ -1586,7 +1586,7 @@ test_mf_fs_extend(hid_t fapl) if(tmp != TBLOCK_ADDR70) TEST_ERROR - + if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -1596,7 +1596,7 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR PASSED() @@ -1667,7 +1667,7 @@ test_mf_fs_extend(hid_t fapl) /* Should not be able to extend the allocated block */ if(was_extended) - TEST_ERROR + TEST_ERROR /* free-space info should remain the same */ if(check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state)) @@ -1698,7 +1698,7 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR PASSED() @@ -1769,7 +1769,7 @@ test_mf_fs_extend(hid_t fapl) /* Should succeed in extending the allocated block */ if(was_extended <=0) - TEST_ERROR + TEST_ERROR /* Should have 1 section of size=10 left in free-space manager */ state.tot_space -= (TBLOCK_SIZE40); @@ -1788,7 +1788,7 @@ test_mf_fs_extend(hid_t fapl) /* Remove the merged sections A & B from free-space */ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR - + if(tmp != addr) TEST_ERROR if(H5Fclose(file) < 0) @@ -1800,7 +1800,7 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR PASSED() @@ -1871,7 +1871,7 @@ test_mf_fs_extend(hid_t fapl) /* Should not succeed in extending the allocated block */ if(was_extended) - TEST_ERROR + TEST_ERROR /* Free-space info should be the same */ if(check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state)) @@ -1906,7 +1906,7 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if(new_file_size != file_size) - TEST_ERROR + TEST_ERROR if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR @@ -1918,7 +1918,7 @@ test_mf_fs_extend(hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_extend() */ @@ -1927,26 +1927,26 @@ error: *------------------------------------------------------------------------- * To verify that an aggregator is absorbed into a section. * - * Test 1: To aborb the aggregator onto the beginning of the section - * Allocate block A from meta_aggr - * Create a free-space section node with an address that adjoins - * the end of meta_aggr and a size to make the aggregator - * get absorbed into the section. - * The adding of the section to free-space will call H5MF_aggr_absorb(), - * which will absorb meta_aggr to the section: - * section size + remaining size of aggregator is > aggr->alloc_size, - * section is allowed to absorb an aggregator (allow_sect_absorb is true) - * - * Test 2: To absorb the aggregator onto the end of the section - * Allocate block A from meta_aggr - * Allocate block B from sdata_aggr - * Create a free-space section node with an address that adjoins - * the beginning of meta_aggr and a size to make the - * aggregator get absorbed into the section. - * The adding of the section to free-space will call H5MF_aggr_absorb(), - * which will absorb meta_aggr to the section: - * section size + remaining size of aggregator is > aggr->alloc_size, - * section is allowed to absorb an aggregator (allow_sect_absorb is true) + * Test 1: To aborb the aggregator onto the beginning of the section + * Allocate block A from meta_aggr + * Create a free-space section node with an address that adjoins + * the end of meta_aggr and a size to make the aggregator + * get absorbed into the section. + * The adding of the section to free-space will call H5MF_aggr_absorb(), + * which will absorb meta_aggr to the section: + * section size + remaining size of aggregator is > aggr->alloc_size, + * section is allowed to absorb an aggregator (allow_sect_absorb is true) + * + * Test 2: To absorb the aggregator onto the end of the section + * Allocate block A from meta_aggr + * Allocate block B from sdata_aggr + * Create a free-space section node with an address that adjoins + * the beginning of meta_aggr and a size to make the + * aggregator get absorbed into the section. + * The adding of the section to free-space will call H5MF_aggr_absorb(), + * which will absorb meta_aggr to the section: + * section size + remaining size of aggregator is > aggr->alloc_size, + * section is allowed to absorb an aggregator (allow_sect_absorb is true) *------------------------------------------------------------------------- */ static unsigned @@ -1960,7 +1960,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) haddr_t ma_addr=HADDR_UNDEF; hsize_t ma_size=0; H5MF_free_section_t *sect_node=NULL; - hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ + hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("A free-space section absorbs an aggregator: test 1"); @@ -2026,8 +2026,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("A free-space section absorbs an aggregator: test 2"); @@ -2069,7 +2069,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR - if((tmp + TBLOCK_SIZE30) != ma_addr) + if((tmp + TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* restore info to meta_aggr */ @@ -2087,15 +2087,15 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_absorb() */ @@ -2104,32 +2104,32 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * The first block of 30 is allocated from meta_aggr - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from meta_aggr - * There is space of 1968 left in meta_aggr + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * The first block of 30 is allocated from meta_aggr + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from meta_aggr + * There is space of 1968 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ hid_t fcpl; /* File creation property list */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr1, addr2; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 1"); @@ -2229,15 +2229,15 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); } H5E_END_TRY; return(1); @@ -2247,38 +2247,38 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr - * - * Allocate third block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and is >= meta_aggr->alloc_size - * meta_aggr is at EOA - * Result: - * A block of request-size is extended via file allocation and is merged with meta_aggr - * The block of 2058 is allocated out of meta_aggr - * There is space of 1968 left in meta_aggr + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr + * + * Allocate third block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and is >= meta_aggr->alloc_size + * meta_aggr is at EOA + * Result: + * A block of request-size is extended via file allocation and is merged with meta_aggr + * The block of 2058 is allocated out of meta_aggr + * There is space of 1968 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr1, addr2, addr3; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 2"); @@ -2371,15 +2371,15 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc2() */ @@ -2388,53 +2388,53 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr : (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in other_aggr and is < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * There is space of 2018 left in sdata_aggr - * - * Allocate the third block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: A block of request-size is obtained via file allocation - * The new block's address is returned - * Nothing is changed in meta_aggr and sdata_aggr - * - * Allocate fourth block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * The fourth block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr + * Allocate first block (30) from meta_aggr : (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in other_aggr and is < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * There is space of 2018 left in sdata_aggr + * + * Allocate the third block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: A block of request-size is obtained via file allocation + * The new block's address is returned + * Nothing is changed in meta_aggr and sdata_aggr + * + * Allocate fourth block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * The fourth block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, addr4, saddr1; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; - haddr_t sdata_addr=HADDR_UNDEF; - hsize_t sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, addr4, saddr1; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; + haddr_t sdata_addr=HADDR_UNDEF; + hsize_t sdata_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator: test 3"); @@ -2531,15 +2531,15 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc3() */ @@ -2549,55 +2549,55 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * There is space of 2018 left in meta_aggr - * The first block of 30 is allocated from there - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * - * Allocate the second block (2018) from sdata_aggr: - * request-size is <= what is left in sdata_aggr and < sdata_aggr->alloc_size - * request-size is < sdata_aggr->alloc_size - * Result: - * The block is allocated from what is left in sdata_aggr (all used up) - * - * Allocate third block (50) from sdata_aggr : - * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is extended via file allocation - * The third block of 50 is allocated from there - * There is space of 1998 left in the sdata_aggr - * - * Allocate second block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * unused spaced in sdata_aggr is freed to free-space and is shrunk - * sdata_aggr is reset to 0 - * A block of request-size is obtained via file allocation - * The new block's address is returned - * The block does not adjoin meta_aggr - * meta_aggr's info is unchanged + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * There is space of 2018 left in meta_aggr + * The first block of 30 is allocated from there + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * + * Allocate the second block (2018) from sdata_aggr: + * request-size is <= what is left in sdata_aggr and < sdata_aggr->alloc_size + * request-size is < sdata_aggr->alloc_size + * Result: + * The block is allocated from what is left in sdata_aggr (all used up) + * + * Allocate third block (50) from sdata_aggr : + * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is extended via file allocation + * The third block of 50 is allocated from there + * There is space of 1998 left in the sdata_aggr + * + * Allocate second block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * unused spaced in sdata_aggr is freed to free-space and is shrunk + * sdata_aggr is reset to 0 + * A block of request-size is obtained via file allocation + * The new block's address is returned + * The block does not adjoin meta_aggr + * meta_aggr's info is unchanged *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* File size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, saddr1, saddr2, saddr3; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, saddr1, saddr2, saddr3; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 4"); @@ -2698,15 +2698,15 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc4() */ @@ -2715,37 +2715,37 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocate from there + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocate from there * - * Allocate second block (50) from meta_aggr: - * request-size is < what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left there - * There is space of 1968 left in the meta_aggr + * Allocate second block (50) from meta_aggr: + * request-size is < what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left there + * There is space of 1968 left in the meta_aggr * - * Allocate third block (1970) from meta_aggr: - * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size - * Result: A block of meta_aggr->alloc_size is extended via file allocation and is absorbed into the meta_aggr - * The block of 1970 is allocated from there - * There is space of 2046 left in meta_aggr + * Allocate third block (1970) from meta_aggr: + * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size + * Result: A block of meta_aggr->alloc_size is extended via file allocation and is absorbed into the meta_aggr + * The block of 1970 is allocated from there + * There is space of 2046 left in meta_aggr * *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* File size */ - H5FD_mem_t type; - haddr_t addr1, addr2, addr3; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 5"); @@ -2821,15 +2821,15 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc5() */ @@ -2838,47 +2838,47 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in sdata_aggr and is < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * There is space of 2018 left in sdata_aggr - * - * Allocate third block (1970) from meta_aggr: - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation. - * The block does not adjoin meta_aggr - * sdata_aggr is untouched - * meta_aggr's unused space of [880, 1968] is freed to free-space - * meta_aggr is updated to point to the new block + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in sdata_aggr and is < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * There is space of 2018 left in sdata_aggr + * + * Allocate third block (1970) from meta_aggr: + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation. + * The block does not adjoin meta_aggr + * sdata_aggr is untouched + * meta_aggr's unused space of [880, 1968] is freed to free-space + * meta_aggr is updated to point to the new block *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; H5FS_stat_t state; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -2977,15 +2977,15 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc6() */ @@ -3000,52 +3000,52 @@ error: * A block of meta_aggr->alloc_size is obtained via file allocation * The first block of 30 is allocated from there * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in the aggregator - * There is space of 1968 left in the meta_aggr - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocate from there - * - * Allocate second block (2018) from sdata_aggr: - * request-size is <= what is left in sdata_aggr and is < sdata_aggr->alloc_size - * Result: - * The second block of 2018 is allocated from what is left in sdata_aggr (all used up) - * - * Allocate third block (50) from sdata_aggr: - * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is extended via file allocation - * The third block of 50 is allocated from there - * - * Allocate third block (1970) from meta_aggr: - * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * unused space in sdata_aggr is freed to free-space and is shrunk - * sdata_aggr is reset to 0 - * A block of meta_aggr->alloc_size is obtained via file allocation - * The block does not adjoin meta_aggr - * meta_aggr's unused space of [880, 1968] is freed to free-space - * meta_aggr is updated to point to the new block + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in the aggregator + * There is space of 1968 left in the meta_aggr + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocate from there + * + * Allocate second block (2018) from sdata_aggr: + * request-size is <= what is left in sdata_aggr and is < sdata_aggr->alloc_size + * Result: + * The second block of 2018 is allocated from what is left in sdata_aggr (all used up) + * + * Allocate third block (50) from sdata_aggr: + * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is extended via file allocation + * The third block of 50 is allocated from there + * + * Allocate third block (1970) from meta_aggr: + * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * unused space in sdata_aggr is freed to free-space and is shrunk + * sdata_aggr is reset to 0 + * A block of meta_aggr->alloc_size is obtained via file allocation + * The block does not adjoin meta_aggr + * meta_aggr's unused space of [880, 1968] is freed to free-space + * meta_aggr is updated to point to the new block *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size, file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1, saddr2, saddr3; - haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1, saddr2, saddr3; + haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, sdata_size=0; H5FS_stat_t state; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -3161,15 +3161,15 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc7() */ @@ -3178,38 +3178,38 @@ error: *------------------------------------------------------------------------- * To verify that a block can be extended from the aggregator * - * Test 1: Allocate block A from meta_aggr which is at end of file - * Try to extend the block which adjoins the aggregator that is at end of file - * a. block size < (% * aggr->alloc_size) - * The block is allocated from the aggregator - * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size - * The block is extended by aggr->alloc_size and the block is allocated from the aggregator - * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size - * The block is extended by extended-request and the block is allocated from the aggregator - * - * Test 2: Allocate block A from meta_aggr - * Allocate block B from sdata_aggr so that meta_aggr is not at end of file - * Try to extend a block which adjoins meta_aggr and meta_aggr can fulfill the extended-request - * H5MF_try_extend() succeeds: the block is extended into the aggregator - * - * Test 3: Allocate block A from meta_aggr - * Allocate block B from sdata_aggr so that meta_aggr is not at end of file - * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request - * H5MF_try_extend() fails + * Test 1: Allocate block A from meta_aggr which is at end of file + * Try to extend the block which adjoins the aggregator that is at end of file + * a. block size < (% * aggr->alloc_size) + * The block is allocated from the aggregator + * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size + * The block is extended by aggr->alloc_size and the block is allocated from the aggregator + * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size + * The block is extended by extended-request and the block is allocated from the aggregator + * + * Test 2: Allocate block A from meta_aggr + * Allocate block B from sdata_aggr so that meta_aggr is not at end of file + * Try to extend a block which adjoins meta_aggr and meta_aggr can fulfill the extended-request + * H5MF_try_extend() succeeds: the block is extended into the aggregator + * + * Test 3: Allocate block A from meta_aggr + * Allocate block B from sdata_aggr so that meta_aggr is not at end of file + * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request + * H5MF_try_extend() fails *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size = 0, file_size; - H5FD_mem_t type, stype; - haddr_t new_addr, addr, saddr; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; - htri_t was_extended; + H5FD_mem_t type, stype; + haddr_t new_addr, addr, saddr; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + htri_t was_extended; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1"); @@ -3315,8 +3315,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_extend() of meta/sdata aggregator: test 2"); @@ -3385,8 +3385,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_extend() of meta/sdata aggregator: test 3"); @@ -3453,15 +3453,15 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_extend() */ @@ -3472,35 +3472,35 @@ error: * * MF_try_shrink() only allows blocks to be absorbed into an aggregator * - * Test 1: H5MF_alloc() block A from meta_aggr - * H5MF_try_shrink() block A should merge it back into meta_aggr - * since block A adjoins the beginning of meta_aggr + * Test 1: H5MF_alloc() block A from meta_aggr + * H5MF_try_shrink() block A should merge it back into meta_aggr + * since block A adjoins the beginning of meta_aggr * - * Test 2: H5MF_alloc() block A from meta_aggr - * H5MF_alloc() block B from sdata_aggr - * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr - * because sec2 driver is FLMAP_DICHOTOMY by default + * Test 2: H5MF_alloc() block A from meta_aggr + * H5MF_alloc() block B from sdata_aggr + * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr + * because sec2 driver is FLMAP_DICHOTOMY by default * - * Test 3: H5MF_alloc() block A from meta_aggr - * H5MF_alloc() block B from meta_aggr - * H5MF_alloc() block C from meta_aggr - * H5MF_try_shrink() block B should fail since it does not adjoin the - * beginning nor the end of meta_aggr + * Test 3: H5MF_alloc() block A from meta_aggr + * H5MF_alloc() block B from meta_aggr + * H5MF_alloc() block C from meta_aggr + * H5MF_try_shrink() block B should fail since it does not adjoin the + * beginning nor the end of meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size = 0, file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - haddr_t new_sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; - hsize_t sdata_size=0, new_sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + haddr_t new_sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; + hsize_t sdata_size=0, new_sdata_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1"); @@ -3562,8 +3562,8 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 2"); @@ -3621,8 +3621,8 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 3"); @@ -3683,15 +3683,15 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_absorb() */ @@ -3703,46 +3703,46 @@ error: * Alignment = 1024 or 4096 * * Test 1: - * Turn off using metadata aggregator - * Allocate a block of 30 which should be from file allocation - * Result: - * The return address should be aligned - * A fragment [800, 224] or [800, 3296] is freed to free-space - * EOA is 1054 or 4126 - * - * Allocate a block of 50 which should be from file allocation - * Result: - * The return address should be aligned - * A fragment [1054, 994] or [4126, 4066] is freed to free-space - * EOA is 2098 or 8242 + * Turn off using metadata aggregator + * Allocate a block of 30 which should be from file allocation + * Result: + * The return address should be aligned + * A fragment [800, 224] or [800, 3296] is freed to free-space + * EOA is 1054 or 4126 + * + * Allocate a block of 50 which should be from file allocation + * Result: + * The return address should be aligned + * A fragment [1054, 994] or [4126, 4066] is freed to free-space + * EOA is 2098 or 8242 * Test 2: - * Turn off using metadata aggregator - * Allocate a block which should be from file allocation - * The return address should be aligned - * H5MF_try_shrink() the block with aligned address should succeed + * Turn off using metadata aggregator + * Allocate a block which should be from file allocation + * The return address should be aligned + * H5MF_try_shrink() the block with aligned address should succeed * * Test 3: - * Turn off using metadata aggregator - * Allocate a block which should be from file allocation - * The return address should be aligned - * H5MF_try_extend() the block with aligned address should succeed + * Turn off using metadata aggregator + * Allocate a block which should be from file allocation + * The return address should be aligned + * H5MF_try_extend() the block with aligned address should succeed *------------------------------------------------------------------------- */ static unsigned test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl1 = -1; - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl1 = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; - H5FD_mem_t type; - haddr_t addr1, addr2; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; - htri_t was_extended; + H5FD_mem_t type; + haddr_t addr1, addr2; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; + htri_t was_extended; H5FS_stat_t state; - hsize_t alignment=0, mis_align=0, tmp=0, accum=0; + hsize_t alignment=0, mis_align=0, tmp=0, accum=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MM_alloc() of file allocation with alignment: test 1"); @@ -3850,8 +3850,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ TESTING("H5MF_try_shrink() of file allocation with alignment: test 2"); @@ -3905,8 +3905,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ TESTING("H5MF_try_extend() of file allocation with alignment: test 3"); @@ -3961,15 +3961,15 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_eoa() */ @@ -3981,43 +3981,43 @@ error: * Alignment = 1024 or 4096 * * Test 1: - * Add section A with an aligned address to free-space manager (addr=alignment, size=50) - * Allocate a block of size=50 - * The returned space's address should be same as section A's address + * Add section A with an aligned address to free-space manager (addr=alignment, size=50) + * Allocate a block of size=50 + * The returned space's address should be same as section A's address * * Test 2: - * Add section A to free-space manager (addr=70, size=8000): - * section A is mis-aligned but the size is big enough for allocation with alignment - * Allocate a block of size=600 - * The returned space should be allocated from section A with an aligned address: - * address=alignment size=600 - * There will be 2 sections in free-space: (alignment = 1024 or alignment = 4096) - * the fragment left from aligning section A: [70, 954] or [70, 4026] - * the section left after allocating block A: [1624, 416] or [4696, 3374] - * H5MF_try_extend() the block of size 600 by 200 should succeed: - * the existing fragment left from aligning section A: [70, 954] or [70, 4026] - * the section left after extending block A: [1824, 216] or [4896, 3174] + * Add section A to free-space manager (addr=70, size=8000): + * section A is mis-aligned but the size is big enough for allocation with alignment + * Allocate a block of size=600 + * The returned space should be allocated from section A with an aligned address: + * address=alignment size=600 + * There will be 2 sections in free-space: (alignment = 1024 or alignment = 4096) + * the fragment left from aligning section A: [70, 954] or [70, 4026] + * the section left after allocating block A: [1624, 416] or [4696, 3374] + * H5MF_try_extend() the block of size 600 by 200 should succeed: + * the existing fragment left from aligning section A: [70, 954] or [70, 4026] + * the section left after extending block A: [1824, 216] or [4896, 3174] * * Test 3: - * Add section A to free-space manager (addr=70, size=700): - * section A is mis-aligned but the size is not big enough for allocation with alignment - * Allocate a block of size=40 - * The free-space manager is unable to fulfill the request - * The block is allocated from file allocation and should be aligned + * Add section A to free-space manager (addr=70, size=700): + * section A is mis-aligned but the size is not big enough for allocation with alignment + * Allocate a block of size=40 + * The free-space manager is unable to fulfill the request + * The block is allocated from file allocation and should be aligned *------------------------------------------------------------------------- */ static unsigned test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ h5_stat_size_t file_size; - H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f = NULL; /* Internal file object pointer */ H5MF_free_section_t *sect_node = NULL; - haddr_t addr; + haddr_t addr; H5FS_stat_t state; htri_t was_extended; - hsize_t alignment=0, tmp=0, mis_align=0; + hsize_t alignment=0, tmp=0, mis_align=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MF_alloc() of free-space manager with alignment: test 1"); @@ -4248,15 +4248,15 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_fs() */ @@ -4265,114 +4265,114 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size > aggr->size and < aggr->alloc_size - * Result: - * An "aggr->alloc_size" block is allocated from file allocation for the aggregator - * EOA is 3072 - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) <= aggr->size - * Result: - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 974 left in meta_aggr - * - * Allocate third block (80) from meta_aggr: - * (request-size + fragment size) > aggr->size - * request-size < meta_aggr->alloc_size - * fragment size < (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of "meta_aggr->alloc_size" is extended from file allocation for meta_aggr - * EOA is 5120 - * The third block of 80 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[2098, 974] - * There is space of 1968 left in meta_aggr - * - * Allocate fourth block (1970) from meta_aggr: - * (request-size + fragment size) is <= aggr->size - * fragment size > (aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of aggr->alloc_size + fragment size - (aggr->alloc_size - request-size)) - * is extended from file allocation for meta_aggr - * The third block of 1970 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[3152, 944] - * There is space of 1968 left in meta_aggr - * EOA is at 8034 - * - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (aggregator is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * There is space of 2018 left in meta_aggr - * EOA is at 6144 - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment size > (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 left in meta_aggr - * EOA is at 10260 - * - * Allocate third block (80) from meta_aggr: - * (request-size + fragment size) is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment size > (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The third block of 80 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[8242, 4046] - * There is space of 2018 left in meta_aggr - * EOA is at 14386 - * - * Allocate fourth block (1970) from meta_aggr: - * (request-size + fragment size) > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment size > (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The fourth block of 1970 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[12368, 4016] - * There is space of 2018 left in meta_aggr - * EOA is at 20372 + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size > aggr->size and < aggr->alloc_size + * Result: + * An "aggr->alloc_size" block is allocated from file allocation for the aggregator + * EOA is 3072 + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) <= aggr->size + * Result: + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 974 left in meta_aggr + * + * Allocate third block (80) from meta_aggr: + * (request-size + fragment size) > aggr->size + * request-size < meta_aggr->alloc_size + * fragment size < (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of "meta_aggr->alloc_size" is extended from file allocation for meta_aggr + * EOA is 5120 + * The third block of 80 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[2098, 974] + * There is space of 1968 left in meta_aggr + * + * Allocate fourth block (1970) from meta_aggr: + * (request-size + fragment size) is <= aggr->size + * fragment size > (aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of aggr->alloc_size + fragment size - (aggr->alloc_size - request-size)) + * is extended from file allocation for meta_aggr + * The third block of 1970 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[3152, 944] + * There is space of 1968 left in meta_aggr + * EOA is at 8034 + * + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (aggregator is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * There is space of 2018 left in meta_aggr + * EOA is at 6144 + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment size > (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 left in meta_aggr + * EOA is at 10260 + * + * Allocate third block (80) from meta_aggr: + * (request-size + fragment size) is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment size > (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The third block of 80 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[8242, 4046] + * There is space of 2018 left in meta_aggr + * EOA is at 14386 + * + * Allocate fourth block (1970) from meta_aggr: + * (request-size + fragment size) > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment size > (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The fourth block of 1970 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[12368, 4016] + * There is space of 2018 left in meta_aggr + * EOA is at 20372 *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; /* File size */ - H5FD_mem_t type; - haddr_t addr1, addr2, addr3, addr4; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3, addr4; H5FS_stat_t state; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, mis_align=0; - hsize_t alignment=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, mis_align=0; + hsize_t alignment=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -4518,15 +4518,15 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc1() */ @@ -4535,101 +4535,101 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate second block (50) from meta_aggr: - * (request-size+fragment size) <= aggr->size - * Result: - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 974 left in meta_aggr - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from sdata_aggr and should be aligned - * EOA is 5120 - * - * Allocate third block (80) from meta_aggr: - * request-size+fragment size is > meta_aggr->size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * The unused space in meta_aggr is freed to free-space [2098, 974] - * meta_aggr is updated to point to the new block - * The third block of 80 is allocated from meta_aggr and should be aligned - * EOA is 7168 - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > aggr->size and < aggr->alloc_size - * Result: - * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * There is space of 2018 left meta_aggr - * EOA is at 6144 - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) > aggr->size - * request-size < aggr->alloc_size - * fragment size > (aggr->alloc_size - request-size) - * Result: - * A block of (fragment size + request-size) is extended from file allocation for the aggregator - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 left in meta_aggr - * EOA is at 10260 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size - * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size - * Result: - * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk since at EOF - * meta_aggr is reset to 0 - * A block of sdata_aggr->alloc_size is obtained via file allocation - * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] - * The first block of 30 is allocated from sdata_aggr and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 14336 - * - * Allocate third block (80) from meta_aggr: - * (request-size + fragment size) is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator - * Fragment from alignment of file allocation is freed to free-space:[14336, 2048] - * other_aggr is [12318, 2018] - * The third block of 80 is allocated from the aggregator and should be aligned - * There is space of 1968 left in meta_aggr - * EOA is at 18432 + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate second block (50) from meta_aggr: + * (request-size+fragment size) <= aggr->size + * Result: + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 974 left in meta_aggr + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from sdata_aggr and should be aligned + * EOA is 5120 + * + * Allocate third block (80) from meta_aggr: + * request-size+fragment size is > meta_aggr->size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * The unused space in meta_aggr is freed to free-space [2098, 974] + * meta_aggr is updated to point to the new block + * The third block of 80 is allocated from meta_aggr and should be aligned + * EOA is 7168 + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > aggr->size and < aggr->alloc_size + * Result: + * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * There is space of 2018 left meta_aggr + * EOA is at 6144 + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) > aggr->size + * request-size < aggr->alloc_size + * fragment size > (aggr->alloc_size - request-size) + * Result: + * A block of (fragment size + request-size) is extended from file allocation for the aggregator + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 left in meta_aggr + * EOA is at 10260 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size + * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size + * Result: + * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk since at EOF + * meta_aggr is reset to 0 + * A block of sdata_aggr->alloc_size is obtained via file allocation + * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] + * The first block of 30 is allocated from sdata_aggr and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 14336 + * + * Allocate third block (80) from meta_aggr: + * (request-size + fragment size) is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator + * Fragment from alignment of file allocation is freed to free-space:[14336, 2048] + * other_aggr is [12318, 2018] + * The third block of 80 is allocated from the aggregator and should be aligned + * There is space of 1968 left in meta_aggr + * EOA is at 18432 *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; /* File size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, sdata_size=0, mis_align=0; - hsize_t alignment=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, sdata_size=0, mis_align=0; + hsize_t alignment=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 2"); @@ -4718,11 +4718,11 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * * For alignment = 1024, alloc_size = 2048: * block 30 is allocated from (ma_addr + ma_size), - * which is already aligned + * which is already aligned * * For alignment = 4096, alloc_size = 2048: - * since remaining space in meta_aggr is freed and shrunk, - * block 30 is allocated from ma_addr + * since remaining space in meta_aggr is freed and shrunk, + * block 30 is allocated from ma_addr */ mis_align = 0; if((alignment == TEST_ALIGN1024) && (tmp = ((ma_addr + ma_size) % alignment))) @@ -4753,10 +4753,10 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * Calculate fragment for the allocation of block 80 from meta_aggr: * * For alignment = 1024, alloc_size = 2048: - * fragment for unused space in meta_aggr is freed to free-space + * fragment for unused space in meta_aggr is freed to free-space * For alignment = 4096, alloc_size = 2048: - * fragment from alignment of ma_addr is freed - * block 30 is allocated from ma_addr + * fragment from alignment of ma_addr is freed + * block 30 is allocated from ma_addr */ mis_align = 0; if((alignment == TEST_ALIGN1024) && (tmp = (ma_addr % alignment))) @@ -4783,15 +4783,15 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Verify total size of free space after all the allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); @@ -4804,15 +4804,15 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc2() */ @@ -4821,153 +4821,153 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate second block (50) from meta_aggr: - * (request-size+fragment size) is <= aggr->size - * Result: - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 974 left in the aggregator - * - * Allocate first block (30) from other_aggr: (nothing in other_aggr) - * request-size is > what is left in other_aggr->size and < other_aggr->alloc_size - * Result: - * A "other_aggr->alloc_size" block is allocated from file allocation for other_aggr - * The first block of 30 is allocated from other_aggr and should be aligned - * There is space of 2018 left in other_aggr->size - * EOA is 5120 - * - * Allocate second block (50) from sdata_aggr: - * (request-size+fragment size) < sdata_aggr->size - * Result: - * The second block of 50 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] - * There is space of 974 left in sdata_aggr - * - * Allocate third block (80) from sdata_aggr: - * (request-size+fragment size) is >= sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * sdata_aggr is at EOA - * Result: - * Another block of sdata_aggr->alloc_size is extended from file allocation for sdata_aggr - * The third block of 80 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] - * There is space of 1968 left in sdata_aggr - * EOA is 7168 - * - * Allocate third block (1034) from meta_aggregator: - * (request-size + alignment) > meta_aggr->size but < meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The unused space in sdata_aggr is freed to free-space [5200, 1968] then shrunk - * sdata_aggr is reset to 0 - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space [5200, 944] - * The unused space in meta_aggr is freed to free-space [2098, 974] - * The meta_aggr is updated to point to the new space - * The block of 1034 is allocated from the new block and should be aligned - * There is space of 1014 left in meta_aggr - * EOA is 8192 - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > what is left in aggr->size and < aggr->alloc_size - * Result: - * A meta_aggr->alloc block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * There is space of 2018 left in meta_aggr - * EOA is at 6144 - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) is > what is left in aggr->size - * request-size < aggr->alloc_size - * fragment size > (aggr->alloc_size - request-size) - * Result: - * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 left in meta_aggr - * EOA is at 10260 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request-size > sdata_aggr->size and < sdata_aggr->alloc_size - * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size - * Result: - * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk - * since at EOF - * meta_aggr is reset to 0 - * A block of sdata_aggr->alloc_size is obtained via file allocation - * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] - * The first block of 30 is allocated from sdata_aggr and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 14336 - * - * Allocate second block (50) from sdata_aggr: - * request-size is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[12318, 4066] - * The second block of 50 is allocated from the aggregator and should be aligned - * There is space of 2018 left in the sdata_aggr - * EOA is at 18452 - * - * Allocate third block (80) from sdata_aggr: - * request-size + fragment size is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size) - * is allocated from file allocation for the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[16434, 4046] - * The third block of 80 is allocated from the aggregator and should be aligned - * There is space of 2018 left in the sdata_aggr - * EOA is at 22578 - * - * Allocate third block (1034) from meta_aggregator: - * (request-size + fragment size) is > meta_aggr->size but request-size < meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The remaining space in sdata_aggr is freed to free-space [20560, 2018] then shrunk - * sdata_aggr is reset to 0 - * There is nothing in meta_aggr - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space [20560, 4016] - * EOA is 26624 - * The meta_aggr is updated to point to the new space - * The block of 1034 is allocated from the new block and should be aligned - * There is space of 1014 left in meta_aggr + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate second block (50) from meta_aggr: + * (request-size+fragment size) is <= aggr->size + * Result: + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 974 left in the aggregator + * + * Allocate first block (30) from other_aggr: (nothing in other_aggr) + * request-size is > what is left in other_aggr->size and < other_aggr->alloc_size + * Result: + * A "other_aggr->alloc_size" block is allocated from file allocation for other_aggr + * The first block of 30 is allocated from other_aggr and should be aligned + * There is space of 2018 left in other_aggr->size + * EOA is 5120 + * + * Allocate second block (50) from sdata_aggr: + * (request-size+fragment size) < sdata_aggr->size + * Result: + * The second block of 50 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] + * There is space of 974 left in sdata_aggr + * + * Allocate third block (80) from sdata_aggr: + * (request-size+fragment size) is >= sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * sdata_aggr is at EOA + * Result: + * Another block of sdata_aggr->alloc_size is extended from file allocation for sdata_aggr + * The third block of 80 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] + * There is space of 1968 left in sdata_aggr + * EOA is 7168 + * + * Allocate third block (1034) from meta_aggregator: + * (request-size + alignment) > meta_aggr->size but < meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The unused space in sdata_aggr is freed to free-space [5200, 1968] then shrunk + * sdata_aggr is reset to 0 + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space [5200, 944] + * The unused space in meta_aggr is freed to free-space [2098, 974] + * The meta_aggr is updated to point to the new space + * The block of 1034 is allocated from the new block and should be aligned + * There is space of 1014 left in meta_aggr + * EOA is 8192 + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > what is left in aggr->size and < aggr->alloc_size + * Result: + * A meta_aggr->alloc block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * There is space of 2018 left in meta_aggr + * EOA is at 6144 + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) is > what is left in aggr->size + * request-size < aggr->alloc_size + * fragment size > (aggr->alloc_size - request-size) + * Result: + * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 left in meta_aggr + * EOA is at 10260 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request-size > sdata_aggr->size and < sdata_aggr->alloc_size + * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size + * Result: + * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk + * since at EOF + * meta_aggr is reset to 0 + * A block of sdata_aggr->alloc_size is obtained via file allocation + * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] + * The first block of 30 is allocated from sdata_aggr and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 14336 + * + * Allocate second block (50) from sdata_aggr: + * request-size is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[12318, 4066] + * The second block of 50 is allocated from the aggregator and should be aligned + * There is space of 2018 left in the sdata_aggr + * EOA is at 18452 + * + * Allocate third block (80) from sdata_aggr: + * request-size + fragment size is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size) + * is allocated from file allocation for the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[16434, 4046] + * The third block of 80 is allocated from the aggregator and should be aligned + * There is space of 2018 left in the sdata_aggr + * EOA is at 22578 + * + * Allocate third block (1034) from meta_aggregator: + * (request-size + fragment size) is > meta_aggr->size but request-size < meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The remaining space in sdata_aggr is freed to free-space [20560, 2018] then shrunk + * sdata_aggr is reset to 0 + * There is nothing in meta_aggr + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space [20560, 4016] + * EOA is 26624 + * The meta_aggr is updated to point to the new space + * The block of 1034 is allocated from the new block and should be aligned + * There is space of 1014 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3; - haddr_t saddr1, saddr2, saddr3; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3; + haddr_t saddr1, saddr2, saddr3; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, sdata_size=0, mis_align=0; - hsize_t alignment=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, sdata_size=0, mis_align=0; + hsize_t alignment=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -5164,15 +5164,15 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Verify total size of free space after all allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -5180,15 +5180,15 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc3() */ @@ -5198,81 +5198,81 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate second block (2058) from meta_aggr: - * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size - * meta_aggr is at EOA - * Result: - * The second block of 2058 + fragment is extended and merged together with meta_aggr - * The block of 2058 is allocated out of the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 2018 (same as before) left in meta_aggr - * EOA is 6124 - * - * Allocate third block (5) from meta_aggr: - * request-size+fragment < meta_aggr->size - * Result: - * A block of 5 is allocated from the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[4106, 1014] - * There is space of 999 left in meta_aggr - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 6144 - * - * Allocate second block (2058) from meta_aggr: - * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size - * meta_aggr is at EOA - * Result: - * The second block of 2058 + fragment is extended and merged together with meta_aggr - * The block of 2058 is allocated out of the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 (same as before) left in meta_aggr - * EOA is 12268 - * - * Allocate third block (5) from meta_aggr: - * request-size+fragment is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment < (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size is extended from file allocation for the aggregator - * A block of 5 is allocated from the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[10250, 2038] - * There is space of 2023 left in meta_aggr + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate second block (2058) from meta_aggr: + * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size + * meta_aggr is at EOA + * Result: + * The second block of 2058 + fragment is extended and merged together with meta_aggr + * The block of 2058 is allocated out of the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 2018 (same as before) left in meta_aggr + * EOA is 6124 + * + * Allocate third block (5) from meta_aggr: + * request-size+fragment < meta_aggr->size + * Result: + * A block of 5 is allocated from the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[4106, 1014] + * There is space of 999 left in meta_aggr + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 6144 + * + * Allocate second block (2058) from meta_aggr: + * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size + * meta_aggr is at EOA + * Result: + * The second block of 2058 + fragment is extended and merged together with meta_aggr + * The block of 2058 is allocated out of the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 (same as before) left in meta_aggr + * EOA is 12268 + * + * Allocate third block (5) from meta_aggr: + * request-size+fragment is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment < (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size is extended from file allocation for the aggregator + * A block of 5 is allocated from the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[10250, 2038] + * There is space of 2023 left in meta_aggr * *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type; - haddr_t addr1, addr2, addr3; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3; H5FS_stat_t state; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, saved_ma_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, saved_ma_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -5378,10 +5378,10 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(addr3 % alignment) TEST_ERROR /* Verify total size of free space after all allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &state)) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &state)) + TEST_ERROR + } if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -5389,15 +5389,15 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc4() */ @@ -5406,84 +5406,84 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate first block (30) from sdata_aggr: (nothing in the aggregator) - * A block of sdata_aggr->alloc_size is allocated from file allocation - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 5120 - * - * Allocate second block (2058) from meta_aggr: - * (request-size + fragment size) > meta_aggr->size and > meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up sdata_aggr->alloc_size - * Result: - * A block of 2058 is allocated from file allocation - * EOA is 7178 - * Nothing is changed in meta_aggr and sdata_aggr - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 6144 - * - * Allocate first block (30) from sdata_aggr: (meta_aggr is empty) - * meta_aggr is at EOA but has not used up more than meta_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[6144, 2048] - * This fragment adjoins meta_aggr and fulfills "absorb" condition, - * the remaining space left in meta_aggr is absorbed into the fragment and - * freed to free-space: [4126, 2018] - * meta_aggr is reset to 0 - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 10240 - * - * Allocate second block (2058) from meta_aggr: - * request-size + fragment size is > meta_aggr->size - * request_size is > meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of 2058 is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[10240, 2048] - * This fragment adjoins sdata_aggr and fulfills "absorb" condition, - * the remaining space left in sdata_aggr is absorbed into the fragment and - * freed to free-space: [8222, 2018] - * sdata_aggr is reset to 0 - * EOA is 14346 - * meta_aggr and sdata_aggr are all 0 + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate first block (30) from sdata_aggr: (nothing in the aggregator) + * A block of sdata_aggr->alloc_size is allocated from file allocation + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 5120 + * + * Allocate second block (2058) from meta_aggr: + * (request-size + fragment size) > meta_aggr->size and > meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up sdata_aggr->alloc_size + * Result: + * A block of 2058 is allocated from file allocation + * EOA is 7178 + * Nothing is changed in meta_aggr and sdata_aggr + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 6144 + * + * Allocate first block (30) from sdata_aggr: (meta_aggr is empty) + * meta_aggr is at EOA but has not used up more than meta_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[6144, 2048] + * This fragment adjoins meta_aggr and fulfills "absorb" condition, + * the remaining space left in meta_aggr is absorbed into the fragment and + * freed to free-space: [4126, 2018] + * meta_aggr is reset to 0 + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 10240 + * + * Allocate second block (2058) from meta_aggr: + * request-size + fragment size is > meta_aggr->size + * request_size is > meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of 2058 is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[10240, 2048] + * This fragment adjoins sdata_aggr and fulfills "absorb" condition, + * the remaining space left in sdata_aggr is absorbed into the fragment and + * freed to free-space: [8222, 2018] + * sdata_aggr is reset to 0 + * EOA is 14346 + * meta_aggr and sdata_aggr are all 0 *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, saddr1; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, saddr1; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -5586,15 +5586,15 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) } /* Verify total size of free space after all allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } /* nothing is changed in meta_aggr */ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -5612,15 +5612,15 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) PASSED() } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc5() */ @@ -5630,125 +5630,125 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in meta_aggr->size - * EOA is 3072 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request_size > sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is allocated from file allocation - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 5120 - * - * Allocate second block (50) from sdata_aggr: - * (request-size+fragment size) <= sdata_aggr->size - * Result: - * The second block of 50 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] - * There is space of 974 left in sdata_aggr - * - * Allocate third block (80) from sdata_aggr: - * (request-size+fragment size) > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size < (sdata_aggr->alloc_size - request-size) - * Result: - * Another block of sdata_aggr->alloc_size block is extended from file allocation - * for sdata_aggr - * The third block of 80 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] - * There is space of 1968 left in sdata_aggr - * EOA is 7168 - * - * Allocate second block (2058) from meta_aggr: - * request-size + fragment size is > meta_aggr->size - * request-size is > meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The remaining space in sdata_aggr is freed to free-space and shrunk - * sdata_aggr is reset to 0 - * A block of 2058 is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[5200, 944] - * EOA is at 8202 - * meta_aggr is unchanged - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 6144 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request_size > sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space: [6144, 2048] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 10240 - * - * Allocate second block (50) from sdata_aggr: - * (request-size+fragment size) is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of (fragment size + request-size) is extended from file allocation for the aggregator - * The second block of 50 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066] - * There is space of 2018 left in sdata_aggr - * EOA is at 14356 - * - * Allocate third block (80) from sdata_aggr: - * (request-size+fragment size) is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr - * The third block of 80 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046] - * There is space of 2018 left in sdata_aggr - * EOA is 18482 - * - * Allocate second block (2058) from meta_aggr: - * request-size + fragment size is > meta_aggr->size - * request-size is > meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The remaining space in sdata_aggr is freed to free-space and shrunk: [16464, 2018] - * sdata_aggr is reset to 0 - * A block of 2058 is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[16464, 4016] - * EOA is at 22538 - * meta_aggr is unchanged + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in meta_aggr->size + * EOA is 3072 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request_size > sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is allocated from file allocation + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 5120 + * + * Allocate second block (50) from sdata_aggr: + * (request-size+fragment size) <= sdata_aggr->size + * Result: + * The second block of 50 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] + * There is space of 974 left in sdata_aggr + * + * Allocate third block (80) from sdata_aggr: + * (request-size+fragment size) > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size < (sdata_aggr->alloc_size - request-size) + * Result: + * Another block of sdata_aggr->alloc_size block is extended from file allocation + * for sdata_aggr + * The third block of 80 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] + * There is space of 1968 left in sdata_aggr + * EOA is 7168 + * + * Allocate second block (2058) from meta_aggr: + * request-size + fragment size is > meta_aggr->size + * request-size is > meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The remaining space in sdata_aggr is freed to free-space and shrunk + * sdata_aggr is reset to 0 + * A block of 2058 is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[5200, 944] + * EOA is at 8202 + * meta_aggr is unchanged + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 6144 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request_size > sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space: [6144, 2048] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 10240 + * + * Allocate second block (50) from sdata_aggr: + * (request-size+fragment size) is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of (fragment size + request-size) is extended from file allocation for the aggregator + * The second block of 50 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066] + * There is space of 2018 left in sdata_aggr + * EOA is at 14356 + * + * Allocate third block (80) from sdata_aggr: + * (request-size+fragment size) is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr + * The third block of 80 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046] + * There is space of 2018 left in sdata_aggr + * EOA is 18482 + * + * Allocate second block (2058) from meta_aggr: + * request-size + fragment size is > meta_aggr->size + * request-size is > meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The remaining space in sdata_aggr is freed to free-space and shrunk: [16464, 2018] + * sdata_aggr is reset to 0 + * A block of 2058 is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[16464, 4016] + * EOA is at 22538 + * meta_aggr is unchanged *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2; - haddr_t saddr1, saddr2, saddr3; + H5FD_mem_t type, stype; + haddr_t addr1, addr2; + haddr_t saddr1, saddr2, saddr3; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 6"); @@ -5901,16 +5901,16 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (sdata_addr != HADDR_UNDEF || sdata_size != 0) TEST_ERROR - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } - + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -6136,18 +6136,18 @@ test_mf_fs_persist_split(void) if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Set up split driver */ if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT)<0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* File creation property list template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -6312,7 +6312,7 @@ test_mf_fs_persist_split(void) /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR @@ -6386,22 +6386,22 @@ error: memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW; \ memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP; \ memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP; \ - sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \ + HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \ memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER]; \ memb_addr[H5FD_MEM_SUPER] = 0; \ - sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \ + HDsprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \ memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE]; \ memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/6; \ - sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \ + HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \ memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW]; \ memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/3; \ - sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \ + HDsprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \ memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP]; \ memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX/2; \ - sprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \ + HDsprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \ memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP]; \ memb_addr[H5FD_MEM_LHEAP] = HADDR_MAX*2/3; \ - sprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \ + HDsprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \ memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR]; \ memb_addr[H5FD_MEM_OHDR] = HADDR_MAX*5/6; \ } @@ -6748,7 +6748,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("File's free-space is persistent with new library format") else TESTING("File's free-space is persistent with old library format") - + if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) { /* File creation property list template */ @@ -6816,7 +6816,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); /* Verify that H5FD_MEM_SUPER free-space manager is there */ if(!H5F_addr_defined(f->shared->fs_addr[tt])) @@ -6882,14 +6882,14 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); H5Pclose(fapl2); } H5E_END_TRY; @@ -6898,7 +6898,7 @@ error: /* *------------------------------------------------------------------------- - * Verify free-space are merged/shrunk away + * Verify free-space are merged/shrunk away *------------------------------------------------------------------------- */ static unsigned @@ -6913,10 +6913,9 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) H5FS_stat_t fs_stat; /* Information for free-space manager */ haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */ haddr_t addrx; - H5FD_mem_t fs_type; + H5FD_mem_t fs_type; hbool_t contig_addr_vfd; - if(new_format) TESTING("File's free-space is going away with new library format") else @@ -6967,7 +6966,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - + /* Put block #1, #3 to H5FD_MEM_SUPER free-space manager */ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR @@ -6991,7 +6990,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE4, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE4, (H5F_mem_page_t *)&fs_type); /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ if(H5F_addr_defined(f->shared->fs_addr[fs_type])) @@ -7067,14 +7066,14 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } else { SKIPPED(); - puts(" Current VFD doesn't support persistent free-space manager"); + HDputs(" Current VFD doesn't support persistent free-space manager"); } return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); H5Pclose(fapl2); } H5E_END_TRY; @@ -7137,11 +7136,11 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for /* Create file-creation template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) FAIL_STACK_ERROR - + /* Set default file space information */ if(H5Pset_file_space_strategy(fcpl, fs_type, (hbool_t)fs_persist, fs_threshold) < 0) FAIL_STACK_ERROR - + /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0) FAIL_STACK_ERROR @@ -7164,7 +7163,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for FAIL_STACK_ERROR if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - + /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR @@ -7186,7 +7185,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5VL_object(file))) @@ -7196,7 +7195,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for hssize_t nsects; /* # of free-space sections */ int i; /* local index variable */ H5F_sect_info_t *sect_info; /* array to hold the free-space information */ - + /* Get the # of free-space sections in the file */ if((nsects = H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)0, NULL)) < 0) FAIL_STACK_ERROR @@ -7211,7 +7210,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)); H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - + /* Verify the size of free-space sections */ for(i = 0; i < nsects; i++) if(sect_info[i].size < fs_threshold) @@ -7244,7 +7243,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fcpl); H5Pclose(fapl2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_strat_thres_persist() */ @@ -7287,7 +7286,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format HDmemset(&fs_state_zero, 0, sizeof(H5FS_stat_t)); /* Copy the file access property list */ - if((fapl2 = H5Pcopy(fapl)) < 0) + if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR if(new_format) @@ -7337,13 +7336,12 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); /* For paged aggregation, the section in the page at EOF for small meta fs is not shrunk away */ - if(fs_type == H5F_FSPACE_STRATEGY_PAGE) { + if(fs_type == H5F_FSPACE_STRATEGY_PAGE) if(H5FS_stat_info(f, f->shared->fs_man[tt], &fs_state) < 0) FAIL_STACK_ERROR - } /* Put block #3, #5 to H5FD_MEM_SUPER free-space manager */ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) @@ -7376,7 +7374,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format if(fs_type == H5F_FSPACE_STRATEGY_PAGE) { fs_state.tot_sect_count = fs_state.serial_sect_count = 1; fs_state.tot_space += (TBLOCK_SIZE4 + TBLOCK_SIZE6); - } + } /* For old format: the sections at EOF are shrunk away */ if(check_stats(f, f->shared->fs_man[tt], (fs_type == H5F_FSPACE_STRATEGY_PAGE) ? &fs_state:&fs_state_zero)) @@ -7400,7 +7398,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) FAIL_STACK_ERROR - + /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR @@ -7430,7 +7428,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fcpl); H5Pclose(fapl2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_strat_thres_gone() */ @@ -7460,11 +7458,11 @@ error: static unsigned test_dichotomy(hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FD_mem_t type, stype; - haddr_t addr1, addr3, saddr1, saddr2; + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FD_mem_t type, stype; + haddr_t addr1, addr3, saddr1, saddr2; TESTING("Allocation from raw or metadata free-space manager"); @@ -7517,7 +7515,7 @@ test_dichotomy(hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_dichotomy() */ @@ -7638,7 +7636,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR - + /* Allocate 3 small metadata blocks: addr1, addr2, addr3 */ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034); @@ -7648,8 +7646,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE1034); if(!fs_persist) { - - H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with addr2 is found from the small metadata manager */ if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) @@ -7681,8 +7678,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(!fs_persist) { - - H5MF__alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with gaddr1 is found from the large data manager */ if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) @@ -7703,18 +7699,18 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Re-open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0) TEST_ERROR - + /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR /* Verify that the large generic manager is there */ - H5MF__alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR /* Verify that the small metadata manager is there */ - H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type); if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR @@ -7733,7 +7729,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Verify that the small raw data manager is there */ if(!H5F_addr_defined(f->shared->fs_addr[H5F_MEM_PAGE_DRAW])) TEST_ERROR - + /* Set up to use the small raw data manager */ if(!(f->shared->fs_man[H5F_MEM_PAGE_DRAW])) if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0) @@ -7745,7 +7741,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(found_addr != saddr1) TEST_ERROR - H5MF__alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); if(!(f->shared->fs_man[fs_type])) /* Set up to use the large data manager */ @@ -7757,7 +7753,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR - + /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -7771,7 +7767,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); @@ -7895,7 +7891,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation"); + HDputs(" Current VFD doesn't support paged aggregation"); } return(0); @@ -7992,13 +7988,13 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR - + /* Free the block with addr1 */ H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248); /* Allocate a new metadata block with addr1 */ /* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */ - /* The block is right next to the threshold */ + /* The block is right next to the threshold */ addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286); /* Try extending the block into the threshold with size > H5F_FILE_SPACE_PGEND_META_THRES */ @@ -8050,7 +8046,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation"); + HDputs(" Current VFD doesn't support paged aggregation"); } return(0); @@ -8160,7 +8156,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2 */ - /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ + /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR @@ -8191,7 +8187,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8248,7 +8244,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Set the strategy to paged aggregation */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) FAIL_STACK_ERROR - + /* Create the file to work on */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR @@ -8323,7 +8319,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(fs_stat.tot_space != (16384+288)) TEST_ERROR - + /* Close file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -8344,7 +8340,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8391,7 +8387,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) multi = TRUE; else if(!HDstrcmp(env_h5_drvr, "family")) family = TRUE; - + if(!multi && !split) { /* Set the filename to use for this test (dependent on fapl) */ @@ -8507,7 +8503,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8525,7 +8521,7 @@ error: * Function: test_page_alignment * * Purpose: To verify the proper alignment is used when H5Pset_alignment() - * is set and paged aggregation is enabled. + * is set and paged aggregation is enabled. * * Return: Success: 0 * Failure: number of errors @@ -8556,7 +8552,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) split = TRUE; else if(!HDstrcmp(env_h5_drvr, "multi")) multi = TRUE; - + if(!multi && !split) { /* Set the filename to use for this test (dependent on fapl) */ @@ -8648,7 +8644,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* The alignment to use will be the library's default file space page size */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) TEST_ERROR - + /* Create the file to work on */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_new)) < 0) TEST_ERROR @@ -8689,7 +8685,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* + /* * Case 2: Verify that the alignment in use is the alignment set * via H5Pset_alignment when paged aggregation not enabled. */ @@ -8746,7 +8742,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* + /* * Case 3: Verify that the alignment in use is the alignment set * via H5Pset_alignment when paged aggregation not enabled. */ @@ -8769,7 +8765,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR - + /* Allocate 2 small raw data blocks */ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); @@ -8813,7 +8809,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); @@ -8831,10 +8827,10 @@ error: int main(void) { - hid_t fapl = -1; /* File access property list for data files */ - hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ + hid_t fapl = -1; /* File access property list for data files */ + hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ unsigned nerrors = 0; /* Cumulative error count */ - test_type_t curr_test; /* Current test being worked on */ + test_type_t curr_test; /* Current test being worked on */ const char *env_h5_drvr; /* File Driver value from environment */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ @@ -8936,7 +8932,7 @@ main(void) nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, FALSE); nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, TRUE); - /* Temporary skipped for multi/split drivers: + /* Temporary skipped for multi/split drivers: fail file create when persisting free-space or using paged aggregation strategy */ #ifdef PB_OUT /* Tests specific for multi and split files--persisting free-space */ @@ -8944,7 +8940,7 @@ main(void) nerrors += test_mf_fs_persist_multi(); #endif - /* + /* * Tests specific for file space paging */ /* Temporary: The following 7 tests are modified to skip testing for multi/split driver: @@ -8970,12 +8966,12 @@ main(void) if(nerrors) goto error; - puts("All free-space manager tests for file memory passed."); + HDputs("All free-space manager tests for file memory passed."); return(0); error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Pclose(fapl); H5Pclose(new_fapl); diff --git a/test/mtime.c b/test/mtime.c index 80730eb..f7a441d 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -15,10 +15,10 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Thursday, July 30, 1998 * - * Purpose: Determines if the modification time message is working - * properly. Specifically, the code in H5O_mtime_decode() is - * very OS-dependent and this test tries to figure out if it's - * working properly. + * Purpose: Determines if the modification time message is working + * properly. Specifically, the code in H5O_mtime_decode() is + * very OS-dependent and this test tries to figure out if it's + * working properly. */ #include "h5test.h" #include "H5srcdir.h" @@ -33,17 +33,17 @@ const char *FILENAME[] = { #define TESTFILE2 "tmtimen.h5" #define MTIME2 1041606478 - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: H5O_mtime_decode() test. + * Purpose: H5O_mtime_decode() test. * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 30, 1998 * * Modifications: @@ -58,13 +58,13 @@ const char *FILENAME[] = { int main(void) { - hid_t fapl, file, space, dset; - hsize_t size[1] = {2}; - time_t now; - struct tm *tm; - H5O_info_t oi1, oi2; - signed char buf1[32], buf2[32]; - char filename[1024]; + hid_t fapl, file, space, dset; + hsize_t size[1] = {2}; + time_t now; + struct tm *tm; + H5O_info_t oi1, oi2; + signed char buf1[32], buf2[32]; + char filename[1024]; h5_reset(); fapl = h5_fileaccess(); @@ -99,18 +99,18 @@ main(void) /* Compare addresses & times from the two ways of calling H5Oget_info() */ if(oi1.addr != oi2.addr || oi1.ctime != oi2.ctime) { H5_FAILED(); - puts(" Calling H5Oget_info() with the dataset ID returned"); - puts(" different values than calling it with a file and dataset"); - puts(" name."); + HDputs(" Calling H5Oget_info() with the dataset ID returned"); + HDputs(" different values than calling it with a file and dataset"); + HDputs(" name."); goto error; } /* Compare times -- they must be within 60 seconds of one another */ if(0 == oi1.ctime) { SKIPPED(); - puts(" The modification time could not be decoded on this OS."); - puts(" Modification times will be mantained in the file but"); - puts(" cannot be queried on this system. See H5O_mtime_decode()."); + HDputs(" The modification time could not be decoded on this OS."); + HDputs(" Modification times will be mantained in the file but"); + HDputs(" cannot be queried on this system. See H5O_mtime_decode()."); return 0; } else if(HDfabs(HDdifftime(now, oi1.ctime)) > (double)60.0F) { H5_FAILED(); @@ -118,7 +118,7 @@ main(void) HDstrftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); tm = HDlocaltime(&now); HDstrftime((char*)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm); - printf(" got: %s\n ans: %s\n", buf1, buf2); + HDprintf(" got: %s\n ans: %s\n", buf1, buf2); goto error; } PASSED(); @@ -147,7 +147,7 @@ main(void) } else { H5_FAILED(); - printf("***cannot open the pre-created old modification test file (%s)\n", + HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile); goto error; } /* end else */ @@ -168,14 +168,14 @@ main(void) TEST_ERROR; if(oi2.ctime != MTIME2) { H5_FAILED(); - puts(" Modification time incorrect."); + HDputs(" Modification time incorrect."); goto error; } if(H5Fclose(file) < 0) TEST_ERROR; } else { H5_FAILED(); - printf("***cannot open the pre-created old modification test file (%s)\n", + HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile); goto error; } /* end else */ @@ -186,7 +186,7 @@ main(void) if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR /* All looks good */ - puts("All modification time tests passed."); + HDputs("All modification time tests passed."); h5_cleanup(FILENAME, fapl); return 0; diff --git a/test/ntypes.c b/test/ntypes.c index b6f4de7..83cdfd2 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -149,8 +149,8 @@ test_atomic_dtype(hid_t file) for(j = 0; j < DIM1; j++) if(ipoints2[i][j] != icheck2[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ @@ -521,8 +521,8 @@ test_compound_dtype2(hid_t file) temp_point->st.ll2 != temp_check->st.ll2 || temp_point->l != temp_check->l ) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ } /* end for */ @@ -728,8 +728,8 @@ test_compound_dtype(hid_t file) temp_point->i != temp_check->i || temp_point->l != temp_check->l ) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ @@ -942,16 +942,16 @@ test_compound_dtype3(hid_t file) if(temp_point->c != temp_check->c || temp_point->l != temp_check->l ) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ for(k = 0; k < 5; k++) { if(temp_point->a[k] != temp_check->a[k]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d,%d\n", i, j, k); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d,%d\n", i, j, k); goto error; } /* end if */ } /* end for */ @@ -1157,16 +1157,16 @@ test_compound_opaque(hid_t file) if(temp_point->c != temp_check->c || temp_point->l != temp_check->l ) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ for(k = 0; k < 5; k++) { if(temp_point->o[k] != temp_check->o[k]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d,%d\n", i, j, k); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d,%d\n", i, j, k); goto error; } /* end if */ } /* end for */ @@ -1320,9 +1320,9 @@ test_enum_dtype(hid_t file) for(j = 0; j < DIM1; j++) if(spoints2[i][j] != scheck2[i][j]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); - printf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j], + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j], scheck2[i][j]); goto error; } /* end if */ @@ -1476,8 +1476,8 @@ test_array_dtype(hid_t file) temp_point->i != temp_check->i || temp_point->l != temp_check->l ) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ @@ -1610,8 +1610,8 @@ test_array_dtype2(hid_t file) for(k = 0; k < 5; k++) if(icheck3[i][j][k] != ipoints3[i][j][k]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d,%d\n", i, j); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d,%d\n", i, j); goto error; } /* end if */ @@ -1677,7 +1677,7 @@ test_vl_dtype(hid_t file) wdata[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); if(NULL == wdata[i].p) { H5_FAILED(); - printf(" Cannot allocate memory for VL data! i=%u\n",(unsigned)i); + HDprintf(" Cannot allocate memory for VL data! i=%u\n",(unsigned)i); goto error; } /* end if */ wdata[i].len = i + 1; @@ -1685,7 +1685,7 @@ test_vl_dtype(hid_t file) t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); if(NULL == t1->p) { H5_FAILED(); - printf(" Cannot allocate memory for VL data! i=%u, j=%u\n",(unsigned)i,(unsigned)j); + HDprintf(" Cannot allocate memory for VL data! i=%u, j=%u\n",(unsigned)i,(unsigned)j); goto error; } /* end if */ t1->len = j + 1; @@ -1745,13 +1745,13 @@ test_vl_dtype(hid_t file) for(i = 0; i < SPACE1_DIM1; i++) { if(wdata[i].len != rdata[i].len) { H5_FAILED(); - printf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); + HDprintf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); goto error; } /* end if */ for(t1 = (hvl_t *)wdata[i].p, t2 = (hvl_t *)rdata[i].p, j = 0; j < rdata[i].len; j++, t1++, t2++) { if(t1->len != t2->len) { H5_FAILED(); - printf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); + HDprintf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); goto error; } /* end if */ @@ -1767,7 +1767,7 @@ test_vl_dtype(hid_t file) for(k = 0; k < t2->len; k++) { if(((unsigned int *)t1->p)[k] != ((unsigned int *)tmp)[k]) { H5_FAILED(); - printf(" VL data don't match!, wdata[%u].p=%d, rdata[%u].p=%u\n", + HDprintf(" VL data don't match!, wdata[%u].p=%d, rdata[%u].p=%u\n", (unsigned)i, ((unsigned int*)t1->p)[k], (unsigned)i, ((unsigned int*)tmp)[k]); goto error; } /* end if */ @@ -1903,13 +1903,13 @@ test_vlstr_dtype(hid_t file) for(i = 0; i < SPACE1_DIM1; i++) { if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { H5_FAILED(); - printf(" VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", + HDprintf(" VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i, (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); goto error; } /* end if */ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { H5_FAILED(); - printf(" VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", + HDprintf(" VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i], (int)i, rdata[i]); goto error; } /* end if */ @@ -2026,13 +2026,13 @@ test_str_dtype(hid_t file) for(i = 0; i < SPACE1_DIM1; i++) { if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { H5_FAILED(); - printf(" data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", + HDprintf(" data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i, (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); goto error; } /* end if */ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { H5_FAILED(); - printf(" data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", + HDprintf(" data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i], (int)i, rdata[i]); goto error; } /* end if */ @@ -2507,8 +2507,8 @@ test_opaque_dtype(hid_t file) for(i = 0; i < sizeof(rbuf); i++) if(rbuf[i] != wbuf[i]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %u\n", (unsigned)i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %u\n", (unsigned)i); goto error; } /* end if */ @@ -2612,8 +2612,8 @@ test_bitfield_dtype(hid_t file) for(i = 0; i < BITFIELD_ENUMB*4; i++) { if(*p != wbuf[i]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %zu\n", i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %zu\n", i); TEST_ERROR; } p++; @@ -2637,8 +2637,8 @@ test_bitfield_dtype(hid_t file) for(i = 0; i < BITFIELD_ENUMB; i++) { if(intr[i] != intw[i]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %zu\n", i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %zu\n", i); TEST_ERROR; } } @@ -2792,13 +2792,13 @@ test_ninteger(void) /* check */ if(H5Tget_precision(nid1) != H5Tget_precision(nid2)) { - printf(" Precision differ.\n"); + HDprintf(" Precision differ.\n"); TEST_ERROR } /* end if */ /* compare dataset creation property lists */ if(H5Pequal(dcpl1, dcpl2) <= 0) { - printf(" Property lists differ.\n"); + HDprintf(" Property lists differ.\n"); TEST_ERROR } /* end if */ @@ -2806,8 +2806,8 @@ test_ninteger(void) for(i = 0; i < DIM3; i++) if(buf[i] != chk[i]) { H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %d\n", i); + HDprintf(" Read different values than written.\n"); + HDprintf(" At index %d\n", i); TEST_ERROR } /* end if */ @@ -2898,7 +2898,7 @@ main(void) if(nerrors) goto error; - printf("All native datatype tests passed.\n"); + HDprintf("All native datatype tests passed.\n"); h5_cleanup(FILENAME, fapl); return 0; @@ -2910,7 +2910,7 @@ error: } H5E_END_TRY; nerrors = MAX(1, nerrors); - printf("***** %d DATASET TEST%s FAILED! *****\n", + HDprintf("***** %d DATASET TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; diff --git a/test/objcopy.c b/test/objcopy.c index 1f89e16..05ddfa4 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -284,8 +284,6 @@ addr_reset(void) * Programmer: Peter Cao * Friday, August 4, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -345,8 +343,6 @@ error: * Programmer: Peter Cao * Monday, March 5, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -422,8 +418,6 @@ error: * Programmer: Peter Cao * Friday, August 4, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -517,8 +511,6 @@ error: * Programmer: Peter Cao * Saturday, December 17, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -579,8 +571,6 @@ done: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -602,7 +592,7 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id) goto done; for(u = 0; u < num_attributes_g; u++) { - sprintf(attr_name, "%u attr", u); + HDsprintf(attr_name, "%u attr", u); /* Set attribute data */ attr_data[0] = (int)(100 * u); @@ -671,7 +661,7 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id) if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0) goto done; for(u = 0; u < num_attributes_g; u++) { - sprintf(attr_name, "%u attr", u); + HDsprintf(attr_name, "%u attr", u); /* Set attribute data */ attr_data[0] = (int)(100 * u); @@ -856,10 +846,6 @@ error: * Note: This isn't very general, the attributes are assumed to be * those written in test_copy_attach_attributes(). * - * Modifier: Peter Cao - * Wednesday, March 21, 2007 - * Change to compare any attributes of two objects - * *------------------------------------------------------------------------- */ static int @@ -1094,6 +1080,9 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, if(H5Tequal(obj1_id, obj2_id) != TRUE) TEST_ERROR break; + case H5O_TYPE_MAP: + /* Maps not supported in native VOL connector */ + case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: @@ -1152,6 +1141,9 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, if(H5Tequal(obj1_id, obj2_id) != TRUE) TEST_ERROR break; + case H5O_TYPE_MAP: + /* Maps not supported in native VOL connector */ + case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: @@ -1167,7 +1159,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, if((obj2_sid = H5Rget_region(parent2, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR /* Check if dataspaces are the same shape */ - if(H5S__select_shape_same_test(obj1_sid, obj2_sid) < 0) TEST_ERROR + if(H5Sselect_shape_same(obj1_sid, obj2_sid) < 0) TEST_ERROR /* Close dataspaces */ if(H5Sclose(obj1_sid) < 0) TEST_ERROR @@ -1213,8 +1205,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) hssize_t nelmts; /* # of elements in dataspace */ void *rbuf = NULL; /* Buffer for reading raw data */ void *rbuf2 = NULL; /* Buffer for reading raw data */ - H5D_space_status_t space_status; /* Dataset's raw data space status */ - H5D_space_status_t space_status2; /* Dataset's raw data space status */ + H5D_space_status_t space_status; /* Dataset's raw dataspace status */ + H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ /* Check the datatypes are equal */ @@ -1468,10 +1460,13 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) if(H5Tequal(oid, oid2) != TRUE) TEST_ERROR break; + case H5O_TYPE_MAP: + HDassert(0 && "maps not supported in native VOL connector"); + case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: -HDassert(0 && "Unknown type of object"); + HDassert(0 && "Unknown type of object"); break; } /* end switch */ @@ -1569,8 +1564,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1858,8 +1851,6 @@ error: * Programmer: Neil * Friday, March 11, 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1999,8 +1990,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2294,8 +2283,6 @@ error: * Programmer: Neil Fortner * Thursday, January 15, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2519,8 +2506,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2651,8 +2636,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4396,8 +4379,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6281,8 +6262,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6376,8 +6355,6 @@ error: * Programmer: Peter Cao * August 8, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6509,8 +6486,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6692,15 +6667,15 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f /* create nested sub-groups & datasets */ for(i = 0; i < NUM_SUB_GROUPS; i++) { - sprintf(objname, "Group #%d", i); + HDsprintf(objname, "Group #%d", i); if((gid_sub = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR for(j = 0; j < NUM_SUB_GROUPS; j++) { - sprintf(objname, "Group #%d", j); + HDsprintf(objname, "Group #%d", j); if((gid_sub2 = H5Gcreate2(gid_sub, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR for(k = 0; k < NUM_DATASETS; k++) { - sprintf(objname, "Dataset #%d", k); + HDsprintf(objname, "Dataset #%d", k); /* add a dataset to the group */ if((did = H5Dcreate2(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -6933,11 +6908,11 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* create wide sub-group hierarchy, with multiple links to higher groups */ for(u = 0; u < NUM_WIDE_LOOP_GROUPS; u++) { - sprintf(objname, "%s-%u", NAME_GROUP_SUB, u); + HDsprintf(objname, "%s-%u", NAME_GROUP_SUB, u); if((gid_sub = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR for(v = 0; v < NUM_WIDE_LOOP_GROUPS; v++) { - sprintf(objname, "%s-%u", NAME_GROUP_SUB_SUB2, v); + HDsprintf(objname, "%s-%u", NAME_GROUP_SUB_SUB2, v); if((gid_sub2 = H5Gcreate2(gid_sub, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create link to top group */ @@ -7024,12 +6999,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * Neil Fortner - * Tuesday, February 16, 2010 - * Modified test to test flags for expanding soft and external - * links. - * *------------------------------------------------------------------------- */ static int @@ -8017,7 +7986,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* make a copy of the datatype for later use */ if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set compact plist */ @@ -8171,7 +8140,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* make a copy of the datatype for later use */ if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -8326,7 +8295,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* make a copy of the datatype for later use */ if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set chunk plist */ @@ -8487,7 +8456,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_ /* make a copy of the datatype for later use */ if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set chunk plist */ @@ -10289,7 +10258,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid_src1, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -10313,7 +10282,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid_src2, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -10524,7 +10493,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset */ @@ -10551,7 +10520,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset */ @@ -10796,7 +10765,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -10823,7 +10792,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "a" */ + /* committed datatype "a" */ if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -10832,7 +10801,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "b" */ + /* committed datatype "b" */ if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -11027,7 +10996,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -11057,7 +11026,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* create anonymous committed data type */ + /* create anonymous committed datatype */ if((H5Tcommit_anon(fid_dst, tid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create attribute at SRC file */ @@ -12817,7 +12786,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -12847,7 +12816,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "a" */ + /* committed datatype "a" */ if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -12856,7 +12825,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "b" */ + /* committed datatype "b" */ if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -13176,7 +13145,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -13206,7 +13175,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "a" */ + /* committed datatype "a" */ if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -13215,7 +13184,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "b" */ + /* committed datatype "b" */ if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -13499,8 +13468,6 @@ error: * Programmer: Peter Cao * March 11, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -13817,8 +13784,6 @@ error: * Programmer: Vailin Choi * Feb 7, 2012 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -14125,7 +14090,7 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Test H5Ocopy() * @@ -14133,13 +14098,11 @@ error: * new or old format, messages can be shared in either, * both, or neither of the source and destination files. * - * Return: Non-negative on success/Negative on failure + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -14159,7 +14122,7 @@ main(void) ExpressMode = GetTestExpress(); if (ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -14195,52 +14158,52 @@ main(void) /* Test with and without shared messages */ if(configuration & CONFIG_SHARE_SRC) { - puts("\nTesting with shared src messages:"); + HDputs("\nTesting with shared src messages:"); fcpl_src = fcpl_shared; } else { - puts("\nTesting without shared src messages:"); + HDputs("\nTesting without shared src messages:"); fcpl_src = H5P_DEFAULT; } if(configuration & CONFIG_SHARE_DST) { - puts("Testing with shared dst messages:"); + HDputs("Testing with shared dst messages:"); fcpl_dst = fcpl_shared; same_file = FALSE; } else { - puts("Testing without shared dst messages:"); + HDputs("Testing without shared dst messages:"); fcpl_dst = H5P_DEFAULT; } /* Set the FAPL for the source file's type of format */ if(configuration & CONFIG_SRC_NEW_FORMAT) { - puts("Testing with latest format for source file:"); + HDputs("Testing with latest format for source file:"); src_fapl = fapl2; /* Test with and without dense attributes */ if(configuration & CONFIG_DENSE) { - puts("Testing with dense attributes:"); + HDputs("Testing with dense attributes:"); num_attributes_g = max_compact + 1; } else { - puts("Testing without dense attributes:"); + HDputs("Testing without dense attributes:"); num_attributes_g = MAX(min_dense, 2) - 2; } } /* end if */ else { - puts("Testing with oldest file format for source file:"); + HDputs("Testing with oldest file format for source file:"); src_fapl = fapl; num_attributes_g = 4; } /* end else */ /* Set the FAPL for the destination file's type of format */ if(configuration & CONFIG_DST_NEW_FORMAT) { - puts("Testing with latest format for destination file:"); + HDputs("Testing with latest format for destination file:"); dst_fapl = fapl2; same_file = FALSE; } /* end if */ else { - puts("Testing with oldest file format for destination file:"); + HDputs("Testing with oldest file format for destination file:"); dst_fapl = fapl; } /* end else */ @@ -14411,12 +14374,12 @@ main(void) /* Results */ if(nerrors) { - printf("***** %d OBJECT COPY TEST%s FAILED! *****\n", + HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n", nerrors, (1 == nerrors ? "" : "S")); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* end if */ - puts ("All object copying tests passed."); + HDputs ("All object copying tests passed."); /* close property list. * NOTE: if this property list is not closed and the test is @@ -14443,9 +14406,9 @@ main(void) h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: - return 1; + HDexit(EXIT_FAILURE); } /* main */ diff --git a/test/ohdr.c b/test/ohdr.c index c5d5ac4..13bac9e 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -1641,7 +1641,7 @@ main(void) /* Display info about testing */ low_string = h5_get_version_string(low); high_string = h5_get_version_string(high); - sprintf(msg, "Using file format version: (%s, %s)", low_string, + HDsprintf(msg, "Using file format version: (%s, %s)", low_string, high_string); HDputs(msg); @@ -1887,7 +1887,7 @@ main(void) return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); } H5E_END_TRY; diff --git a/test/reserved.c b/test/reserved.c index d8d0c59..7e53d9c 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -22,17 +22,17 @@ const char *FILENAME[] = { }; /*------------------------------------------------------------------------- - * Function: rsrv_heap + * Function: rsrv_heap * - * Purpose: Ensure that heaps reserve file address space. - * This function does this by creating datasets up to and past - * the limit of the file, then ensuring that an error (not an - * assert) was generated and that the file is readable. + * Purpose: Ensure that heaps reserve file address space. + * This function does this by creating datasets up to and past + * the limit of the file, then ensuring that an error (not an + * assert) was generated and that the file is readable. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: James Laird + * Programmer: James Laird * Nat Furrer * Friday, May 28, 2004 * @@ -71,7 +71,7 @@ rsrv_heap(void) dataspace_id = H5Screate_simple(1, dims, dims); } H5E_END_TRY - sprintf(dset_name, "Dset %d", i); + HDsprintf(dset_name, "Dset %d", i); H5E_BEGIN_TRY { dataset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -103,7 +103,7 @@ rsrv_heap(void) /* Re-open the library and try to read a dataset from the file we created */ if(H5open() < 0) TEST_ERROR; - sprintf(dset_name, "Dset %d", i - 2); + HDsprintf(dset_name, "Dset %d", i - 2); file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT); if(file_id < 0) TEST_ERROR; @@ -135,17 +135,17 @@ error: } /*------------------------------------------------------------------------- - * Function: rsrv_ohdr + * Function: rsrv_ohdr * - * Purpose: Ensure that object headers reserve file address space. - * This function does this by creating attributes of a dataset - * past the limit of the file, then ensuring that an error (not - * an assert) was generated and that the file is readable. + * Purpose: Ensure that object headers reserve file address space. + * This function does this by creating attributes of a dataset + * past the limit of the file, then ensuring that an error (not + * an assert) was generated and that the file is readable. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: James Laird + * Programmer: James Laird * Nat Furrer * Friday, May 28, 2004 * @@ -195,7 +195,7 @@ rsrv_ohdr(void) } /* end for */ for(i = 0; i < 2000; i++) { - sprintf(attrname, "attr %d", i); + HDsprintf(attrname, "attr %d", i); H5E_BEGIN_TRY{ aid = H5Screate_simple(2, dims, NULL); attr_id = H5Acreate2(dataset_id, attrname, H5T_STD_I32BE, aid, H5P_DEFAULT, H5P_DEFAULT); @@ -257,20 +257,20 @@ error: } /*------------------------------------------------------------------------- - * Function: rsrv_vlen + * Function: rsrv_vlen * - * Purpose: Ensure that variable length datatypes properly ensure that + * Purpose: Ensure that variable length datatypes properly ensure that * enough file address space exists before writing. - * This function does this by creating a dataset containing + * This function does this by creating a dataset containing * variable length data past the limit of the file, then * ensuring that an error (not an assert) was generated and * that the file is readable. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: James Laird - * Nat Furrer + * Programmer: James Laird + * Nat Furrer * Thursday, July 1, 2004 * * Modifications: @@ -401,15 +401,15 @@ error: #endif /* BROKEN */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Nat Furrer and James Laird + * Programmer: Nat Furrer and James Laird * Thursday, July 1, 2004 * * Modifications: @@ -434,22 +434,22 @@ main(void) envval = "nomatch"; /* QAK: should be able to use the core driver? */ if (HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { - num_errs+=rsrv_ohdr(); - num_errs+=rsrv_heap(); - num_errs+=rsrv_vlen(); - - if(num_errs > 0) - printf("**** %d FAILURE%s! ****\n", num_errs, num_errs==1?"":"S"); - else - puts("All address space reservation tests passed."); - - fapl = h5_fileaccess(); - h5_cleanup(FILENAME, fapl); - return num_errs; + num_errs+=rsrv_ohdr(); + num_errs+=rsrv_heap(); + num_errs+=rsrv_vlen(); + + if(num_errs > 0) + HDprintf("**** %d FAILURE%s! ****\n", num_errs, num_errs==1?"":"S"); + else + HDputs("All address space reservation tests passed."); + + fapl = h5_fileaccess(); + h5_cleanup(FILENAME, fapl); + return num_errs; } else { - puts("All address space reservation tests skippped - Incompatible with current Virtual File Driver"); + HDputs("All address space reservation tests skippped - Incompatible with current Virtual File Driver"); } #endif /* BROKEN */ diff --git a/test/ros3.c b/test/ros3.c new file mode 100644 index 0000000..73b6ac2 --- /dev/null +++ b/test/ros3.c @@ -0,0 +1,1937 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Read-Only S3 Virtual File Driver (VFD) + * + * Purpose: + * + * Verify behavior for Read-Only S3 VFD + * at the VFL (virtual file layer) level. + * + * Demonstrates basic use cases and fapl/dxpl interaction. + * + * Programmer: Jacob Smith <jake.smith@hdfgroup.org> + * 2017-10-11 + */ + +#include "h5test.h" + +#include "H5FDprivate.h" /* Virtual File Driver utilities */ +#include "H5FDros3.h" /* this file driver's utilities */ +#include "H5FDs3comms.h" /* for loading of credentials */ + +#ifdef H5_HAVE_ROS3_VFD + +/* only include the testing macros if needed */ + +/***************************************************************************** + * + * FILE-LOCAL TESTING MACROS + * + * Purpose: + * + * 1) Upon test failure, goto-jump to single-location teardown in test + * function. E.g., `error:` (consistency with HDF corpus) or + * `failed:` (reflects purpose). + * >>> using "error", in part because `H5E_BEGIN_TRY` expects it. + * 2) Increase clarity and reduce overhead found with `TEST_ERROR`. + * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:" + * requires reading of entire line to know whether this if/call is + * part of the test setup, test operation, or a test unto itself. + * 3) Provide testing macros with optional user-supplied failure message; + * if not supplied (NULL), generate comparison output in the spirit of + * test-driven development. E.g., "expected 5 but was -3" + * User messages clarify test's purpose in code, encouraging description + * without relying on comments. + * 4) Configurable expected-actual order in generated comparison strings. + * Some prefer `VERIFY(expected, actual)`, others + * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch + * to satifsy both parties, assuming one paradigm per test file. + * (One could #undef and redefine the flag through the file as desired, + * but _why_.) + * + * Provided as courtesy, per consideration for inclusion in the library + * proper. + * + * Macros: + * + * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order + * FAIL_IF() - check condition + * FAIL_UNLESS() - check _not_ condition + * JSVERIFY() - long-int equality check; prints reason/comparison + * JSVERIFY_NOT() - long-int inequality check; prints + * JSVERIFY_STR() - string equality check; prints + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *****************************************************************************/ + + +/*---------------------------------------------------------------------------- + * + * ifdef flag: JSVERIFY_EXP_ACT + * + * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason]) + * default, if this is undefined, is (ACTUAL, EXPECTED[, reason]) + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_EXP_ACT 1L + + +/*---------------------------------------------------------------------------- + * + * Macro: JSFAILED_AT() + * + * Purpose: + * + * Preface a test failure by printing "*FAILED*" and location to stdout + * Similar to `H5_FAILED(); AT();` from h5test.h + * + * *FAILED* at somefile.c:12 in function_name()... + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSFAILED_AT() { \ + HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: FAIL_IF() + * + * Purpose: + * + * Make tests more accessible and less cluttered than + * `if (thing == otherthing()) TEST_ERROR` + * paradigm. + * + * The following lines are roughly equivalent: + * + * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests) + * `FAIL_IF(myfunc() < 0)` + * + * Prints a generic "FAILED AT" line to stdout and jumps to `error`, + * similar to `TEST_ERROR` in h5test.h + * + * Programmer: Jacob Smith + * 2017-10-23 + * + *---------------------------------------------------------------------------- + */ +#define FAIL_IF(condition) \ +if (condition) { \ + JSFAILED_AT() \ + goto error; \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: FAIL_UNLESS() + * + * Purpose: + * + * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests", + * e.g., "a != b". + * + * Opposite of FAIL_IF; fails if the given condition is _not_ true. + * + * `FAIL_IF( 5 != my_op() )` + * is equivalent to + * `FAIL_UNLESS( 5 == my_op() )` + * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer. + * (see JSVERIFY) + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#if 0 /* UNUSED */ +#define FAIL_UNLESS(condition) \ +if (!(condition)) { \ + JSFAILED_AT() \ + goto error; \ +} +#endif + + +/*---------------------------------------------------------------------------- + * + * Macro: JSERR_LONG() + * + * Purpose: + * + * Print an failure message for long-int arguments. + * ERROR-AT printed first. + * If `reason` is given, it is printed on own line and newlined after + * else, prints "expected/actual" aligned on own lines. + * + * *FAILED* at myfile.c:488 in somefunc()... + * forest must be made of trees. + * + * or + * + * *FAILED* at myfile.c:488 in somefunc()... + * ! Expected 425 + * ! Actual 3 + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSERR_LONG(expected, actual, reason) { \ + JSFAILED_AT() \ + if (reason!= NULL) { \ + HDprintf("%s\n", (reason)); \ + } else { \ + HDprintf(" ! Expected %ld\n ! Actual %ld\n", \ + (long)(expected), (long)(actual)); \ + } \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: JSERR_STR() + * + * Purpose: + * + * Print an failure message for string arguments. + * ERROR-AT printed first. + * If `reason` is given, it is printed on own line and newlined after + * else, prints "expected/actual" aligned on own lines. + * + * *FAILED* at myfile.c:421 in myfunc()... + * Blue and Red strings don't match! + * + * or + * + * *FAILED* at myfile.c:421 in myfunc()... + * !!! Expected: + * this is my expected + * string + * !!! Actual: + * not what I expected at all + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSERR_STR(expected, actual, reason) { \ + JSFAILED_AT() \ + if ((reason) != NULL) { \ + HDprintf("%s\n", (reason)); \ + } else { \ + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \ + (expected), (actual)); \ + } \ +} + + + +#ifdef JSVERIFY_EXP_ACT + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY() + * + * Purpose: + * + * Verify that two long integers are equal. + * If unequal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY(expected, actual, reason) \ +if ((long)(actual) != (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY_NOT() + * + * Purpose: + * + * Verify that two long integers are _not_ equal. + * If equal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_NOT(expected, actual, reason) \ +if ((long)(actual) == (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY_NOT */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY_STR() + * + * Purpose: + * + * Verify that two strings are equal. + * If unequal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_STR(expected, actual, reason) \ +if (strcmp((actual), (expected)) != 0) { \ + JSERR_STR((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY_STR */ + + +#else +/* JSVERIFY_EXP_ACT not defined + * + * Repeats macros above, but with actual/expected parameters reversed. + */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY() + * See: JSVERIFY documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY(actual, expected, reason) \ +if ((long)(actual) != (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY_NOT() + * See: JSVERIFY_NOT documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_NOT(actual, expected, reason) \ +if ((long)(actual) == (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY_NOT */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY_STR() + * See: JSVERIFY_STR documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_STR(actual, expected, reason) \ +if (strcmp((actual), (expected)) != 0) { \ + JSERR_STR((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY_STR */ + +#endif /* ifdef/else JSVERIFY_EXP_ACT */ + +/******************************** + * OTHER MACROS AND DEFINITIONS * + ********************************/ + +#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) + +#define S3_TEST_PROFILE_NAME "ros3_vfd_test" + +#define S3_TEST_MAX_URL_SIZE 256 + +#define S3_TEST_RESOURCE_TEXT_RESTRICTED "t8.shakespeare.txt" +#define S3_TEST_RESOURCE_TEXT_PUBLIC "Poe_Raven.txt" +#define S3_TEST_RESOURCE_H5_PUBLIC "GMODO-SVM01.h5" +#define S3_TEST_RESOURCE_MISSING "missing.csv" + +static char url_text_restricted[S3_TEST_MAX_URL_SIZE] = ""; +static char url_text_public[S3_TEST_MAX_URL_SIZE] = ""; +static char url_h5_public[S3_TEST_MAX_URL_SIZE] = ""; +static char url_missing[S3_TEST_MAX_URL_SIZE] = ""; +static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = ""; +static hbool_t s3_test_bucket_defined = FALSE; + +/* Global variables for aws test profile. + * An attempt is made to read ~/.aws/credentials and ~/.aws/config upon test + * startup -- if unable to open either file or cannot load region, id, and key, + * tests connecting with S3 will not be run + */ +static int s3_test_credentials_loaded = 0; +static char s3_test_aws_region[16]; +static char s3_test_aws_access_key_id[64]; +static char s3_test_aws_secret_access_key[128]; + +H5FD_ros3_fapl_t restricted_access_fa = { + H5FD_CURR_ROS3_FAPL_T_VERSION, /* fapl version */ + TRUE, /* authenticate */ + "", /* aws region */ + "", /* access key id */ + ""}; /* secret access key */ + +H5FD_ros3_fapl_t anonymous_fa = { + H5FD_CURR_ROS3_FAPL_T_VERSION, + FALSE, "", "", "" }; + + +/*--------------------------------------------------------------------------- + * + * Function: test_fapl_config_validation() + * + * Purpose: + * + * Test data consistency of fapl configuration. + * Tests `H5FD_ros3_validate_config` indirectly through `H5Pset_fapl_ros3`. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-10-23 + * + *--------------------------------------------------------------------------- + */ +static int +test_fapl_config_validation(void) +{ + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char *msg; + herr_t expected; + H5FD_ros3_fapl_t config; + }; + + /************************ + * test-local variables * + ************************/ + + hid_t fapl_id = -1; /* file access property list ID */ + H5FD_ros3_fapl_t config; + H5FD_ros3_fapl_t fa_fetch; + herr_t success = SUCCEED; + unsigned int i = 0; + unsigned int ncases = 8; /* should equal number of cases */ + struct testcase *case_ptr = NULL; /* dumb work-around for possible */ + /* dynamic cases creation because */ + /* of compiler warnings Wlarger-than */ + struct testcase cases_arr[] = { + { "non-authenticating config allows empties.\n", + SUCCEED, + { H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */ + FALSE, /* authenticate */ + "", /* aws_region */ + "", /* secret_id */ + "", /* secret_key */ + }, + }, + { "authenticating config asks for populated strings.\n", + FAIL, + { H5FD_CURR_ROS3_FAPL_T_VERSION, + TRUE, + "", + "", + "", + }, + }, + { "populated strings; key is the empty string?\n", + SUCCEED, + { H5FD_CURR_ROS3_FAPL_T_VERSION, + TRUE, + "region", + "me", + "", + }, + }, + { "id cannot be empty.\n", + FAIL, + { H5FD_CURR_ROS3_FAPL_T_VERSION, + TRUE, + "", + "me", + "", + }, + }, + { "region cannot be empty.\n", + FAIL, + { H5FD_CURR_ROS3_FAPL_T_VERSION, + TRUE, + "where", + "", + "", + }, + }, + { "all strings populated.\n", + SUCCEED, + { H5FD_CURR_ROS3_FAPL_T_VERSION, + TRUE, + "where", + "who", + "thisIsA GREAT seeeecrit", + }, + }, + { "incorrect version should fail\n", + FAIL, + { 12345, + FALSE, + "", + "", + "", + }, + }, + { "non-authenticating config cares not for (de)population" + "of strings.\n", + SUCCEED, + { H5FD_CURR_ROS3_FAPL_T_VERSION, + FALSE, + "someregion", + "someid", + "somekey", + }, + }, + }; + + TESTING("ROS3 fapl configuration validation"); + + /********* + * TESTS * + *********/ + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + for (i = 0; i < ncases; i++) { + + /*--------------- + * per-test setup + *--------------- + */ + case_ptr = &cases_arr[i]; + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) /* sanity-check */ + + /*----------------------------------- + * Actually test. + * Mute stack trace in failure cases. + *----------------------------------- + */ + H5E_BEGIN_TRY { + /* `H5FD_ros3_validate_config(...)` is static/private + * to src/ros3.c and cannot (and should not?) be tested directly? + * Instead, validate config through public api. + */ + success = H5Pset_fapl_ros3(fapl_id, &case_ptr->config); + } H5E_END_TRY; + + JSVERIFY( case_ptr->expected, success, case_ptr->msg ) + + /* Make sure we can get back what we put in. + * Only valid if the fapl configuration does not result in error. + */ + if (success == SUCCEED) { + config = case_ptr->config; + JSVERIFY( SUCCEED, + H5Pget_fapl_ros3(fapl_id, &fa_fetch), + "unable to get fapl" ) + + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, + fa_fetch.version, + "invalid version number" ) + JSVERIFY( config.version, + fa_fetch.version, + "version number mismatch" ) + JSVERIFY( config.authenticate, + fa_fetch.authenticate, + "authentication flag mismatch" ) + JSVERIFY_STR( config.aws_region, + fa_fetch.aws_region, + NULL ) + JSVERIFY_STR( config.secret_id, + fa_fetch.secret_id, + NULL ) + JSVERIFY_STR( config.secret_key, + fa_fetch.secret_key, + NULL ) + } + + /*----------------------------- + * per-test sanitation/teardown + *----------------------------- + */ + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + } /* for each test case */ + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (fapl_id < 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + return 1; +} /* test_fapl_config_validation */ + + +/*------------------------------------------------------------------------- + * + * Function: test_ros3_fapl() + * + * Purpose: Tests the file handle interface for the ROS3 driver + * + * As the ROS3 driver is 1) read only, 2) requires access + * to an S3 server, this test is quite + * different from the other tests. + * + * For now, test only fapl & flags. Extend as the + * work on the VFD continues. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: John Mainzer + * 7/12/17 + * + *------------------------------------------------------------------------- + */ +static int +test_ros3_fapl(void) +{ + /************************ + * test-local variables * + ************************/ + + hid_t fapl_id = -1; /* file access property list ID */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + H5FD_ros3_fapl_t ros3_fa_0 = { + H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */ + FALSE, /* authenticate */ + "", /* aws_region */ + "", /* secret_id */ + "plugh", /* secret_key */ + }; + + TESTING("ROS3 fapl "); + + /* Set property list and file name for ROS3 driver. + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + + FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &ros3_fa_0) ) + + driver_id = H5Pget_driver(fapl_id); + FAIL_IF( driver_id < 0 ) + + /**************** + * Check that the VFD feature flags are correct + * SPEC MAY CHANGE + ******************/ + + FAIL_IF( H5FDdriver_query(driver_id, &driver_flags) < 0 ) + + JSVERIFY_NOT( 0, (driver_flags & H5FD_FEAT_DATA_SIEVE), + "bit(s) in `driver_flags` must align with " + "H5FD_FEAT_DATA_SIEVE" ) + + JSVERIFY( H5FD_FEAT_DATA_SIEVE, driver_flags, + "H5FD_FEAT_DATA_SIEVE should be the only supported flag") + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + + return 1; + +} /* test_ros3_fapl() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_vfd_open() + * + * Purpose: + * + * Demonstrate/specify VFD-level "Open" failure cases + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 1027-11-03 + * + *--------------------------------------------------------------------------- + */ +static int +test_vfd_open(void) +{ + + /********************* + * test-local macros * + *********************/ + + +#define FAPL_H5P_DEFAULT -2 +#define FAPL_FILE_ACCESS -3 +#define FAPL_ROS3_ANON -4 + + /************************* + * test-local structures * + *************************/ + + struct test_condition { + const char *message; + const char *url; + unsigned flags; + int which_fapl; + haddr_t maxaddr; + }; + + /************************ + * test-local variables * + ************************/ + + struct test_condition tests[] = { + { "default property list (H5P_DEFAULT) is invalid", + url_text_public, + H5F_ACC_RDONLY, + FAPL_H5P_DEFAULT, + MAXADDR, + }, + { "generic file access property list is invalid", + url_text_public, + H5F_ACC_RDONLY, + FAPL_FILE_ACCESS, + MAXADDR, + }, + { "filename cannot be null", + NULL, + H5F_ACC_RDONLY, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "filename cannot be empty", + "", + H5F_ACC_RDONLY, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "filename must exist", + url_missing, + H5F_ACC_RDONLY, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "read-write flag not supported", + url_text_public, + H5F_ACC_RDWR, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "truncate flag not supported", + url_text_public, + H5F_ACC_TRUNC, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "create flag not supported", + url_text_public, + H5F_ACC_CREAT, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "EXCL flag not supported", + url_text_public, + H5F_ACC_EXCL, + FAPL_ROS3_ANON, + MAXADDR, + }, + { "maxaddr cannot be 0 (caught in `H5FD_open()`)", + url_text_public, + H5F_ACC_RDONLY, + FAPL_ROS3_ANON, + 0, + }, + }; + H5FD_t *fd = NULL; + hbool_t curl_ready = FALSE; + hid_t fapl_id = -1; + hid_t fapl_file_access = -1; + unsigned i = 0; + unsigned tests_count = 10; + + TESTING("ROS3 VFD-level open"); + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) ) + curl_ready = TRUE; + + fapl_file_access = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_file_access < 0 ) + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &anonymous_fa) ) + + /********* + * TESTS * + *********/ + + /* all the test cases that will _not_ open + */ + for (i = 0; i < tests_count; i++) { + struct test_condition T = tests[i]; + hid_t _fapl_id = H5P_DEFAULT; + + fd = NULL; + + if (T.which_fapl == FAPL_FILE_ACCESS) + _fapl_id = fapl_file_access; + else if (T.which_fapl == FAPL_ROS3_ANON) + _fapl_id = fapl_id; + + H5E_BEGIN_TRY { + fd = H5FDopen(T.url, T.flags, _fapl_id, T.maxaddr); + } H5E_END_TRY; + if (NULL != fd) + JSVERIFY(1, 0, T.message); /* wrapper to print message and fail */ + } + + FAIL_IF( NULL != fd ) + + /* finally, show that a file can be opened + */ + fd = H5FDopen( + url_text_public, + H5F_ACC_RDONLY, + fapl_id, + MAXADDR); + FAIL_IF( NULL == fd ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(fd) ) + fd = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + FAIL_IF( FAIL == H5Pclose(fapl_file_access) ) + fapl_file_access = -1; + + curl_global_cleanup(); + curl_ready = FALSE; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (fd) { + (void)H5FDclose(fd); + } + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + if (fapl_file_access >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_file_access); + } H5E_END_TRY; + } + if (curl_ready == TRUE) { + curl_global_cleanup(); + } + + return 1; + +#undef FAPL_FILE_ACCESS +#undef FAPL_H5P_DEFAULT +#undef FAPL_ROS3_ANON + +} /* test_vfd_open */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_eof_eoa() + * + * Purpose: + * + * Demonstrate behavior of get_eof, get_eoa, and set_eoa. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-08 + * + *--------------------------------------------------------------------------- + */ +static int +test_eof_eoa(void) +{ + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + H5FD_t *fd_shakespeare = NULL; + hbool_t curl_ready = FALSE; + hid_t fapl_id = -1; + + TESTING("ROS3 eof/eoa gets and sets"); + + if (s3_test_credentials_loaded == 0) { + SKIPPED(); + puts(" s3 credentials are not loaded"); + fflush(stdout); + return 0; + } + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /********* + * SETUP * + *********/ + + FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) ) + curl_ready = TRUE; + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( 0 > fapl_id ) + FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) ) + + fd_shakespeare = H5FDopen( + url_text_restricted, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == fd_shakespeare ) + + /********* + * TESTS * + *********/ + + /* verify as found + */ + JSVERIFY( 5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL ) + JSVERIFY( H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), + H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW), + "mismatch between DEFAULT and RAW memory types" ) + JSVERIFY( 0, + H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoA should be unset by H5FDopen" ) + + /* set EoA below EoF + */ + JSVERIFY( SUCCEED, + H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 44442202), + "unable to set EoA (lower)" ) + JSVERIFY( 5458199, + H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoF changed" ) + JSVERIFY( 44442202, + H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoA unchanged" ) + + /* set EoA above EoF + */ + JSVERIFY( SUCCEED, + H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 6789012), + "unable to set EoA (higher)" ) + JSVERIFY( 5458199, + H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoF changed" ) + JSVERIFY( 6789012, + H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), + "EoA unchanged" ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(fd_shakespeare) ) + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + curl_global_cleanup(); + curl_ready = FALSE; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (fd_shakespeare) (void)H5FDclose(fd_shakespeare); + if (TRUE == curl_ready) curl_global_cleanup(); + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +} /* test_eof_eoa */ + + +/*----------------------------------------------------------------------------- + * + * Function: test_H5FDread_without_eoa_set_fails() + * + * Purpose: + * + * Demonstrate a not-obvious constraint by the library, preventing + * file read before EoA is set + * + * Programmer: Jacob Smith + * 2018-01-26 + * + *----------------------------------------------------------------------------- + */ +static int +test_H5FDread_without_eoa_set_fails(void) +{ + char buffer[256]; + unsigned int i = 0; + H5FD_t *file_shakespeare = NULL; + hid_t fapl_id = -1; + + TESTING("ROS3 VFD read-eoa temporal coupling library limitation "); + + if (s3_test_credentials_loaded == 0) { + SKIPPED(); + puts(" s3 credentials are not loaded"); + fflush(stdout); + return 0; + } + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /********* + * SETUP * + *********/ + + /* create ROS3 fapl + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) ) + + file_shakespeare = H5FDopen( + url_text_restricted, + H5F_ACC_RDONLY, + fapl_id, + MAXADDR); + FAIL_IF( NULL == file_shakespeare ) + + JSVERIFY( 0, H5FDget_eoa(file_shakespeare, H5FD_MEM_DEFAULT), + "EoA should remain unset by H5FDopen" ) + + for (i = 0; i < 256; i++) + buffer[i] = 0; /* zero buffer contents */ + + /******** + * TEST * + ********/ + + H5E_BEGIN_TRY { /* mute stack trace on expected failure */ + JSVERIFY( FAIL, + H5FDread(file_shakespeare, + H5FD_MEM_DRAW, + H5P_DEFAULT, + 1200699, + 102, + buffer), + "cannot read before eoa is set" ) + } H5E_END_TRY; + JSVERIFY_STR( "", buffer, "buffer should remain untouched" ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(file_shakespeare) ) + file_shakespeare = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (file_shakespeare) { (void)H5FDclose(file_shakespeare); } + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +} /* test_H5FDread_without_eoa_set_fails */ + + + +/*--------------------------------------------------------------------------- + * + * Function: test_read() + * + * Purpose: + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-06 + * + *--------------------------------------------------------------------------- + */ +static int +test_read(void) +{ + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + struct testcase { + const char *message; /* purpose of test case */ + haddr_t eoa_set; /* set file EOA to this prior to read */ + size_t addr; /* offset of read in file */ + size_t len; /* length of read in file */ + herr_t success; /* expected return value of read function */ + const char *expected; /* expected contents of buffer; failure ignores */ + }; + + /************************ + * test-local variables * + ************************/ + struct testcase cases[] = { + { "successful range-get", + 6464, + 5691, + 32, /* fancy quotes are three bytes each(?) */ + SUCCEED, + "Quoth the Raven “Nevermore.”", + }, + { "read past EOA fails (EOA < EOF < addr)", + 3000, + 4000, + 100, + FAIL, + NULL, + }, + { "read overlapping EOA fails (EOA < addr < EOF < (addr+len))", + 3000, + 8000, + 100, + FAIL, + NULL, + }, + { "read past EOA/EOF fails ((EOA==EOF) < addr)", + 6464, + 7000, + 100, + FAIL, + NULL, + }, + { "read overlapping EOA/EOF fails (addr < (EOA==EOF) < (addr+len))", + 6464, + 6400, + 100, + FAIL, + NULL, + }, + { "read between EOF and EOA fails (EOF < addr < (addr+len) < EOA)", + 8000, + 7000, + 100, + FAIL, + NULL, + }, + }; + unsigned testcase_count = 6; + unsigned test_i = 0; + struct testcase test; + herr_t open_return = FAIL; + char buffer[S3_TEST_MAX_URL_SIZE]; + unsigned int i = 0; + H5FD_t *file_raven = NULL; + hid_t fapl_id = -1; + + TESTING("ROS3 VFD read/range-gets"); + + if (s3_test_credentials_loaded == 0) { + SKIPPED(); + puts(" s3 credentials are not loaded"); + fflush(stdout); + return 0; + } + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /********* + * SETUP * + *********/ + + /* create ROS3 fapl + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) ) + + /* open file + */ + file_raven = H5FDopen( /* will open with "authenticating" fapl */ + url_text_public, /* TODO: check return state: anon access of restricted says OK? (not NULL) */ + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); /* Demonstrate success with "automatic" value */ + FAIL_IF( NULL == file_raven ) + + JSVERIFY( 6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL ) + + /********* + * TESTS * + *********/ + + for (test_i = 0; test_i < testcase_count; test_i++) { + + /* -------------- * + * per-test setup * + * -------------- */ + + test = cases[test_i]; + open_return = FAIL; + + FAIL_IF( S3_TEST_MAX_URL_SIZE < test.len ) /* buffer too small! */ + + FAIL_IF( FAIL == + H5FD_set_eoa( file_raven, H5FD_MEM_DEFAULT, test.eoa_set) ) + + for (i = 0; i < S3_TEST_MAX_URL_SIZE; i++) /* zero buffer contents */ + buffer[i] = 0; + + /* ------------ * + * conduct test * + * ------------ */ + + H5E_BEGIN_TRY { + open_return = H5FDread( + file_raven, + H5FD_MEM_DRAW, + H5P_DEFAULT, + test.addr, + test.len, + buffer); + } H5E_END_TRY; + + JSVERIFY( test.success, + open_return, + test.message ) + if (open_return == SUCCEED) + JSVERIFY_STR( test.expected, buffer, NULL ) + + } /* for each testcase */ + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(file_raven) ) + file_raven = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (file_raven) + (void)H5FDclose(file_raven); + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +} /* test_read */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_noops_and_autofails() + * + * Purpose: + * + * Demonstrate the unavailable and do-nothing routines unique to + * Read-Only VFD. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-06 + * + *--------------------------------------------------------------------------- + */ +static int +test_noops_and_autofails(void) +{ + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + hbool_t curl_ready = FALSE; + hid_t fapl_id = -1; + H5FD_t *file = NULL; + const char data[36] = "The Force shall be with you, always"; + + TESTING("ROS3 VFD always-fail and no-op routines"); + + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /********* + * SETUP * + *********/ + + FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) ) + curl_ready = TRUE; + + /* create ROS3 fapl + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( fapl_id < 0 ) + JSVERIFY( SUCCEED, H5Pset_fapl_ros3(fapl_id, &anonymous_fa), NULL ) + + /* open file + */ + file = H5FDopen( + url_text_public, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == file ) + + /********* + * TESTS * + *********/ + + /* auto-fail calls to write and truncate + */ + H5E_BEGIN_TRY { + JSVERIFY( FAIL, + H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data), + "write must fail" ) + } H5E_END_TRY; + + H5E_BEGIN_TRY { + JSVERIFY( FAIL, + H5FDtruncate(file, H5P_DEFAULT, FALSE), + "truncate must fail" ) + } H5E_END_TRY; + + H5E_BEGIN_TRY { + JSVERIFY( FAIL, + H5FDtruncate(file, H5P_DEFAULT, TRUE), + "truncate must fail (closing)" ) + } H5E_END_TRY; + + /* no-op calls to `lock()` and `unlock()` + */ + JSVERIFY( SUCCEED, + H5FDlock(file, TRUE), + "lock always succeeds; has no effect" ) + JSVERIFY( SUCCEED, + H5FDlock(file, FALSE), + NULL ) + JSVERIFY( SUCCEED, + H5FDunlock(file), + NULL ) + /* Lock/unlock with null file or similar error crashes tests. + * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()` + */ + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(file) ) + file = NULL; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + curl_global_cleanup(); + curl_ready = FALSE; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + if (file) { (void)H5FDclose(file); } + if (curl_ready == TRUE) { curl_global_cleanup(); } + + return 1; + +} /* test_noops_and_autofails*/ + + +/*--------------------------------------------------------------------------- + * + * Function: test_cmp() + * + * Purpose: + * + * Verify "file comparison" behavior. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-06 + * + *--------------------------------------------------------------------------- + */ +static int +test_cmp(void) +{ + + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + H5FD_t *fd_raven = NULL; + H5FD_t *fd_shakes = NULL; + H5FD_t *fd_raven_2 = NULL; + hbool_t curl_ready = FALSE; + hid_t fapl_id = -1; + + TESTING("ROS3 cmp (comparison)"); + + if (s3_test_credentials_loaded == 0) { + SKIPPED(); + puts(" s3 credentials are not loaded"); + fflush(stdout); + return 0; + } + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /********* + * SETUP * + *********/ + + FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) ) + curl_ready = TRUE; + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( 0 > fapl_id ) + JSVERIFY( SUCCEED, H5Pset_fapl_ros3(fapl_id, &restricted_access_fa), NULL ) + + fd_raven = H5FDopen( + url_text_public, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == fd_raven ) + + fd_shakes = H5FDopen( + url_text_restricted, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == fd_shakes ) + + fd_raven_2 = H5FDopen( + url_text_public, + H5F_ACC_RDONLY, + fapl_id, + HADDR_UNDEF); + FAIL_IF( NULL == fd_raven_2 ) + + /********* + * TESTS * + *********/ + + JSVERIFY( 0, H5FDcmp(fd_raven, fd_raven_2), NULL ) + JSVERIFY( -1, H5FDcmp(fd_raven, fd_shakes), NULL ) + JSVERIFY( -1, H5FDcmp(fd_shakes, fd_raven_2), NULL ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5FDclose(fd_raven) ) + fd_raven = NULL; + FAIL_IF( FAIL == H5FDclose(fd_shakes) ) + fd_shakes = NULL; + FAIL_IF( FAIL == H5FDclose(fd_raven_2) ) + fd_raven_2 = NULL; + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + curl_global_cleanup(); + curl_ready = FALSE; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ + + if (fd_raven != NULL) (void)H5FDclose(fd_raven); + if (fd_raven_2 != NULL) (void)H5FDclose(fd_raven_2); + if (fd_shakes != NULL) (void)H5FDclose(fd_shakes); + if (TRUE == curl_ready) curl_global_cleanup(); + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + + return 1; + +} /* test_cmp */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_H5F_integration() + * + * Purpose: + * + * Demonstrate S3 file-open through H5F API. + * + * Return: + * + * PASSED : 0 + * FAILED : 1 + * + * Programmer: Jacob Smith + * 2017-11-07 + * + *--------------------------------------------------------------------------- + */ +static int +test_H5F_integration(void) +{ + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + /************************ + * test-local variables * + ************************/ + + hid_t file = -1; + hid_t fapl_id = -1; + + TESTING("S3 file access through HD5F library (H5F API)"); + + if (s3_test_credentials_loaded == 0) { + SKIPPED(); + puts(" s3 credentials are not loaded"); + fflush(stdout); + return 0; + } + + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /********* + * SETUP * + *********/ + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + FAIL_IF( 0 > fapl_id ) + FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) ) + + /********* + * TESTS * + *********/ + + /* Read-Write Open access is not allowed with this file driver. + */ + H5E_BEGIN_TRY { + FAIL_IF( 0 <= H5Fopen( + url_h5_public, + H5F_ACC_RDWR, + fapl_id) ) + } H5E_END_TRY; + + /* H5Fcreate() is not allowed with this file driver. + */ + H5E_BEGIN_TRY { + FAIL_IF( 0 <= H5Fcreate( + url_missing, + H5F_ACC_RDONLY, + H5P_DEFAULT, + fapl_id) ) + } H5E_END_TRY; + + /* Successful open. + */ + file = H5Fopen( + url_h5_public, + H5F_ACC_RDONLY, + fapl_id); + FAIL_IF( file < 0 ) + + /************ + * TEARDOWN * + ************/ + + FAIL_IF( FAIL == H5Fclose(file) ) + file = -1; + + FAIL_IF( FAIL == H5Pclose(fapl_id) ) + fapl_id = -1; + + PASSED(); + return 0; + +error: + /*********** + * CLEANUP * + ***********/ +HDprintf("\nerror!"); fflush(stdout); + + if (fapl_id >= 0) { + H5E_BEGIN_TRY { + (void)H5Pclose(fapl_id); + } H5E_END_TRY; + } + if (file > 0) + (void)H5Fclose(file); + + return 1; + +} /* test_H5F_integration */ + +#endif /* H5_HAVE_ROS3_VFD */ + + +/*------------------------------------------------------------------------- + * + * Function: main + * + * Purpose: Tests the basic features of Virtual File Drivers + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Jacob Smith + * 2017-10-23 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ +#ifdef H5_HAVE_ROS3_VFD + int nerrors = 0; + const char *bucket_url_env = NULL; + +#endif /* H5_HAVE_ROS3_VFD */ + + HDprintf("Testing ros3 VFD functionality.\n"); + +#ifdef H5_HAVE_ROS3_VFD + + /************************ + * initialize test urls * + ************************/ + + bucket_url_env = HDgetenv("HDF5_ROS3_TEST_BUCKET_URL"); + if (bucket_url_env == NULL || bucket_url_env[0] == '\0') { + HDprintf("WARNING: S3 bucket url is not defined in enviornment " \ + "variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n"); + } else { + HDstrncpy(s3_test_bucket_url, bucket_url_env, S3_TEST_MAX_URL_SIZE); + s3_test_bucket_defined = TRUE; + } + + if (S3_TEST_MAX_URL_SIZE < HDsnprintf( + url_text_restricted, + (size_t)S3_TEST_MAX_URL_SIZE, + "%s/%s", + (const char *)s3_test_bucket_url, + (const char *)S3_TEST_RESOURCE_TEXT_RESTRICTED)) + { + HDprintf("* ros3 setup failed (text_restricted) ! *\n"); + return 1; + } + if (S3_TEST_MAX_URL_SIZE < HDsnprintf( + url_text_public, + (size_t)S3_TEST_MAX_URL_SIZE, + "%s/%s", + (const char *)s3_test_bucket_url, + (const char *)S3_TEST_RESOURCE_TEXT_PUBLIC)) + { + HDprintf("* ros3 setup failed (text_public) ! *\n"); + return 1; + } + if (S3_TEST_MAX_URL_SIZE < HDsnprintf( + url_h5_public, + (size_t)S3_TEST_MAX_URL_SIZE, + "%s/%s", + (const char *)s3_test_bucket_url, + (const char *)S3_TEST_RESOURCE_H5_PUBLIC)) + { + HDprintf("* ros3 setup failed (h5_public) ! *\n"); + return 1; + } + if (S3_TEST_MAX_URL_SIZE < HDsnprintf( + url_missing, + S3_TEST_MAX_URL_SIZE, + "%s/%s", + (const char *)s3_test_bucket_url, + (const char *)S3_TEST_RESOURCE_MISSING)) + { + HDprintf("* ros3 setup failed (missing) ! *\n"); + return 1; + } + + /************************************** + * load credentials and prepare fapls * + **************************************/ + + /* "clear" profile data strings */ + s3_test_aws_access_key_id[0] = '\0'; + s3_test_aws_secret_access_key[0] = '\0'; + s3_test_aws_region[0] = '\0'; + + /* attempt to load test credentials + * if unable, certain tests will be skipped + */ + if (SUCCEED == H5FD_s3comms_load_aws_profile( + S3_TEST_PROFILE_NAME, + s3_test_aws_access_key_id, + s3_test_aws_secret_access_key, + s3_test_aws_region)) + { + s3_test_credentials_loaded = 1; + HDstrncpy(restricted_access_fa.aws_region, + (const char *)s3_test_aws_region, + H5FD_ROS3_MAX_REGION_LEN); + HDstrncpy(restricted_access_fa.secret_id, + (const char *)s3_test_aws_access_key_id, + H5FD_ROS3_MAX_SECRET_ID_LEN); + HDstrncpy(restricted_access_fa.secret_key, + (const char *)s3_test_aws_secret_access_key, + H5FD_ROS3_MAX_SECRET_KEY_LEN); + } + + /****************** + * commence tests * + ******************/ + + h5_reset(); + + nerrors += test_fapl_config_validation(); + nerrors += test_ros3_fapl(); + nerrors += test_vfd_open(); + nerrors += test_eof_eoa(); + nerrors += test_H5FDread_without_eoa_set_fails(); + nerrors += test_read(); + nerrors += test_noops_and_autofails(); + nerrors += test_cmp(); + nerrors += test_H5F_integration(); + + if (nerrors > 0) { + HDprintf("***** %d ros3 TEST%s FAILED! *****\n", + nerrors, + nerrors > 1 ? "S" : ""); + nerrors = 1; + } else { + HDprintf("All ros3 tests passed.\n"); + } + return nerrors; /* 0 if no errors, 1 if any errors */ + +#else + + HDprintf("SKIPPED - read-only S3 VFD not built\n"); + return EXIT_SUCCESS; + +#endif /* H5_HAVE_ROS3_VFD */ + +} /* main() */ + diff --git a/test/s3comms.c b/test/s3comms.c new file mode 100644 index 0000000..9453b75 --- /dev/null +++ b/test/s3comms.c @@ -0,0 +1,2730 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Read-Only S3 Virtual File Driver (VFD) + * + * Purpose: Unit tests for the S3 Communications (s3comms) module. + * + * Programmer: Jacob Smith <jake.smith@hdfgroup.org> + * 2017-10-11 + */ + +#include "h5test.h" +#include "H5FDs3comms.h" +#include "H5MMprivate.h" /* memory management */ + +#ifdef H5_HAVE_ROS3_VFD + +/***************************************************************************** + * + * FILE-LOCAL TESTING MACROS + * + * Purpose: + * + * 1) Upon test failure, goto-jump to single-location teardown in test + * function. E.g., `error:` (consistency with HDF corpus) or + * `failed:` (reflects purpose). + * >>> using "error", in part because `H5E_BEGIN_TRY` expects it. + * 2) Increase clarity and reduce overhead found with `TEST_ERROR`. + * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:" + * requires reading of entire line to know whether this if/call is + * part of the test setup, test operation, or a test unto itself. + * 3) Provide testing macros with optional user-supplied failure message; + * if not supplied (NULL), generate comparison output in the spirit of + * test-driven development. E.g., "expected 5 but was -3" + * User messages clarify test's purpose in code, encouraging description + * without relying on comments. + * 4) Configurable expected-actual order in generated comparison strings. + * Some prefer `VERIFY(expected, actual)`, others + * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch + * to satifsy both parties, assuming one paradigm per test file. + * (One could #undef and redefine the flag through the file as desired, + * but _why_.) + * Provided as courtesy, per consideration for inclusion in the library + * proper. + * + * Macros: + * + * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order + * FAIL_IF() - check condition + * FAIL_UNLESS() - check _not_ condition + * JSVERIFY() - long-int equality check; prints reason/comparison + * JSVERIFY_NOT() - long-int inequality check; prints + * JSVERIFY_STR() - string equality check; prints + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *****************************************************************************/ + + +/*---------------------------------------------------------------------------- + * + * ifdef flag: JSVERIFY_EXP_ACT + * + * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason]) + * default, if this is undefined, is (ACTUAL, EXPECTED[, reason]) + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_EXP_ACT 1L + + +/*---------------------------------------------------------------------------- + * + * Macro: JSFAILED_AT() + * + * Purpose: + * + * Preface a test failure by printing "*FAILED*" and location to stdout + * Similar to `H5_FAILED(); AT();` from h5test.h + * + * *FAILED* at somefile.c:12 in function_name()... + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSFAILED_AT() { \ + HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: FAIL_IF() + * + * Purpose: + * + * Make tests more accessible and less cluttered than + * `if (thing == otherthing()) TEST_ERROR` + * paradigm. + * + * The following lines are roughly equivalent: + * + * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests) + * `FAIL_IF(myfunc() < 0)` + * + * Prints a generic "FAILED AT" line to stdout and jumps to `error`, + * similar to `TEST_ERROR` in h5test.h + * + * Programmer: Jacob Smith + * 2017-10-23 + * + *---------------------------------------------------------------------------- + */ +#define FAIL_IF(condition) \ +if (condition) { \ + JSFAILED_AT() \ + goto error; \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: FAIL_UNLESS() + * + * Purpose: + * + * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests", + * e.g., "a != b". + * + * Opposite of FAIL_IF; fails if the given condition is _not_ true. + * + * `FAIL_IF( 5 != my_op() )` + * is equivalent to + * `FAIL_UNLESS( 5 == my_op() )` + * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer. + * (see JSVERIFY) + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define FAIL_UNLESS(condition) \ +if (!(condition)) { \ + JSFAILED_AT() \ + goto error; \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: JSERR_LONG() + * + * Purpose: + * + * Print an failure message for long-int arguments. + * ERROR-AT printed first. + * If `reason` is given, it is printed on own line and newlined after + * else, prints "expected/actual" aligned on own lines. + * + * *FAILED* at myfile.c:488 in somefunc()... + * forest must be made of trees. + * + * or + * + * *FAILED* at myfile.c:488 in somefunc()... + * ! Expected 425 + * ! Actual 3 + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSERR_LONG(expected, actual, reason) { \ + JSFAILED_AT() \ + if (reason!= NULL) { \ + HDprintf("%s\n", (reason)); \ + } else { \ + HDprintf(" ! Expected %ld\n ! Actual %ld\n", \ + (long)(expected), (long)(actual)); \ + } \ +} + + +/*---------------------------------------------------------------------------- + * + * Macro: JSERR_STR() + * + * Purpose: + * + * Print an failure message for string arguments. + * ERROR-AT printed first. + * If `reason` is given, it is printed on own line and newlined after + * else, prints "expected/actual" aligned on own lines. + * + * *FAILED* at myfile.c:421 in myfunc()... + * Blue and Red strings don't match! + * + * or + * + * *FAILED* at myfile.c:421 in myfunc()... + * !!! Expected: + * this is my expected + * string + * !!! Actual: + * not what I expected at all + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSERR_STR(expected, actual, reason) { \ + JSFAILED_AT() \ + if ((reason) != NULL) { \ + HDprintf("%s\n", (reason)); \ + } else { \ + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \ + (expected), (actual)); \ + } \ +} + +#ifdef JSVERIFY_EXP_ACT +/* VERIFY rountines with paramter order (<expected>, <actual> [, <msg> ]) + */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY() + * + * Purpose: + * + * Verify that two long integers are equal. + * If unequal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY(expected, actual, reason) \ +if ((long)(actual) != (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY */ + +#if 0 /* UNUSED */ + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY_NOT() + * + * Purpose: + * + * Verify that two long integers are _not_ equal. + * If equal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_NOT(expected, actual, reason) \ +if ((long)(actual) == (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY_NOT */ +#endif /* JSVERIFY_NOT unused */ + + +/*---------------------------------------------------------------------------- + * + * Macro: JSVERIFY_STR() + * + * Purpose: + * + * Verify that two strings are equal. + * If unequal, print failure message + * (with `reason`, if not NULL; expected/actual if NULL) + * and jump to `error` at end of function + * + * Programmer: Jacob Smith + * 2017-10-24 + * + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_STR(expected, actual, reason) \ +if (strcmp((actual), (expected)) != 0) { \ + JSERR_STR((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY_STR */ + + +#else +/* JSVERIFY_EXP_ACT not defined + * + * Repeats macros above, but with actual/expected parameters reversed. + */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY() + * See: JSVERIFY documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY(actual, expected, reason) \ +if ((long)(actual) != (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY */ + +#if 0 /* UNUSED */ + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY_NOT() + * See: JSVERIFY_NOT documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_NOT(actual, expected, reason) \ +if ((long)(actual) == (long)(expected)) { \ + JSERR_LONG((expected), (actual), (reason)) \ + goto error; \ +} /* JSVERIFY_NOT */ +#endif /* JSVERIFY_NOT unused */ + + +/*---------------------------------------------------------------------------- + * Macro: JSVERIFY_STR() + * See: JSVERIFY_STR documentation above. + * Programmer: Jacob Smith + * 2017-10-14 + *---------------------------------------------------------------------------- + */ +#define JSVERIFY_STR(actual, expected, reason) \ +if (strcmp((actual), (expected)) != 0) { \ + JSERR_STR((expected), (actual), (reason)); \ + goto error; \ +} /* JSVERIFY_STR */ + +#endif /* ifdef/else JSVERIFY_EXP_ACT */ + + +#define S3_TEST_PROFILE_NAME "ros3_vfd_test" + +#define S3_TEST_RESOURCE_TEXT_RESTRICTED "t8.shakespeare.txt" +#define S3_TEST_RESOURCE_TEXT_PUBLIC "Poe_Raven.txt" +#define S3_TEST_RESOURCE_MISSING "missing.csv" + +#define S3_TEST_RUN_TIMEOUT 0 /* run tests that might hang */ +#define S3_TEST_MAX_URL_SIZE 256 /* char array size */ + +/* Global variables for aws test profile. + * An attempt is made to read ~/.aws/credentials and ~/.aws/config upon test + * startup -- if unable to open either file or cannot load region, id, and key, + * tests connecting with S3 will not be run + */ +static int s3_test_credentials_loaded = 0; +static char s3_test_aws_region[16] = ""; +static char s3_test_aws_access_key_id[64] = ""; +static char s3_test_aws_secret_access_key[128] = ""; +static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = ""; +static hbool_t s3_test_bucket_defined = FALSE; + + +/*--------------------------------------------------------------------------- + * + * Function: test_macro_format_credential() + * + * Purpose: + * + * Demonstrate that the macro `S3COMMS_FORMAT_CREDENTIAL` + * performs as expected. + * + * Programmer: Jacob Smith + * 2017-09-19 + * + *---------------------------------------------------------------------------- + */ +static herr_t +test_macro_format_credential(void) +{ + /************************ + * test-local variables * + ************************/ + + char dest[256]; + const char access[] = "AKIAIOSFODNN7EXAMPLE"; + const char date[] = "20130524"; + const char region[] = "us-east-1"; + const char service[] = "s3"; + const char expected[] = + "AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request"; + + TESTING("test_macro_format_credential"); + + FAIL_IF( S3COMMS_MAX_CREDENTIAL_SIZE < + S3COMMS_FORMAT_CREDENTIAL(dest, access, date, region, service) ) + + JSVERIFY_STR( expected, dest, NULL ) + + PASSED(); + return 0; + +error: + return -1; + +} /* end test_macro_format_credential() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_aws_canonical_request() + * + * Purpose: + * + * Demonstrate the construction of a Canoncial Request (and Signed Headers) + * + * Elided / not yet implemented: + * Query strings + * request "body" + * + * Programmer: Jacob Smith + * 2017-10-04 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_aws_canonical_request(void) +{ + /************************* + * test-local structures * + *************************/ + + struct header { + const char *name; + const char *value; + }; + + struct testcase { + const char *exp_request; + const char *exp_headers; + const char *verb; + const char *resource; + unsigned int listsize; + struct header list[5]; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { "GET\n/some/path.file\n\nhost:somebucket.someserver.somedomain\nrange:bytes=150-244\n\nhost;range\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "host;range", + "GET", + "/some/path.file", + 2, + { {"Range", "bytes=150-244"}, + {"Host", "somebucket.someserver.somedomain"}, + }, + }, + { "HEAD\n/bucketpath/myfile.dat\n\nhost:place.domain\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:19411207T150803Z\n\nhost;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "host;x-amz-content-sha256;x-amz-date", + "HEAD", + "/bucketpath/myfile.dat", + 3, + { {"x-amz-content-sha256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + {"host", "place.domain"}, + {"x-amz-date", "19411207T150803Z"}, + } + }, + { "PUT\n/\n\n\n\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "", + "PUT", + "/", + 0, + {{"",""},}, /* unused; satisfies compiler */ + }, + }; /* struct testcase cases[] */ + struct testcase *C = NULL; + char cr_dest[512]; /* canonical request */ + hrb_t *hrb = NULL; /* http request buffer object */ + unsigned int i = 0; /* looping/indexing */ + unsigned int j = 0; /* looping/indexing */ + hrb_node_t *node = NULL; /* http headers list pointer */ + unsigned int n_cases = 3; + char sh_dest[64]; /* signed headers */ + + TESTING("test_aws_canonical_request"); + + for (i = 0; i < n_cases; i++) { + /* pre-test bookkeeping + */ + C = &cases[i]; + for (j = 0; j < 256; j++) { cr_dest[j] = 0; } /* zero request buffer */ + for (j = 0; j < 64; j++) { sh_dest[j] = 0; } /* zero headers buffer */ + + /* create HTTP request object with given verb, resource/path + */ + hrb = H5FD_s3comms_hrb_init_request(C->verb, + C->resource, + "HTTP/1.1"); + HDassert(hrb->body == NULL); + + /* Create headers list from test case input + */ + for (j = 0; j < C->listsize; j++) { + FAIL_IF( FAIL == + H5FD_s3comms_hrb_node_set( + &node, + C->list[j].name, + C->list[j].value)); + } + + hrb->first_header = node; + + /* test + */ + JSVERIFY( SUCCEED, + H5FD_s3comms_aws_canonical_request( + cr_dest, + 512, + sh_dest, + 64, + hrb), + " unable to compose canonical request" ) + JSVERIFY_STR( C->exp_headers, sh_dest, NULL ) + JSVERIFY_STR( C->exp_request, cr_dest, NULL ) + + /* tear-down + */ + while (node != NULL) { + FAIL_IF( FAIL == + H5FD_s3comms_hrb_node_set(&node, node->name, NULL)); + } + HDassert(NULL == node); + FAIL_IF( FAIL == H5FD_s3comms_hrb_destroy(&hrb)); + HDassert(NULL == hrb); + + } /* for each test case */ + + /*************** + * ERROR CASES * + ***************/ + + /* malformed hrb and/or node-list + */ + JSVERIFY( FAIL, H5FD_s3comms_aws_canonical_request( + cr_dest, + 20, + sh_dest, + 20, + NULL), + "http request object cannot be null" ) + + hrb = H5FD_s3comms_hrb_init_request("GET", "/", "HTTP/1.1"); + JSVERIFY( FAIL, H5FD_s3comms_aws_canonical_request( + NULL, + 20, + sh_dest, + 20, + hrb), + "canonical request destination cannot be NULL" ) + + JSVERIFY( FAIL, H5FD_s3comms_aws_canonical_request( + cr_dest, + 20, + NULL, + 20, + hrb), + "signed headers destination cannot be null" ) + + FAIL_IF( FAIL == H5FD_s3comms_hrb_destroy(&hrb) ) + HDassert( NULL == hrb ); + + PASSED(); + return 0; + +error: + + if (node != NULL) { + while (node != NULL) + (void)H5FD_s3comms_hrb_node_set(&node, node->name, NULL); + HDassert( node == NULL ); + } + if (hrb != NULL) { + (void)H5FD_s3comms_hrb_destroy(&hrb); + } + + return -1; + +} /* end test_aws_canonical_request() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_bytes_to_hex + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_bytes_to_hex()`. + * + * Return: + * + * Success: 0 + * Failure: -1 + * + * Programmer: Jacob Smith + * 2017-09-14 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_bytes_to_hex(void) +{ + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char exp[17]; /* in size * 2 + 1 for null terminator */ + const unsigned char in[8]; + size_t size; + hbool_t lower; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { "52F3000C9A", + {82,243,0,12,154}, + 5, + FALSE, + }, + { "009a0cf3005200", /* lowercase alphas */ + {0,154,12,243,0,82,0}, + 7, + TRUE, + }, + { "", + {17,63,26,56}, + 0, + FALSE, /* irrelevant */ + }, + }; + int i = 0; + int n_cases = 3; + char out[17]; + int out_off = 0; + + + + TESTING("bytes-to-hex"); + + for (i = 0; i < n_cases; i++) { + for (out_off = 0; out_off < 17; out_off++) { + out[out_off] = 0; + } + + JSVERIFY( SUCCEED, + H5FD_s3comms_bytes_to_hex(out, + cases[i].in, + cases[i].size, + cases[i].lower), + NULL ) + + JSVERIFY_STR(cases[i].exp, out, NULL) + } + + /* dest cannot be null + */ + JSVERIFY( FAIL, + H5FD_s3comms_bytes_to_hex( + NULL, + (const unsigned char *)"nada", + 5, + FALSE), + "destination cannot be null" ) + + PASSED(); + return 0; + +error: + return -1; + +} /* end test_bytes_to_hex() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_hrb_init_request() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_hrb_init_request()` + * + * Programmer: Jacob Smith + * 2017-09-20 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_hrb_init_request(void) +{ + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char msg[64]; + const char *verb; + const char *resource; + const char *exp_res; + const char *version; + hbool_t ret_null; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { "get HTTP request just as we provided", + "GET", + "/path/to/some/file", + "/path/to/some/file", + "HTTP/1.1", + FALSE, + }, + { "null verb substitues to GET", + NULL, + "/MYPATH/MYFILE.tiff", + "/MYPATH/MYFILE.tiff", + "HTTP/1.1", + FALSE, + }, + { "demonstrate non-GET verb", + "HEAD", + "/MYPATH/MYFILE.tiff", + "/MYPATH/MYFILE.tiff", + "HTTP/1.1", + FALSE, + }, + { "slash prepended to resource path, if necessary", + NULL, + "MYPATH/MYFILE.tiff", + "/MYPATH/MYFILE.tiff", + NULL, + FALSE, + }, + { "null resource path causes problem", + "GET", + NULL, + NULL, + NULL, + TRUE, + }, + }; + struct testcase *C = NULL; + unsigned int i = 0; + unsigned int ncases = 5; + hrb_t *req = NULL; + + TESTING("hrb_init_request"); + + for (i = 0; i < ncases; i++) { + C = &cases[i]; + req = H5FD_s3comms_hrb_init_request( + C->verb, + C->resource, + C->version); + if (cases[i].ret_null == TRUE) { + FAIL_IF( req != NULL ); + } + else { + FAIL_IF( req == NULL ); + JSVERIFY( S3COMMS_HRB_MAGIC, req->magic, NULL ) + if (C->verb == NULL) { + JSVERIFY_STR( "GET", req->verb, NULL ) + } + else { + JSVERIFY_STR( req->verb, C->verb, NULL ) + } + JSVERIFY_STR( "HTTP/1.1", req->version, NULL ) + JSVERIFY_STR( C->exp_res, req->resource, NULL ) + FAIL_IF( req->first_header != NULL ); + FAIL_IF( req->body != NULL ); + JSVERIFY( 0, req->body_len, NULL ) + JSVERIFY( SUCCEED, H5FD_s3comms_hrb_destroy(&req), + "unable to destroy hrb_t" ) + FAIL_IF( NULL != req ); /* should annull pointer as well as free */ + } + + } /* end for each testcase */ + + PASSED(); + return 0; + +error: + (void)H5FD_s3comms_hrb_destroy(&req); + + return -1; + +} /* end test_hrb_init_request() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_hrb_node_set() + * + * Purpose: + * + * Test operations on hrb_node_t structure + * + * Programmer: Jacob Smith + * 2017-09-22 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_hrb_node_set(void) +{ + /************************* + * test-local structures * + *************************/ + + /* bundle of name/value representing an hrb_node_t + */ + typedef struct node_mock_t { + const char *name; + const char *value; + } node_mock_t; + + /* bundle for a testcase + * + * `message` + * purpose of the testcase + * + * `delta` + * container for name and value strings to pass into node-set function + * to to modify the list. + * + * `returned` + * expected return value of node-set function + * + * `given` + * `expected` + * string arrays representing the state of the list before and after + * modification. The number of strings must be even, with each name + * paired to a value. `NULL` terminates the list, with `{NULL}` + * representing the empty list. + */ + typedef struct testcase { + const char *message; + node_mock_t delta; + herr_t returned; + const char *given[11]; /* name/value pairs in array; NULL sentinel */ + const char *expected[11]; + } testcase; + + /************************ + * test-local variables * + ************************/ + + testcase cases[] = { + { "cannot remove node from null list", + { "Host", NULL }, + FAIL, + {NULL}, + {NULL}, + }, + { "cannot create list with NULL field name", + { NULL, "somevalue" }, + FAIL, + {NULL}, + {NULL}, + }, + { "create a new list", + { "Host", "somevalue" }, + SUCCEED, + {NULL}, + { "Host", "somevalue", + NULL, + }, + }, + { "insert new node at head list", + { "Host", "somevalue" }, + SUCCEED, + { "Range", "bytes=20-40", + NULL, + }, + { "Host", "somevalue", + "Range", "bytes=20-40", + NULL, + }, + }, + { "append new node at list end", + { "x-amz-date", "somevalue" }, + SUCCEED, + { "Range", "bytes=20-40", + NULL, + }, + { "Range", "bytes=20-40", + "x-amz-date", "somevalue", + NULL, + }, + }, + { "insert new node inside list", + { "Intermediary", "somevalue" }, + SUCCEED, + { "Host", "somehost" , + "Range", "bytes=20-40", + NULL, + }, + { "Host", "somehost", + "Intermediary", "somevalue", + "Range", "bytes=20-40", + NULL, + }, + }, + { "modify node", + { "Range", "bytes=40-80" }, + SUCCEED, + { "Host", "somehost", + "Range", "bytes=20-40", + NULL, + }, + { "Host", "somehost", + "Range", "bytes=40-80", + NULL, + }, + }, + { "modify node with new case", + { "RANGE", "bytes=40-80" }, + SUCCEED, + { "Host", "somehost", + "Range", "bytes=20-40", + NULL, + }, + { "Host", "somehost", + "RANGE", "bytes=40-80", + NULL, + }, + }, + { "cannot add node with no name", + { NULL, "bytes=40-80" }, + FAIL, + { "Host", "somehost", + NULL, + }, + { "Host", "somehost", + NULL, + }, + }, + { "add node with 'empty' name", + { "", "bytes=40-80" }, + SUCCEED, + { "Host", "somehost", + NULL, + }, + { "", "bytes=40-80", + "Host", "somehost", + NULL, + }, + }, + { "remove node from end of list", + { "Host", NULL }, + SUCCEED, + { "Date", "Thr, 25 Jan 2018", + "Host", "somehost", + NULL, + }, + { "Date", "Thr, 25 Jan 2018", + NULL, + }, + }, + { "remove node from middle of list", + { "Host", NULL }, + SUCCEED, + { "Date", "Thr, 25 Jan 2018", + "Host", "somehost", + "Range", "bytes=20-40", + NULL, + }, + { "Date", "Thr, 25 Jan 2018", + "Range", "bytes=20-40", + NULL, + }, + }, + { "remove node from start of list", + { "Date", NULL }, + SUCCEED, + { "Date", "Thr, 25 Jan 2018", + "Host", "somehost", + "Range", "bytes=20-40", + NULL, + }, + { "Host", "somehost", + "Range", "bytes=20-40", + NULL, + }, + }, + { "remove only node in list", + { "Date", NULL }, + SUCCEED, + { "Date", "Thr, 25 Jan 2018", + NULL, + }, + { NULL, + }, + }, + { "attempt to remove absent node fails", + { "Host", NULL }, + FAIL, + { "Date", "Thr, 25 Jan 2018", + "Range", "bytes=20-40", + NULL, + }, + { "Date", "Thr, 25 Jan 2018", + "Range", "bytes=20-40", + NULL, + }, + }, + { "removal is case-insensitive", + { "hOsT", NULL }, + SUCCEED, + { "Date", "Thr, 25 Jan 2018", + "Host", "somehost", + "Range", "bytes=20-40", + NULL, + }, + { "Date", "Thr, 25 Jan 2018", + "Range", "bytes=20-40", + NULL, + }, + }, + }; + unsigned testcases_count = 16; + unsigned test_i = 0; + hrb_node_t *list = NULL; + + TESTING("hrb_node_t (test_hrb_node_set)"); + + for (test_i = 0; test_i < testcases_count; test_i++) { + const hrb_node_t *node = NULL; + const testcase *test = &(cases[test_i]); + unsigned mock_i = 0; + + /********* + * SETUP * + *********/ + + for (mock_i = 0; test->given[mock_i] != NULL; mock_i += 2) { + const char *name = test->given[mock_i]; + const char *valu = test->given[mock_i+1]; + + FAIL_IF( SUCCEED != + H5FD_s3comms_hrb_node_set(&list, name, valu) ) + } + /******** + * TEST * + ********/ + + /* perform modification on list + */ + JSVERIFY( test->returned, + H5FD_s3comms_hrb_node_set(&list, + test->delta.name, + test->delta.value), + test->message ) + + + /* verify resulting list + */ + node = list; + mock_i = 0; + while (test->expected[mock_i] != NULL && node != NULL) { + const char *name = test->expected[mock_i]; + const char *valu = test->expected[mock_i+1]; + + JSVERIFY_STR( name, node->name, NULL ) + JSVERIFY_STR( valu, node->value, NULL ) + + mock_i += 2; + node = node->next; + } + FAIL_IF( test->expected[mock_i] != NULL ) + FAIL_IF( node != NULL ) + + /************ + * TEARDOWN * + ************/ + + while (list != NULL) { + FAIL_IF( SUCCEED != + H5FD_s3comms_hrb_node_set(&list, list->name, NULL) ) + } + } /* end for each testcase */ + + PASSED(); + return 0; + +error: + while (list != NULL) { + (void)H5FD_s3comms_hrb_node_set(&list, list->name, NULL); + } + + return -1; + +} /* end test_hrb_node_t() */ + + + +/*--------------------------------------------------------------------------- + * + * Function: test_HMAC_SHA256() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_HMAC_SHA256()` + * + * Programmer: Jacob Smith + * 2017-09-19 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_HMAC_SHA256(void) +{ + + /************************* + * test-local structures * + *************************/ + + struct testcase { + herr_t ret; /* SUCCEED/FAIL expected from call */ + const unsigned char key[SHA256_DIGEST_LENGTH]; + size_t key_len; + const char *msg; + size_t msg_len; + const char *exp; /* not used if ret == FAIL */ + size_t dest_size; /* if 0, `dest` is not malloc'd */ + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { SUCCEED, + { 0xdb, 0xb8, 0x93, 0xac, 0xc0, 0x10, 0x96, 0x49, + 0x18, 0xf1, 0xfd, 0x43, 0x3a, 0xdd, 0x87, 0xc7, + 0x0e, 0x8b, 0x0d, 0xb6, 0xbe, 0x30, 0xc1, 0xfb, + 0xea, 0xfe, 0xfa, 0x5e, 0xc6, 0xba, 0x83, 0x78, + }, + SHA256_DIGEST_LENGTH, + "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972", + HDstrlen("AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972"), + "f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41", + SHA256_DIGEST_LENGTH * 2 + 1, /* +1 for null terminator */ + }, + { SUCCEED, + {'J','e','f','e'}, + 4, + "what do ya want for nothing?", + 28, + "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843", + SHA256_DIGEST_LENGTH * 2 + 1, + }, + { FAIL, + "DOESN'T MATTER", + 14, + "ALSO IRRELEVANT", + 15, + NULL, + 0, /* dest -> null, resulting in immediate error */ + }, + }; + char *dest = NULL; + int i = 0; + int n_cases = 3; + + TESTING("HMAC_SHA256"); + + for (i = 0; i < n_cases; i++) { + if (cases[i].dest_size == 0) { + dest = NULL; + } else { + dest = (char *)HDmalloc(sizeof(char) * cases[i].dest_size); + HDassert(dest != NULL); + } + + JSVERIFY( cases[i].ret, + H5FD_s3comms_HMAC_SHA256( + cases[i].key, + cases[i].key_len, + cases[i].msg, + cases[i].msg_len, + dest), + cases[i].msg ); + if (cases[i].ret == SUCCEED) { +#ifdef VERBOSE + if (0 != + strncmp(cases[i].exp, + dest, + HDstrlen(cases[i].exp))) + { + /* print out how wrong things are, and then fail + */ + dest = (char *)realloc(dest, cases[i].dest_size + 1); + HDassert(dest != NULL); + dest[cases[i].dest_size] = 0; + HDfprintf(stdout, + "ERROR:\n!!! \"%s\"\n != \"%s\"\n", + cases[i].exp, + dest); + TEST_ERROR; + } +#else /* VERBOSE not defined */ + /* simple pass/fail test + */ + JSVERIFY( 0, + strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), + NULL); +#endif /* VERBOSE */ + } + free(dest); + } + + PASSED(); + return 0; + +error: + free(dest); + return -1; + +} /* end test_HMAC_SHA256() */ + + +/*---------------------------------------------------------------------------- + * + * Function: test_nlowercase() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_nlowercase()` + * + * Programmer: Jacob Smith + * 2017-19-18 + * + *---------------------------------------------------------------------------- + */ +static herr_t +test_nlowercase(void) +{ + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char *in; + size_t len; + const char *exp; + }; + + /************************ + * test-local variables * + ************************/ + + /* any character after in exp on or after exp[len] is undefined. + * in this test, kept as the null character for simplicity. + */ + struct testcase cases[] = { + { "HALlEluJAh", + 6, + "hallel", + }, + { "all\0 lower", + 10, + "all\0 lower", + }, + { "to meeeeeee", + 0, + "", + }, + }; + char *dest = NULL; + int i = 0; + int n_cases = 3; + + TESTING("nlowercase"); + + for (i = 0; i < n_cases; i++) { + dest = (char *)HDmalloc(sizeof(char) * 16); + + JSVERIFY( SUCCEED, + H5FD_s3comms_nlowercase(dest, + cases[i].in, + cases[i].len), + cases[i].in ) + if (cases[i].len > 0) { + JSVERIFY( 0, strncmp(dest, cases[i].exp, cases[i].len), NULL ) + } + free(dest); + } /* end for each testcase */ + + JSVERIFY( FAIL, + H5FD_s3comms_nlowercase(NULL, + cases[0].in, + cases[0].len), + "null distination should fail" ) + + PASSED(); + return 0; + +error: + free(dest); + return -1; + +} /* end test_nlowercase() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_parse_url() + * + * Programmer: Jacob Smith + * 2017-11-?? + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_parse_url(void) +{ + /********************* + * test-local macros * + *********************/ + + /************************* + * test-local structures * + *************************/ + + typedef struct { + const char *scheme; + const char *host; + const char *port; + const char *path; + const char *query; + } const_purl_t; + + struct testcase { + const char *url; + herr_t exp_ret; /* expected return; */ + /* if FAIL, `expected` is unused */ + const_purl_t expected; + const char *msg; + }; + + /************************ + * test-local variables * + ************************/ + + parsed_url_t *purl = NULL; + unsigned int i = 0; + unsigned int ncases = 15; + struct testcase cases[] = { + { NULL, + FAIL, + { NULL, NULL, NULL, NULL, NULL }, + "null url", + }, + { "", + FAIL, + { NULL, NULL, NULL, NULL, NULL }, + "empty url", + }, + { "ftp://[1000:4000:0002:2010]", + SUCCEED, + { "ftp", + "[1000:4000:0002:2010]", + NULL, + NULL, + NULL, + }, + "IPv6 ftp and empty path (root)", + }, + { "ftp://[1000:4000:0002:2010]:2040", + SUCCEED, + { "ftp", + "[1000:4000:0002:2010]", + "2040", + NULL, + NULL, + }, + "root IPv6 ftp with port", + }, + { "http://some.domain.org:9000/path/to/resource.txt", + SUCCEED, + { "http", + "some.domain.org", + "9000", + "path/to/resource.txt", + NULL, + }, + "without query", + }, + { "https://domain.me:00/file.txt?some_params unchecked", + SUCCEED, + { "https", + "domain.me", + "00", + "file.txt", + "some_params unchecked", + }, + "with query", + }, + { "ftp://domain.com/", + SUCCEED, + { "ftp", + "domain.com", + NULL, + NULL, + NULL, + }, + "explicit root w/out port", + }, + { "ftp://domain.com:1234/", + SUCCEED, + { "ftp", + "domain.com", + "1234", + NULL, + NULL, + }, + "explicit root with port", + }, + { "ftp://domain.com:1234/file?", + FAIL, + { NULL, NULL, NULL, NULL, NULL, }, + "empty query is invalid", + }, + { "ftp://:1234/file", + FAIL, + { NULL, NULL, NULL, NULL, NULL, }, + "no host", + }, + { "h&r block", + FAIL, + { NULL, NULL, NULL, NULL, NULL, }, + "no scheme (bad URL)", + }, + { "http://domain.com?a=b&d=b", + SUCCEED, + { "http", + "domain.com", + NULL, + NULL, + "a=b&d=b", + }, + "QUERY with implict PATH", + }, + { "http://[5]/path?a=b&d=b", + SUCCEED, + { "http", + "[5]", + NULL, + "path", + "a=b&d=b", + }, + "IPv6 extraction is really dumb", + }, + { "http://[1234:5678:0910:1112]:port/path", + FAIL, + { NULL, NULL, NULL, NULL, NULL, }, + "non-decimal PORT (port)", + }, + { "http://mydomain.com:01a3/path", + FAIL, + { NULL, NULL, NULL, NULL, NULL, }, + "non-decimal PORT (01a3)", + }, + }; + + TESTING("url-parsing functionality"); + + /********* + * TESTS * + *********/ + + for (i = 0; i < ncases; i++) { + HDassert( purl == NULL ); + + JSVERIFY( cases[i].exp_ret, + H5FD_s3comms_parse_url(cases[i].url, &purl), + cases[i].msg ) + + if (cases[i].exp_ret == FAIL) { + /* on FAIL, `purl` should be untouched--remains NULL */ + FAIL_UNLESS( purl == NULL ) + } + else { + /* on SUCCEED, `purl` should be set */ + FAIL_IF( purl == NULL ) + + if (cases[i].expected.scheme != NULL) { + FAIL_IF( NULL == purl->scheme ) + JSVERIFY_STR( cases[i].expected.scheme, + purl->scheme, + cases[i].msg ) + } else { + FAIL_UNLESS( NULL == purl->scheme ) + } + + if (cases[i].expected.host != NULL) { + FAIL_IF( NULL == purl->host ) + JSVERIFY_STR( cases[i].expected.host, + purl->host, + cases[i].msg ) + } else { + FAIL_UNLESS( NULL == purl->host ) + } + + if (cases[i].expected.port != NULL) { + FAIL_IF( NULL == purl->port ) + JSVERIFY_STR( cases[i].expected.port, + purl->port, + cases[i].msg ) + } else { + FAIL_UNLESS( NULL == purl->port ) + } + + if (cases[i].expected.path != NULL) { + FAIL_IF( NULL == purl->path ) + JSVERIFY_STR( cases[i].expected.path, + purl->path, + cases[i].msg ) + } else { + FAIL_UNLESS( NULL == purl->path ) + } + + if (cases[i].expected.query != NULL) { + FAIL_IF( NULL == purl->query ) + JSVERIFY_STR( cases[i].expected.query, + purl->query, + cases[i].msg ) + } else { + FAIL_UNLESS( NULL == purl->query ) + } + } /* end if parse-url return SUCCEED/FAIL */ + + /* per-test cleanup + * well-behaved, even if `purl` is NULL + */ + FAIL_IF( FAIL == H5FD_s3comms_free_purl(purl) ) + purl = NULL; + + } /* end for each testcase */ + + PASSED(); + return 0; + +error: + /*********** + * cleanup * + ***********/ + (void)H5FD_s3comms_free_purl(purl); + + return -1; + +} /* end test_parse_url() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_percent_encode_char() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_percent_encode_char()` + * + * Return: + * + * Success: 0 + * Failure: -1 + * + * Programmer: Jacob Smith + * 2017-09-14 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_percent_encode_char(void) +{ + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char c; + const char *exp; + size_t exp_len; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + {'$', "%24", 3}, /* u+0024 dollar sign */ + {' ', "%20", 3}, /* u+0020 space */ + {'^', "%5E", 3}, /* u+0094 carat */ + {'/', "%2F", 3}, /* u+002f solidus (forward slash) */ + /* {??, "%C5%8C", 6},*/ /* u+014c Latin Capital Letter O with Macron */ + /* Not included because it is multibyte "wide" character that poses */ + /* issues both in the underlying function and in being written in */ + /* this file. */ + /* {'¢', "%C2%A2", 6}, */ /* u+00a2 cent sign */ + /* above works, but complains about wide character overflow */ + /* Elide for now, until it is determined (a) unnecessary or */ + /* (b) requiring signature change to accommodate wide characters */ + {'\0', "%00", 3}, /* u+0000 null */ + }; + char dest[13]; + size_t dest_len = 0; + int i = 0; + int n_cases = 5; + + TESTING("percent encode characters"); + + for (i = 0; i < n_cases; i++) { + JSVERIFY( SUCCEED, + H5FD_s3comms_percent_encode_char( + dest, + (const unsigned char)cases[i].c, + &dest_len), + NULL ) + JSVERIFY(cases[i].exp_len, dest_len, NULL ) + JSVERIFY(0, strncmp(dest, cases[i].exp, dest_len), NULL ) + JSVERIFY_STR( cases[i].exp, dest, NULL ) + } + + JSVERIFY( FAIL, + H5FD_s3comms_percent_encode_char( + NULL, + (const unsigned char)'^', + &dest_len), + NULL ) + + PASSED(); + return 0; + +error: + return -1; +} /* end test_percent_encode_char() */ + + +/*--------------------------------------------------------------------------- + * Function: test_s3r_open() + * + * Programmer: Jacob Smith 2018-01-24 + * + * Changes: None + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_s3r_get_filesize(void) +{ + + /************************ + * test-local variables * + ************************/ + + char url_raven[S3_TEST_MAX_URL_SIZE]; + s3r_t *handle = NULL; + + TESTING("s3r_get_filesize"); + + /* setup -- compose url to target resource + */ + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + FAIL_IF( S3_TEST_MAX_URL_SIZE < + HDsnprintf(url_raven, + S3_TEST_MAX_URL_SIZE, + "%s/%s", + s3_test_bucket_url, + S3_TEST_RESOURCE_TEXT_PUBLIC) ); + + JSVERIFY( 0, H5FD_s3comms_s3r_get_filesize(NULL), + "filesize of the null handle should be 0" ) + + handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL); + FAIL_IF( handle == NULL ) + + JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), NULL ) + + + FAIL_IF( SUCCEED != H5FD_s3comms_s3r_close(handle) ) + + PASSED(); + return 0; + +error: + if (handle != NULL) + (void)H5FD_s3comms_s3r_close(handle); + + return -1; + +} /* end test_s3r_get_filesize() */ + + +/*--------------------------------------------------------------------------- + * Function: test_s3r_open() + * + * Programmer: Jacob Smith 2018-01-?? + * + * Changes: None + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_s3r_open(void) +{ + + /************************ + * test-local variables * + ************************/ + + char url_missing[S3_TEST_MAX_URL_SIZE]; + char url_raven[S3_TEST_MAX_URL_SIZE]; + char url_raven_badport[S3_TEST_MAX_URL_SIZE]; + char url_shakespeare[S3_TEST_MAX_URL_SIZE]; + unsigned char signing_key[SHA256_DIGEST_LENGTH]; + struct tm *now = NULL; + char iso8601now[ISO8601_SIZE]; + s3r_t *handle = NULL; + hbool_t curl_ready = FALSE; + parsed_url_t *purl = NULL; + + TESTING("s3r_open"); + + if (s3_test_credentials_loaded == 0) { + SKIPPED(); + puts(" s3 credentials are not loaded"); + fflush(stdout); + return 0; + } + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + /****************** + * PRE-TEST SETUP * + ******************/ + + FAIL_IF( S3_TEST_MAX_URL_SIZE < + HDsnprintf(url_shakespeare, + S3_TEST_MAX_URL_SIZE, + "%s/%s", + s3_test_bucket_url, + S3_TEST_RESOURCE_TEXT_RESTRICTED) ); + + FAIL_IF( S3_TEST_MAX_URL_SIZE < + HDsnprintf(url_missing, + S3_TEST_MAX_URL_SIZE, + "%s/%s", + s3_test_bucket_url, + S3_TEST_RESOURCE_MISSING) ); + + FAIL_IF( S3_TEST_MAX_URL_SIZE < + HDsnprintf(url_raven, + S3_TEST_MAX_URL_SIZE, + "%s/%s", + s3_test_bucket_url, + S3_TEST_RESOURCE_TEXT_PUBLIC) ); + + /* Set given bucket url with invalid/inactive port number for badport. + * Note, this sort of micro-management of parsed_url_t is not advised + */ + FAIL_IF( FAIL == H5FD_s3comms_parse_url(s3_test_bucket_url, &purl) ) + if (purl->port == NULL) { + purl->port = (char *)H5MM_malloc(sizeof(char) * 5); + FAIL_IF( purl->port == NULL ); + FAIL_IF( 5 < HDsnprintf(purl->port, 5, "9000") ) + } else if (strcmp(purl->port, "9000") != 0) { + FAIL_IF( 5 < HDsnprintf(purl->port, 5, "9000") ) + } else { + FAIL_IF( 5 < HDsnprintf(purl->port, 5, "1234") ) + } + FAIL_IF( S3_TEST_MAX_URL_SIZE < + HDsnprintf(url_raven_badport, + S3_TEST_MAX_URL_SIZE, + "%s://%s:%s/%s", + purl->scheme, + purl->host, + purl->port, + S3_TEST_RESOURCE_TEXT_PUBLIC) ); + + curl_global_init(CURL_GLOBAL_DEFAULT); + curl_ready = TRUE; + + now = gmnow(); + FAIL_IF( now == NULL ) + FAIL_IF( ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1) ); + + /* It is desired to have means available to verify that signing_key + * was set successfully and to an expected value. + */ + FAIL_IF( FAIL == + H5FD_s3comms_signing_key( + signing_key, + (const char *)s3_test_aws_secret_access_key, + (const char *)s3_test_aws_region, + (const char *)iso8601now) ); + + /************************* + * OPEN NONEXISTENT FILE * + *************************/ + + /* attempt anonymously + */ + handle = H5FD_s3comms_s3r_open(url_missing, NULL, NULL, NULL); + FAIL_IF( handle != NULL ); + + /* attempt with authentication + */ + handle = H5FD_s3comms_s3r_open( + url_missing, + (const char *)s3_test_aws_region, + (const char *)s3_test_aws_access_key_id, + (const unsigned char *)signing_key); + FAIL_IF( handle != NULL ); + + /************************* + * INACTIVE PORT ON HOST * + *************************/ + +#if S3_TEST_RUN_TIMEOUT + HDprintf("Opening on inactive port may hang for a minute; waiting for timeout\n"); + handle = H5FD_s3comms_s3r_open(url_raven_badport, NULL, NULL, NULL); + FAIL_IF( handle != NULL ); +#endif + + /******************************* + * INVALID AUTHENTICATION INFO * + *******************************/ + + /* anonymous access on restricted file + */ + handle = H5FD_s3comms_s3r_open(url_shakespeare, NULL, NULL, NULL); + FAIL_IF( handle != NULL ); + + /* passed in a bad ID + */ + handle = H5FD_s3comms_s3r_open( + url_shakespeare, + (const char *)s3_test_aws_region, + "I_MADE_UP_MY_ID", + (const unsigned char *)signing_key); + FAIL_IF( handle != NULL ); + + /* using an invalid signing key + */ + handle = H5FD_s3comms_s3r_open( + url_shakespeare, + (const char *)s3_test_aws_region, + (const char *)s3_test_aws_access_key_id, + (const unsigned char *)EMPTY_SHA256); + FAIL_IF( handle != NULL ); + + /******************************* + * SUCCESSFUL OPEN (AND CLOSE) * + *******************************/ + + /* anonymous + */ + handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL); + FAIL_IF( handle == NULL ); + JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), + "did not get expected filesize" ) + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_close(handle), + "unable to close file" ) + handle = NULL; + + /* using authentication on anonymously-accessible file? + */ + handle = H5FD_s3comms_s3r_open( + url_raven, + (const char *)s3_test_aws_region, + (const char *)s3_test_aws_access_key_id, + (const unsigned char *)signing_key); + FAIL_IF( handle == NULL ); + JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), NULL ) + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_close(handle), + "unable to close file" ) + handle = NULL; + + /* authenticating + */ + handle = H5FD_s3comms_s3r_open( + url_shakespeare, + (const char *)s3_test_aws_region, + (const char *)s3_test_aws_access_key_id, + (const unsigned char *)signing_key); + FAIL_IF( handle == NULL ); + JSVERIFY( 5458199, H5FD_s3comms_s3r_get_filesize(handle), NULL ) + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_close(handle), + "unable to close file" ) + handle = NULL; + + + + curl_global_cleanup(); + curl_ready = FALSE; + + FAIL_IF( FAIL == H5FD_s3comms_free_purl(purl) ) + purl = NULL; + + PASSED(); + return 0; +error: + /*********** + * cleanup * + ***********/ + + if (handle != NULL) + H5FD_s3comms_s3r_close(handle); + if (purl != NULL) + H5FD_s3comms_free_purl(purl); + if (curl_ready == TRUE) + curl_global_cleanup(); + + return -1; + +} /* end test_s3r_open() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_s3r_read() + * + * Purpose: + * + * Specify and demonstrate the use and life cycle of an S3 Request handle + * `s3r_t`, through its related functions. + * + * H5FD_s3comms_s3r_open + * H5FD_s3comms_s3r_getsize << called by open() _only_ + * H5FD_s3comms_s3r_read << called by getsize(), multiple times working + * H5FD_s3comms_s3r_close + * + * Shows most basic curl interation. + * + * Programmer: Jacob Smith + * 2017-10-06 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_s3r_read(void) +{ + +#define S3COMMS_TEST_BUFFER_SIZE 256 + + /************************ + * test-local variables * + ************************/ + + char url_raven[S3_TEST_MAX_URL_SIZE]; + char buffer[S3COMMS_TEST_BUFFER_SIZE]; + s3r_t *handle = NULL; + hbool_t curl_ready = FALSE; + unsigned int i = 0; + + TESTING("test_s3r_read"); + + /* + * initial setup + */ + if (FALSE == s3_test_bucket_defined) { + SKIPPED(); + puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + fflush(stdout); + return 0; + } + + curl_global_init(CURL_GLOBAL_DEFAULT); + curl_ready = TRUE; + FAIL_IF( S3_TEST_MAX_URL_SIZE < + HDsnprintf(url_raven, + S3_TEST_MAX_URL_SIZE, + "%s/%s", + s3_test_bucket_url, + S3_TEST_RESOURCE_TEXT_PUBLIC) ); + + for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++) + buffer[i] = '\0'; + + /* open file + */ + handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL); + FAIL_IF( handle == NULL ) + JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), NULL ) + + for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++) + buffer[i] = '\0'; + + /********************** + * read start of file * + **********************/ + + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)0, + (size_t)118, + buffer), + NULL ) + JSVERIFY_STR ( + "Once upon a midnight dreary, while I pondered, weak and weary,\n" \ + "Over many a quaint and curious volume of forgotten lore", + buffer, + NULL ) + + for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++) + buffer[i] = '\0'; + + /************************ + * read arbitrary range * + ************************/ + + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)2540, + (size_t)54, + buffer), + NULL ) + JSVERIFY_STR( "the grave and stern decorum of the countenance it wore", + buffer, + NULL ) + + for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++) + buffer[i] = '\0'; + + /********************** + * read one character * + **********************/ + + JSVERIFY(SUCCEED, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)2540, + (size_t)1, + buffer), + NULL ) + JSVERIFY_STR( "t", buffer, NULL ) + + + for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++) + buffer[i] = '\0'; + + /*************** + * read to EoF * + ***************/ + + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)6370, + (size_t)0, + buffer), + NULL ) + JSVERIFY( 0, + strncmp(buffer, + "And my soul from out that shadow that lies floating on the floor\nShall be lifted—nevermore!\n", + 94), + buffer ) + + for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++) + buffer[i] = '\0'; + + /***************** + * read past eof * + *****************/ + + JSVERIFY( FAIL, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)6400, + (size_t)100, /* 6400+100 > 6464 */ + buffer), + NULL ) + JSVERIFY( 0, strcmp("", buffer), NULL ) + + /************************ + * read starts past eof * + ************************/ + + JSVERIFY( FAIL, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)1200699, /* 1200699 > 6464 */ + (size_t)100, + buffer), + NULL ) + JSVERIFY( 0, strcmp("", buffer), NULL ) + + /********************** + * read starts on eof * + **********************/ + + JSVERIFY( FAIL, + H5FD_s3comms_s3r_read( + handle, + (haddr_t)6464, + (size_t)0, + buffer), + NULL ) + JSVERIFY( 0, strcmp("", buffer), NULL ) + + /************* + * TEAR DOWN * + *************/ + + JSVERIFY( SUCCEED, + H5FD_s3comms_s3r_close(handle), + "unable to close file" ) + handle = NULL; + + curl_global_cleanup(); + curl_ready = FALSE; + + PASSED(); + return 0; + +error: + /*********** + * cleanup * + ***********/ + + if (handle != NULL) + H5FD_s3comms_s3r_close(handle); + + if (curl_ready == TRUE) + curl_global_cleanup(); + + return -1; + +#undef S3COMMS_TEST_BUFFER_SIZE + +} /* end test_s3r_read() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_signing_key() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_signing_key()` + * + * More test cases would be a very good idea. + * + * Programmer: Jacob Smith + * 2017-09-18 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_signing_key(void) +{ + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char *region; + const char *secret_key; + const char *when; + unsigned char exp[SHA256_DIGEST_LENGTH]; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { "us-east-1", + "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + "20130524T000000Z", + { 0xdb, 0xb8, 0x93, 0xac, 0xc0, 0x10, 0x96, 0x49, + 0x18, 0xf1, 0xfd, 0x43, 0x3a, 0xdd, 0x87, 0xc7, + 0x0e, 0x8b, 0x0d, 0xb6, 0xbe, 0x30, 0xc1, 0xfb, + 0xea, 0xfe, 0xfa, 0x5e, 0xc6, 0xba, 0x83, 0x78, + }, + }, + }; + int i = 0; + unsigned char *key = NULL; + int ncases = 1; + + TESTING("signing_key"); + + for (i = 0; i < ncases; i++) { + key = (unsigned char *)HDmalloc(sizeof(unsigned char) * \ + SHA256_DIGEST_LENGTH); + HDassert(key != NULL); + + JSVERIFY( SUCCEED, + H5FD_s3comms_signing_key( + key, + cases[i].secret_key, + cases[i].region, + cases[i].when), + NULL ) + + JSVERIFY( 0, + strncmp((const char *)cases[i].exp, + (const char *)key, + SHA256_DIGEST_LENGTH), + cases[i].exp ) + + free(key); + key = NULL; + } + + + /*************** + * ERROR CASES * + ***************/ + + key = (unsigned char *)HDmalloc(sizeof(unsigned char) * \ + SHA256_DIGEST_LENGTH); + HDassert(key != NULL); + + JSVERIFY( FAIL, + H5FD_s3comms_signing_key( + NULL, + cases[0].secret_key, + cases[0].region, + cases[0].when), + "destination cannot be NULL" ) + + JSVERIFY( FAIL, + H5FD_s3comms_signing_key( + key, + NULL, + cases[0].region, + cases[0].when), + "secret key cannot be NULL" ) + + JSVERIFY( FAIL, + H5FD_s3comms_signing_key( + key, + cases[0].secret_key, + NULL, + cases[0].when), + "aws region cannot be NULL" ) + + JSVERIFY( FAIL, + H5FD_s3comms_signing_key( + key, + cases[0].secret_key, + cases[0].region, + NULL), + "time string cannot be NULL" ) + + free(key); + key = NULL; + + PASSED(); + return 0; + +error: + if (key != NULL) { + free(key); + } + + return -1; + +} /* end test_signing_key() */ + + +/*--------------------------------------------------------------------------- + * + * Function: test_tostringtosign() + * + * Purpose: + * + * Verify that we can get the "string to sign" from a Canonical Request and + * related information. + * + * Demonstrate failure cases. + * + * Return: + * + * Success: 0 + * Failure: -1 + * + * Programmer: Jacob Smith + * 2017-09-13 + * + *--------------------------------------------------------------------------- + */ +static herr_t +test_tostringtosign(void) +{ + /************************ + * test-local variables * + ************************/ + + const char canonreq[] = "GET\n/test.txt\n\nhost:examplebucket.s3.amazonaws.com\nrange:bytes=0-9\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20130524T000000Z\n\nhost;range;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + const char iso8601now[] = "20130524T000000Z"; + const char region[] = "us-east-1"; + char s2s[512]; + + TESTING("s3comms tostringtosign"); + + JSVERIFY( SUCCEED, + H5FD_s3comms_tostringtosign(s2s, canonreq, iso8601now, region), + "unable to create string to sign" ) + + JSVERIFY_STR( "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972", + s2s, NULL ) + + JSVERIFY( FAIL, + H5FD_s3comms_tostringtosign(s2s, NULL, iso8601now, region), + "canonical request string cannot be NULL" ) + + JSVERIFY( FAIL, + H5FD_s3comms_tostringtosign(s2s, canonreq, NULL, region), + "time string cannot be NULL" ) + + JSVERIFY( FAIL, + H5FD_s3comms_tostringtosign(s2s, canonreq, iso8601now, NULL), + "aws region cannot be NULL" ) + + PASSED(); + return 0; + +error : + return -1; + +} /* end test_tostringtosign() */ + + +/*---------------------------------------------------------------------------- + * + * Function: test_trim() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_trim()`. + * + * Programmer: Jacob Smith + * 2017-09-14 + * + *---------------------------------------------------------------------------- + */ +static herr_t +test_trim(void) +{ + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char *in; + size_t in_len; + const char *exp; + size_t exp_len; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { "block string", + 12, + "block string", + 12, + }, + { " \n\r \t", + 6, + "", + 0, + }, + { " \twhite b4", + 10, + "white b4", + 8, + }, + { "white after\r\n ", + 15, + "white after", + 11, + }, + { " on\nends\t", + 9, + "on\nends", + 7, + }, + }; + char dest[32]; + size_t dest_len = 0; + int i = 0; + int n_cases = 5; + char *str = NULL; + + + + TESTING("s3comms trim"); + + for (i = 0; i < n_cases; i++) { + HDassert(str == NULL); + str = (char *)HDmalloc(sizeof(char) * cases[i].in_len); + HDassert(str != NULL); + HDstrncpy(str, cases[i].in, cases[i].in_len); + + JSVERIFY( SUCCEED, + H5FD_s3comms_trim(dest, str, cases[i].in_len, &dest_len), + NULL ) + JSVERIFY( cases[i].exp_len, dest_len, cases[i].in ) + if (dest_len > 0) { + JSVERIFY( 0, strncmp(cases[i].exp, dest, dest_len), + cases[i].exp ) + } + free(str); + str = NULL; + } /* end for each testcase */ + + JSVERIFY( SUCCEED, H5FD_s3comms_trim(dest, NULL, 3, &dest_len), + "should not fail when trimming a null string" ); + JSVERIFY( 0, dest_len, "trimming NULL string writes 0 characters" ) + + HDassert(str == NULL); + str = (char *)HDmalloc(sizeof(char *) * 11); + HDassert(str != NULL); + memcpy(str, "some text ", 11); /* string with null terminator */ + JSVERIFY( FAIL, H5FD_s3comms_trim(NULL, str, 10, &dest_len), + "destination for trim cannot be NULL" ); + free(str); + str = NULL; + + PASSED(); + return 0; + +error: + if (str != NULL) { + free(str); + } + return -1; + +} /* end test_trim() */ + + +/*---------------------------------------------------------------------------- + * + * Function: test_uriencode() + * + * Purpose: + * + * Define and verify behavior of `H5FD_s3comms_uriencode()`. + * + * Programmer: Jacob Smith + * 2017-09-14 + * + *---------------------------------------------------------------------------- + */ +static herr_t +test_uriencode(void) +{ + /************************* + * test-local structures * + *************************/ + + struct testcase { + const char *str; + size_t s_len; + hbool_t encode_slash; + const char *expected; + }; + + /************************ + * test-local variables * + ************************/ + + struct testcase cases[] = { + { "/path/to/resource.jpg", + 21, + FALSE, + "/path/to/resource.jpg", + }, + { "/path/to/resource.jpg", + 21, + TRUE, + "%2Fpath%2Fto%2Fresource.jpg", + }, + { "string got_spaa ces", + 20, + TRUE, + "string%20got_spaa%20%20ces", + }, + { "sp ac~es/and-sl ash.encoded", + 27, + TRUE, + "sp%20ac~es%2Fand-sl%20ash.encoded", + }, + { "sp ac~es/and-sl ash.unencoded", + 29, + FALSE, + "sp%20ac~es/and-sl%20ash.unencoded", + }, + { "/path/to/resource.txt", + 0, + FALSE, + "", + + } + }; + char *dest = NULL; + size_t dest_written = 0; + int i = 0; + int ncases = 6; + size_t str_len = 0; + + + + TESTING("s3comms uriencode") + + for (i = 0; i < ncases; i++) { + str_len = cases[i].s_len; + dest = (char *)HDmalloc(sizeof(char) * str_len * 3 + 1); + FAIL_IF( dest == NULL ) + + JSVERIFY( SUCCEED, + H5FD_s3comms_uriencode( + dest, + cases[i].str, + str_len, + cases[i].encode_slash, + &dest_written), + NULL ); + JSVERIFY( HDstrlen(cases[i].expected), + dest_written, + NULL ) + JSVERIFY( 0, + strncmp(dest, cases[i].expected, dest_written), + cases[i].expected ); + + free(dest); + dest = NULL; + } /* end for each testcase */ + + /*************** + * ERROR CASES * + ***************/ + + dest = (char *)HDmalloc(sizeof(char) * 15); + HDassert(dest != NULL); + + JSVERIFY( FAIL, + H5FD_s3comms_uriencode(NULL, "word$", 5, false, &dest_written), + "destination cannot be NULL" ); + JSVERIFY( FAIL, + H5FD_s3comms_uriencode(dest, NULL, 5, false, &dest_written), + "source string cannot be NULL" ); + + free(dest); + dest = NULL; + + PASSED(); + return 0; + +error: + if (dest != NULL) { + free(dest); + } + return -1; + +} /* end test_uriencode() */ + +#endif /* H5_HAVE_ROS3_VFD */ + + + +/*------------------------------------------------------------------------- + * Function: main() + * + * Purpose: + * + * Run unit tests for S3 Communications (s3comms). + * + * Return: + * + * Success: 0 + * Failure: 1 + * + * Programmer: Jacob Smith + * 2017-10-12 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ +#ifdef H5_HAVE_ROS3_VFD + int nerrors = 0; + const char *bucket_url_env = NULL; + + h5_reset(); + +#endif /* H5_HAVE_ROS3_VFD */ + + HDprintf("Testing S3Communications functionality.\n"); + +#ifdef H5_HAVE_ROS3_VFD + + /* "clear" profile data strings */ + s3_test_aws_access_key_id[0] = '\0'; + s3_test_aws_secret_access_key[0] = '\0'; + s3_test_aws_region[0] = '\0'; + s3_test_bucket_url[0] = '\0'; + +/* TODO: unit/regression test for H5FD_s3comms_load_aws_profile() + * requires a few test files and/or manipulation of default path + */ + /* attempt to load test credentials + * if unable, certain tests will be skipped + */ + if (SUCCEED == H5FD_s3comms_load_aws_profile( + S3_TEST_PROFILE_NAME, + s3_test_aws_access_key_id, + s3_test_aws_secret_access_key, + s3_test_aws_region)) + { + s3_test_credentials_loaded = 1; + } + + bucket_url_env = HDgetenv("HDF5_ROS3_TEST_BUCKET_URL"); + if (bucket_url_env == NULL || bucket_url_env[0] == '\0') { + HDprintf("WARNING: S3 bucket url is not defined in enviornment " \ + "variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n"); + } + else { + HDstrncpy(s3_test_bucket_url, bucket_url_env, S3_TEST_MAX_URL_SIZE); + s3_test_bucket_defined = TRUE; + } + + /* tests ordered rougly by dependence */ + nerrors += test_macro_format_credential() < 0 ? 1 : 0; + nerrors += test_trim() < 0 ? 1 : 0; + nerrors += test_nlowercase() < 0 ? 1 : 0; + nerrors += test_uriencode() < 0 ? 1 : 0; + nerrors += test_percent_encode_char() < 0 ? 1 : 0; + nerrors += test_bytes_to_hex() < 0 ? 1 : 0; + nerrors += test_HMAC_SHA256() < 0 ? 1 : 0; + nerrors += test_signing_key() < 0 ? 1 : 0; + nerrors += test_hrb_node_set() < 0 ? 1 : 0; + nerrors += test_hrb_init_request() < 0 ? 1 : 0; + nerrors += test_parse_url() < 0 ? 1 : 0; + nerrors += test_aws_canonical_request() < 0 ? 1 : 0; + nerrors += test_tostringtosign() < 0 ? 1 : 0; + nerrors += test_s3r_open() < 0 ? 1 : 0; + nerrors += test_s3r_get_filesize() < 0 ? 1 : 0; + nerrors += test_s3r_read() < 0 ? 1 : 0; + + if (nerrors) { + HDprintf("***** %d S3comms TEST%s FAILED! *****\n", + nerrors, + nerrors > 1 ? "S" : ""); + return 1; + } + + HDprintf("All S3comms tests passed.\n"); + + return 0; + +#else + + HDprintf("SKIPPED - read-only S3 VFD not built\n"); + return EXIT_SUCCESS; + +#endif /* H5_HAVE_ROS3_VFD */ + +} /* end main() */ + diff --git a/test/set_extent.c b/test/set_extent.c index f6b02cf..20322a3 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -49,13 +49,13 @@ const char *FILENAME[] = { + CONFIG_EARLY_ALLOC + CONFIG_UNFILT_EDGE) #define FILL_VALUE -1 #define DO_RANKS_PRINT_CONFIG(TEST) { \ - printf(" Config:\n"); \ - printf(" Test: %s\n", TEST); \ - printf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \ - printf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \ - printf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \ + HDprintf(" Config:\n"); \ + HDprintf(" Test: %s\n", TEST); \ + HDprintf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \ + HDprintf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \ + HDprintf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \ : "no")); \ - printf(" Edge chunk filters: %s\n", (config & CONFIG_UNFILT_EDGE \ + HDprintf(" Edge chunk filters: %s\n", (config & CONFIG_UNFILT_EDGE \ ? "disabled" : "enabled")); \ } /* end DO_RANKS_PRINT_CONFIG */ @@ -136,8 +136,8 @@ int main( void ) hid_t fapl2; /* file access property list w/latest format set */ unsigned new_format; /* Whether to use the latest file format */ unsigned chunk_cache; /* Whether to enable chunk caching */ - int nerrors = 0; - const char *env_h5_drvr; /* File Driver value from environment */ + int nerrors = 0; + const char *env_h5_drvr; /* File Driver value from environment */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -173,17 +173,17 @@ int main( void ) for(chunk_cache = FALSE; chunk_cache <= TRUE; chunk_cache++) { /* Output message about the type of format */ if(new_format) - printf("Testing with new file format"); + HDprintf("Testing with new file format"); else - printf("Testing with old file format"); + HDprintf("Testing with old file format"); /* Set the FAPL for the chunk cache settings */ if(chunk_cache) { - puts(" and chunk cache enabled:"); + HDputs(" and chunk cache enabled:"); my_fapl = fapl; } /* end if */ else { - puts(" and chunk cache disabled:"); + HDputs(" and chunk cache disabled:"); my_fapl = fapl2; } /* end else */ @@ -201,15 +201,15 @@ int main( void ) H5F_LIBVER_LATEST) < 0) TEST_ERROR /* Tests which use chunked datasets */ - if(!new_format || (new_format && contig_addr_vfd)) - nerrors += do_ranks( my_fapl, new_format ) < 0 ? 1 : 0; + if(!new_format || (new_format && contig_addr_vfd)) + nerrors += do_ranks( my_fapl, new_format ) < 0 ? 1 : 0; } /* end for */ /* Tests which do not use chunked datasets */ - if(!new_format || (new_format && contig_addr_vfd)) { - nerrors += test_external( fapl ) < 0 ? 1 : 0; - nerrors += do_layouts( fapl ) < 0 ? 1 : 0; - } + if(!new_format || (new_format && contig_addr_vfd)) { + nerrors += test_external( fapl ) < 0 ? 1 : 0; + nerrors += do_layouts( fapl ) < 0 ? 1 : 0; + } } /* end for */ /* Close 2nd FAPL */ @@ -225,13 +225,13 @@ int main( void ) if(nerrors) goto error; - puts("All H5Dset_extent tests passed."); + HDputs("All H5Dset_extent tests passed."); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d H5Dset_extent TEST%s FAILED! *****\n", + HDprintf("***** %d H5Dset_extent TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } @@ -303,25 +303,25 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) if(test_rank1(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 1") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ if(test_rank3(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 3") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2 with non-default indexed storage B-tree") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ @@ -362,7 +362,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) /* Standard test */ if(test_random_rank4(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE, index_type) < 0) { DO_RANKS_PRINT_CONFIG("Randomized rank 4") - printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE + HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE ? "btree" : (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray")); goto error; @@ -372,7 +372,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) if(test_random_rank4_vl(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE, index_type) < 0) { DO_RANKS_PRINT_CONFIG("Randomized rank 4 variable length") - printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE + HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE ? "btree" : (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray")); goto error; @@ -383,7 +383,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) if(test_random_rank4(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE, index_type) < 0) { DO_RANKS_PRINT_CONFIG("Randomized rank 4 with sparse allocation") - printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE + HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE ? "btree" : (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray")); goto error; @@ -391,7 +391,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) if(test_random_rank4_vl(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE, index_type) < 0) { DO_RANKS_PRINT_CONFIG("Randomized rank 4 variable length with sparse allocation") - printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE + HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE ? "btree" : (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray")); goto error; @@ -558,10 +558,10 @@ static int test_rank1( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n buf_o: "); + HDprintf("\n buf_o: "); for (i = 0; i < (int)dims_o[0]; i++ ) - printf("%d ", buf_o[i]); - printf("\n"); + HDprintf("%d ", buf_o[i]); + HDprintf("\n"); #endif if(H5Sclose(sid) < 0) @@ -598,18 +598,18 @@ static int test_rank1( hid_t fapl, #if defined (H5_SET_EXTENT_DEBUG) - printf("\n buf_e: "); + HDprintf("\n buf_e: "); for (i = 0; i < (int)dims_r[0]; i++ ) - printf("%d ", buf_e[i]); - printf("\n"); + HDprintf("%d ", buf_e[i]); + HDprintf("\n"); #endif /* compare the read array with the expanded array */ for (i = 0; i < (int)dims_r[0]; i++ ) if(i >= DIM0) { if(buf_e[i] != comp_value) { - printf("buf_e[%d] = %d\n", i, buf_e[i]); - printf("expected = %d\n", comp_value); + HDprintf("buf_e[%d] = %d\n", i, buf_e[i]); + HDprintf("expected = %d\n", comp_value); TEST_ERROR } /* end if */ } /* end if */ @@ -670,17 +670,17 @@ static int test_rank1( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n dims_r: "); + HDprintf("\n dims_r: "); for (i = 0; i < (int)dims_r[0]; i++ ) - printf("%d ", buf_s[i]); - printf("\n"); + HDprintf("%d ", buf_s[i]); + HDprintf("\n"); #endif /* compare the read array with the shrinked array */ for( i = 0; i < (int)dims_r[0]; i++ ) if(buf_s[i] != buf_o[i]) { - printf("buf_s[%d] = %d\n", i, buf_s[i]); - printf("buf_o[%d] = %d\n", i, buf_o[i]); + HDprintf("buf_s[%d] = %d\n", i, buf_s[i]); + HDprintf("buf_o[%d] = %d\n", i, buf_o[i]); TEST_ERROR } /* end if */ @@ -714,18 +714,18 @@ static int test_rank1( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n dims_r: "); + HDprintf("\n dims_r: "); for (i = 0; i < (int)dims_r[0]; i++ ) - printf("%d ", buf_r[i]); - printf("\n"); + HDprintf("%d ", buf_r[i]); + HDprintf("\n"); #endif /* compare the read array with the original array */ for(i = 0; i < (int)dims_r[0]; i++ ) if(i >= DIMS0 ) { if(buf_r[i] != comp_value) { - printf("buf_r[%d] = %d\n", i, buf_r[i] ); - printf("expected = %d\n", comp_value); + HDprintf("buf_r[%d] = %d\n", i, buf_r[i] ); + HDprintf("expected = %d\n", comp_value); TEST_ERROR } /* end if */ } /* end if */ @@ -820,61 +820,47 @@ error: *------------------------------------------------------------------------- */ -static int test_rank2( hid_t fapl, - hid_t dcpl, - hbool_t do_fill_value, - hbool_t disable_edge_filters, - hbool_t set_istore_k) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t my_dcpl=-1; - hid_t fcpl; - hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */ - hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */ - hsize_t dims_e[RANK2] = {DIME0,DIME1}; /* extended dimensions */ - hsize_t dims_c[RANK2] = {2,2}; /* chunk dimensions */ - hsize_t dims_r[RANK2]; /* read dimensions */ - hsize_t maxdims[RANK2] = {H5S_UNLIMITED,H5S_UNLIMITED}; - int buf_o[DIM0][DIM1]; - int buf_s[DIMS0][DIMS1]; - int buf_e[DIME0][DIME1]; - int buf_r[DIM0][DIM1]; - int i, j; - int comp_value; - char filename[NAME_BUF_SIZE]; - - if ( do_fill_value ) - { +static int test_rank2(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_filters, hbool_t set_istore_k) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t my_dcpl = -1; + hid_t fcpl; + hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */ + hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */ + hsize_t dims_e[RANK2] = { DIME0, DIME1 }; /* extended dimensions */ + hsize_t dims_c[RANK2] = { 2, 2 }; /* chunk dimensions */ + hsize_t dims_r[RANK2]; /* read dimensions */ + hsize_t maxdims[RANK2] = { H5S_UNLIMITED, H5S_UNLIMITED }; + int buf_o[DIM0][DIM1]; + int buf_s[DIMS0][DIMS1]; + int buf_e[DIME0][DIME1]; + int buf_r[DIM0][DIM1]; + int i, j; + int comp_value; + char filename[NAME_BUF_SIZE]; + + if (do_fill_value) { comp_value = FILL_VALUE; - } - else - { + } else { comp_value = 0; } - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { buf_o[i][j] = 2; } } /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { TEST_ERROR } - if ( set_istore_k ) - { + if (set_istore_k) { /* set non-default indexed storage B-tree internal 'K' value */ - if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0) - { + if (H5Pset_istore_k(fcpl, ISTORE_IK) < 0) { TEST_ERROR } @@ -882,79 +868,65 @@ static int test_rank2( hid_t fapl, /* create a new file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - { + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { TEST_ERROR } - - /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) { TEST_ERROR } /* modify dataset creation properties, i.e. enable chunking. */ - if ((my_dcpl = H5Pcopy (dcpl)) < 0) - { + if ((my_dcpl = H5Pcopy(dcpl)) < 0) { TEST_ERROR } - if (H5Pset_chunk(my_dcpl, RANK2, dims_c) < 0) - { + if (H5Pset_chunk(my_dcpl, RANK2, dims_c) < 0) { TEST_ERROR } - if(disable_edge_filters) - if(H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + if (disable_edge_filters) + if (H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) TEST_ERROR - /*------------------------------------------------------------------------- - * Procedure 1 - * a. Write an array AxB. These are the dimensions for creating the dataset - * b. Define a greater array CxD where C > A and D > B - * c. Read data back - * d. Verify if new dimensions are C and D - * e. Verify if data from A to C and B to D is what it is to be expected - * - * original data is - * - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * - *------------------------------------------------------------------------- - */ - - /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + /*------------------------------------------------------------------------- + * Procedure 1 + * a. Write an array AxB. These are the dimensions for creating the dataset + * b. Define a greater array CxD where C > A and D > B + * c. Read data back + * d. Verify if new dimensions are C and D + * e. Verify if data from A to C and B to D is what it is to be expected + * + * original data is + * + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * + *------------------------------------------------------------------------- + */ + + /* create a dataset */ + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) { TEST_ERROR } - #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - printf("%d ", buf_o[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + HDprintf("%d ", buf_o[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } @@ -974,32 +946,26 @@ static int test_rank2( hid_t fapl, */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) - { + if (H5Dset_extent(did, dims_e) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_e[i]) TEST_ERROR } @@ -1008,55 +974,39 @@ static int test_rank2( hid_t fapl, if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) TEST_ERROR - - #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_e[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_e[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - - /* compare the read array with the expanded array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - if ( i >= DIM0 || j >= DIM1 ) - { - if(buf_e[i][j] != comp_value) - { - printf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); - printf("value = %d\n", comp_value); + /* compare the read array with the expanded array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (i >= DIM0 || j >= DIM1) { + if (buf_e[i][j] != comp_value) { + HDprintf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_e[i][j] != buf_o[i][j]) + } else { + if (buf_e[i][j] != buf_o[i][j]) TEST_ERROR } } } - - - /*------------------------------------------------------------------------- * * Procedure 2 - * a. Define a smaller array ExF where E < A and F < B - * b. Read data back - * c. Verify if new dimensions are E and F - * d. Verify if data up until E and F is what to be expected + * a. Define a smaller array ExF where E < A and F < B + * b. Read data back + * c. Verify if new dimensions are E and F + * d. Verify if data up until E and F is what to be expected * * data is now * @@ -1067,106 +1017,81 @@ static int test_rank2( hid_t fapl, */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - /* for this case we close and reopen file */ - if ( set_istore_k ) - { + if (set_istore_k) { - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Fclose(fid) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0) - { + if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) { TEST_ERROR } - if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0) - { + if ((did = H5Dopen2(fid, "dset1", H5P_DEFAULT)) < 0) { TEST_ERROR } - - } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) - { + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_s[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_s[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /* compare the read array with the shrinked array */ - for( i = 0; i < (int)dims_r[0]; i++ ) - { - for( j = 0; j < (int)dims_r[1]; j++ ) - { - if ( buf_s[i][j] != buf_o[i][j] ) - { - printf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); - printf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (buf_s[i][j] != buf_o[i][j]) { + HDprintf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); + HDprintf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); TEST_ERROR } } } - /*------------------------------------------------------------------------- * set new dimensions for the array; expand it back to original size * data is now, extended space was initialized with fill value or default value @@ -1180,36 +1105,30 @@ static int test_rank2( hid_t fapl, */ /* set new dimensions for the array */ - if (H5Dset_extent(did, dims_o) < 0) - { + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions. */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- @@ -1220,36 +1139,26 @@ static int test_rank2( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_r[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_r[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /* compare the read array with the original array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - if (i >= DIMS0 || j >= DIMS1) - { - if(buf_r[i][j] != comp_value) - { - printf("buf_r[%d][%d] = %d\n", i, j, buf_r[i][j]); - printf("value = %d\n", comp_value); + /* compare the read array with the original array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (i >= DIMS0 || j >= DIMS1) { + if (buf_r[i][j] != comp_value) { + HDprintf("buf_r[%d][%d] = %d\n", i, j, buf_r[i][j]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_r[i][j] != buf_o[i][j]) + } else { + if (buf_r[i][j] != buf_o[i][j]) TEST_ERROR } } @@ -1265,36 +1174,30 @@ static int test_rank2( hid_t fapl, dims_s[1] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * expand then shrink to 0 in dimension 1 while expanding again in * dimension 0 @@ -1302,10 +1205,8 @@ static int test_rank2( hid_t fapl, *------------------------------------------------------------------------- */ - /* expand to original dimensions for the array. */ - if (H5Dset_extent(did , dims_o) < 0) - { + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } @@ -1313,266 +1214,208 @@ static int test_rank2( hid_t fapl, dims_s[1] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * close dataset *------------------------------------------------------------------------- */ - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * test a dataset with non initialized chunks *------------------------------------------------------------------------- */ - - if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) { TEST_ERROR } - if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + if ((did = H5Dcreate2(fid, "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* set new dimensions for the array */ - dims_o[ 0 ] = 0; - dims_o[ 1 ] = 0; - if (H5Dset_extent( did , dims_o ) < 0) - { + dims_o[0] = 0; + dims_o[1] = 0; + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } - - - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - - - /*------------------------------------------------------------------------- * close property list *------------------------------------------------------------------------- */ - - if (H5Pclose(my_dcpl) < 0) - { + if (H5Pclose(my_dcpl) < 0) { TEST_ERROR } /* close file creation property list */ - if(H5Pclose(fcpl) < 0) - { + if (H5Pclose(fcpl) < 0) { TEST_ERROR } - if (H5Fclose( fid ) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - return 0; - - -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( my_dcpl ); - H5Pclose( fcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(my_dcpl); + H5Pclose(fcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } - - - /*------------------------------------------------------------------------- * test usage with a 3D rank *------------------------------------------------------------------------- */ -static int test_rank3( hid_t fapl, - hid_t dcpl, - hbool_t do_fill_value, - hbool_t disable_edge_filters, - hbool_t set_istore_k) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t my_dcpl=-1; - hid_t fcpl; - hsize_t dims_o[RANK3] = {DIM0,DIM1,DIM2}; /* original dimensions */ - hsize_t dims_s[RANK3] = {DIMS0,DIMS1,DIMS2}; /* shrinking dimensions */ - hsize_t dims_e[RANK3] = {DIME0,DIME1,DIME2}; /* extended dimensions */ - hsize_t dims_c[RANK3] = {2,2,2}; /* chunk dimensions */ - hsize_t dims_r[RANK3]; /* read dimensions */ - hsize_t maxdims[RANK3] = {H5S_UNLIMITED,H5S_UNLIMITED,H5S_UNLIMITED}; - int buf_o[DIM0][DIM1][DIM2]; - int buf_s[DIMS0][DIMS1][DIMS2]; - int buf_e[DIME0][DIME1][DIME2]; - int buf_r[DIM0][DIM1][DIM2]; - int i, j, k; - int comp_value; - char filename[NAME_BUF_SIZE]; - - if ( do_fill_value ) - { +static int test_rank3(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_filters, hbool_t set_istore_k) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t my_dcpl = -1; + hid_t fcpl; + hsize_t dims_o[RANK3] = { DIM0, DIM1, DIM2 }; /* original dimensions */ + hsize_t dims_s[RANK3] = { DIMS0, DIMS1, DIMS2 }; /* shrinking dimensions */ + hsize_t dims_e[RANK3] = { DIME0, DIME1, DIME2 }; /* extended dimensions */ + hsize_t dims_c[RANK3] = { 2, 2, 2 }; /* chunk dimensions */ + hsize_t dims_r[RANK3]; /* read dimensions */ + hsize_t maxdims[RANK3] = { H5S_UNLIMITED, H5S_UNLIMITED, H5S_UNLIMITED }; + int buf_o[DIM0][DIM1][DIM2]; + int buf_s[DIMS0][DIMS1][DIMS2]; + int buf_e[DIME0][DIME1][DIME2]; + int buf_r[DIM0][DIM1][DIM2]; + int i, j, k; + int comp_value; + char filename[NAME_BUF_SIZE]; + + if (do_fill_value) { comp_value = FILL_VALUE; - } - else - { + } else { comp_value = 0; } - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { - for( k = 0; k < DIM2; k++ ) - { + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { + for (k = 0; k < DIM2; k++) { buf_o[i][j][k] = 2; } } } /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { TEST_ERROR } - if ( set_istore_k ) - { + if (set_istore_k) { /* set non-default indexed storage B-tree internal 'K' value */ - if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0) - { + if (H5Pset_istore_k(fcpl, ISTORE_IK) < 0) { TEST_ERROR } } /* create a new file */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - { + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { TEST_ERROR } /* close property list */ - if(H5Pclose(fcpl) < 0) - { + if (H5Pclose(fcpl) < 0) { TEST_ERROR } /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) { TEST_ERROR } /* modify dataset creation properties, i.e. enable chunking. */ - if ((my_dcpl = H5Pcopy (dcpl)) < 0) - { + if ((my_dcpl = H5Pcopy(dcpl)) < 0) { TEST_ERROR } - if (H5Pset_chunk(my_dcpl, RANK3, dims_c) < 0) - { + if (H5Pset_chunk(my_dcpl, RANK3, dims_c) < 0) { TEST_ERROR } - if(disable_edge_filters) - if(H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + if (disable_edge_filters) + if (H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) TEST_ERROR - /*------------------------------------------------------------------------- - * create, write array - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create, write array + *------------------------------------------------------------------------- + */ - /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + /* create a dataset */ + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) { TEST_ERROR } - #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - for( k = 0; k < (int)dims_o[2]; k++ ) - { - printf("%d ", buf_o[i][j][k]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + for( k = 0; k < (int)dims_o[2]; k++ ) { + HDprintf("%d ", buf_o[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } @@ -1583,32 +1426,26 @@ static int test_rank3( hid_t fapl, */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) - { + if (H5Dset_extent(did, dims_e) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_e[i]) TEST_ERROR } @@ -1617,203 +1454,153 @@ static int test_rank3( hid_t fapl, if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) TEST_ERROR - - #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - printf("%d ", buf_e[i][j][k]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + for( k = 0; k < (int)dims_r[2]; k++ ) { + HDprintf("%d ", buf_e[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - - /* compare the read array with the expanded array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - if ( i >= DIM0 || j >= DIM1 || k >= DIM2 ) - { - if(buf_e[i][j][k] != comp_value) - { - printf("buf_e[%d][%d][%d] = %d\n", i, j, k, buf_e[i][j][k] ); - printf("value = %d\n", comp_value); + /* compare the read array with the expanded array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + for (k = 0; k < (int) dims_r[2]; k++) { + if (i >= DIM0 || j >= DIM1 || k >= DIM2) { + if (buf_e[i][j][k] != comp_value) { + HDprintf("buf_e[%d][%d][%d] = %d\n", i, j, k, buf_e[i][j][k]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_e[i][j][k] != buf_o[i][j][k] ) + } else { + if (buf_e[i][j][k] != buf_o[i][j][k]) TEST_ERROR } } } } - - - /*------------------------------------------------------------------------- * shrink *------------------------------------------------------------------------- */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - /* for this case we close and reopen file */ - if ( set_istore_k ) - { + if (set_istore_k) { - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Fclose(fid) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0) - { + if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) { TEST_ERROR } - if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0) - { + if ((did = H5Dopen2(fid, "dset1", H5P_DEFAULT)) < 0) { TEST_ERROR } - - } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) - { + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - printf("%d ", buf_s[i][j][k]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + for( k = 0; k < (int)dims_r[2]; k++ ) { + HDprintf("%d ", buf_s[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - /* compare the read array with the shrinked array */ - for( i = 0; i < (int)dims_r[0]; i++ ) - { - for( j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - if ( buf_s[i][j][k] != buf_o[i][j][k] ) - { - printf("buf_s[%d][%d][%d] = %d\n", i, j, k, buf_s[i][j][k] ); - printf("buf_o[%d][%d][%d] = %d\n", i, j, k, buf_o[i][j][k] ); + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + for (k = 0; k < (int) dims_r[2]; k++) { + if (buf_s[i][j][k] != buf_o[i][j][k]) { + HDprintf("buf_s[%d][%d][%d] = %d\n", i, j, k, buf_s[i][j][k]); + HDprintf("buf_o[%d][%d][%d] = %d\n", i, j, k, buf_o[i][j][k]); TEST_ERROR } } } } - /*------------------------------------------------------------------------- * set new dimensions for the array; expand it back to original size *------------------------------------------------------------------------- */ /* set new dimensions for the array */ - if (H5Dset_extent(did, dims_o) < 0) - { + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions. */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } @@ -1823,52 +1610,39 @@ static int test_rank3( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + for( k = 0; k < (int)dims_r[2]; k++ ) { - printf("%d ", buf_r[i][j][k]); + HDprintf("%d ", buf_r[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - /* compare the read array with the original array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - if (i >= DIMS0 || j >= DIMS1 || k >= DIMS2 ) - { - if( buf_r[i][j][k] != comp_value ) - { - printf("buf_r[%d][%d][%d] = %d\n", i, j, k, buf_r[i][j][k] ); - printf("value = %d\n", comp_value); + /* compare the read array with the original array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + for (k = 0; k < (int) dims_r[2]; k++) { + if (i >= DIMS0 || j >= DIMS1 || k >= DIMS2) { + if (buf_r[i][j][k] != comp_value) { + HDprintf("buf_r[%d][%d][%d] = %d\n", i, j, k, buf_r[i][j][k]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_r[i][j][k] != buf_o[i][j][k]) + } else { + if (buf_r[i][j][k] != buf_o[i][j][k]) TEST_ERROR } } } } - /*------------------------------------------------------------------------- * shrink to 0 * @@ -1880,158 +1654,126 @@ static int test_rank3( hid_t fapl, dims_s[2] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - /*------------------------------------------------------------------------- * close dataset *------------------------------------------------------------------------- */ - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - /*------------------------------------------------------------------------- * test a dataset with non initialized chunks *------------------------------------------------------------------------- */ - - if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) { TEST_ERROR } - if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + if ((did = H5Dcreate2(fid, "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* set new dimensions for the array */ - dims_o[ 0 ] = 0; - dims_o[ 1 ] = 0; - dims_o[ 2 ] = 0; - if (H5Dset_extent( did , dims_o ) < 0) - { + dims_o[0] = 0; + dims_o[1] = 0; + dims_o[2] = 0; + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } - - - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - - - /*------------------------------------------------------------------------- * close property list *------------------------------------------------------------------------- */ - - if (H5Pclose(my_dcpl) < 0) - { + if (H5Pclose(my_dcpl) < 0) { TEST_ERROR } - if (H5Fclose( fid ) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - return 0; - - -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( my_dcpl ); - H5Pclose( fcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(my_dcpl); + H5Pclose(fcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } - /*------------------------------------------------------------------------- * test usage with external storage *------------------------------------------------------------------------- */ -static int test_external( hid_t fapl ) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t dcpl=-1; - hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */ - hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */ - hsize_t dims_e[RANK2] = {DIME0,DIM1}; /* extended dimensions, dimension 1 is the original */ - hsize_t dims_r[RANK2]; /* read dimensions */ - hsize_t maxdims[RANK2] = {DIME0,DIM1}; /* only the first dimension can be extendible */ - int buf_o[DIM0][DIM1]; /* original buffer, for writing */ - int buf_s[DIMS0][DIMS1]; /* shrinked buffer, for reading */ - int buf_e[DIME0][DIM1]; /* extended buffer, for writing, dimension 1 is the original */ - int buf_ro[DIM0][DIM1]; /* original buffer for reading */ - int i, j; - int comp_value = 0; - char filename[NAME_BUF_SIZE]; - - - hsize_t size; /* number of bytes reserved in the file for the data */ +static int test_external(hid_t fapl) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t dcpl = -1; + hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */ + hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */ + hsize_t dims_e[RANK2] = { DIME0, DIM1 }; /* extended dimensions, dimension 1 is the original */ + hsize_t dims_r[RANK2]; /* read dimensions */ + hsize_t maxdims[RANK2] = { DIME0, DIM1 }; /* only the first dimension can be extendible */ + int buf_o[DIM0][DIM1]; /* original buffer, for writing */ + int buf_s[DIMS0][DIMS1]; /* shrinked buffer, for reading */ + int buf_e[DIME0][DIM1]; /* extended buffer, for writing, dimension 1 is the original */ + int buf_ro[DIM0][DIM1]; /* original buffer for reading */ + int i, j; + int comp_value = 0; + char filename[NAME_BUF_SIZE]; + + hsize_t size; /* number of bytes reserved in the file for the data */ hsize_t max_size[2]; max_size[0] = dims_e[0]; max_size[1] = dims_e[1]; size = max_size[0] * max_size[1] * sizeof(int) / 2; - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { buf_o[i][j] = 2; } } @@ -2043,30 +1785,27 @@ static int test_external( hid_t fapl ) if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - /* modify dataset creation properties */ - if ((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) + /* modify dataset creation properties */ + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if(H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t)0, size) < 0) + if (H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t) 0, size) < 0) FAIL_STACK_ERROR - if(H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t)0, size) < 0) + if (H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t) 0, size) < 0) FAIL_STACK_ERROR { - char name[256]; /*external file name */ - off_t file_offset; /*external file offset */ - hsize_t file_size; /*sizeof external file segment */ + char name[256]; /*external file name */ + off_t file_offset; /*external file offset */ + hsize_t file_size; /*sizeof external file segment */ - if(H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, - &file_size) < 0) + if (H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, &file_size) < 0) FAIL_STACK_ERROR } - - /*------------------------------------------------------------------------- * Write an array AxB. These are the dimensions for creating the dataset * @@ -2080,80 +1819,72 @@ static int test_external( hid_t fapl ) *------------------------------------------------------------------------- */ - /* create the data space with unlimited dimensions. */ if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) FAIL_STACK_ERROR - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) FAIL_STACK_ERROR if (H5Sclose(sid) < 0) FAIL_STACK_ERROR + /*------------------------------------------------------------------------- + * read + *------------------------------------------------------------------------- + */ - /*------------------------------------------------------------------------- - * read - *------------------------------------------------------------------------- - */ - - /* read */ + /* read */ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ro) < 0) FAIL_STACK_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - printf("%d ", buf_ro[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + HDprintf("%d ", buf_ro[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /*------------------------------------------------------------------------- - * expand - *------------------------------------------------------------------------- - */ - - /*------------------------------------------------------------------------- - * set new dimensions for the array; expand it - * data is now, extended space was initialized with default value - * - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * 0 0 0 0 - * 0 0 0 0 - * 0 0 0 0 - * - *------------------------------------------------------------------------- - */ - - /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) + /*------------------------------------------------------------------------- + * expand + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * set new dimensions for the array; expand it + * data is now, extended space was initialized with default value + * + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * 0 0 0 0 + * 0 0 0 0 + * 0 0 0 0 + * + *------------------------------------------------------------------------- + */ + + /* set new dimensions for the array. */ + if (H5Dset_extent(did, dims_e) < 0) FAIL_STACK_ERROR - /* get the space */ + /* get the space */ if ((sid = H5Dget_space(did)) < 0) FAIL_STACK_ERROR - /* get dimensions */ + /* get dimensions */ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) FAIL_STACK_ERROR if (H5Sclose(sid) < 0) FAIL_STACK_ERROR - - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + /* check dimensions */ + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_e[i]) TEST_ERROR } @@ -2162,48 +1893,33 @@ static int test_external( hid_t fapl ) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) FAIL_STACK_ERROR - - #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_e[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_e[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - - /* compare the read array with the expanded array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - if ( i >= DIM0 || j >= DIM1 ) - { - if(buf_e[i][j] != comp_value) - { - printf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); - printf("value = %d\n", comp_value); + /* compare the read array with the expanded array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (i >= DIM0 || j >= DIM1) { + if (buf_e[i][j] != comp_value) { + HDprintf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_e[i][j] != buf_o[i][j]) + } else { + if (buf_e[i][j] != buf_o[i][j]) TEST_ERROR } } } - - - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * shrink * * data is now @@ -2215,208 +1931,172 @@ static int test_external( hid_t fapl ) */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) + if (H5Dset_extent(did, dims_s) < 0) FAIL_STACK_ERROR - /* get the space */ + /* get the space */ if ((sid = H5Dget_space(did)) < 0) FAIL_STACK_ERROR - /* get dimensions */ + /* get dimensions */ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) FAIL_STACK_ERROR if (H5Sclose(sid) < 0) FAIL_STACK_ERROR - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + /* check dimensions */ + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) FAIL_STACK_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_s[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_s[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - - /* compare the read array with the shrinked array */ - for( i = 0; i < (int)dims_r[0]; i++ ) - { - for( j = 0; j < (int)dims_r[1]; j++ ) - { - if ( buf_s[i][j] != buf_o[i][j] ) - { - printf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); - printf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); + /* compare the read array with the shrinked array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (buf_s[i][j] != buf_o[i][j]) { + HDprintf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); + HDprintf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); TEST_ERROR } } } - /*------------------------------------------------------------------------- * negative test * try to extend dimension above maximum *------------------------------------------------------------------------- */ - dims_e[1] = DIME1; - H5E_BEGIN_TRY - { - - - /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) == SUCCEED) { - TEST_ERROR - } - - } H5E_END_TRY; + /* set new dimensions for the array. */ + if (H5Dset_extent(did, dims_e) == SUCCEED) { + TEST_ERROR + } + }H5E_END_TRY; /*------------------------------------------------------------------------- * close property list *------------------------------------------------------------------------- */ - if (H5Pclose(dcpl) < 0) FAIL_STACK_ERROR - if (H5Dclose( did ) < 0) + if (H5Dclose(did) < 0) FAIL_STACK_ERROR - if (H5Fclose( fid ) < 0) + if (H5Fclose(fid) < 0) FAIL_STACK_ERROR - PASSED(); + PASSED() + ; return 0; -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( dcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(dcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } - /*------------------------------------------------------------------------- * test usage with layouts compact and contiguous *------------------------------------------------------------------------- */ -static int test_layouts( H5D_layout_t layout, hid_t fapl ) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t dcpl=-1; - herr_t ret; - hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */ - hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */ - hsize_t dims_e[RANK2] = {DIME0,DIME1}; /* extended dimensions */ - hsize_t dims_r[RANK2]; /* read dimensions */ - int buf_o[DIM0][DIM1]; - int buf_r[DIM0][DIM1]; - int i, j; - char filename[NAME_BUF_SIZE]; - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { +static int test_layouts(H5D_layout_t layout, hid_t fapl) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t dcpl = -1; + herr_t ret; + hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */ + hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */ + hsize_t dims_e[RANK2] = { DIME0, DIME1 }; /* extended dimensions */ + hsize_t dims_r[RANK2]; /* read dimensions */ + int buf_o[DIM0][DIM1]; + int buf_r[DIM0][DIM1]; + int i, j; + char filename[NAME_BUF_SIZE]; + + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { buf_o[i][j] = 2; } } - /* create a new file */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - { + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { TEST_ERROR } /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK2, dims_o, NULL)) < 0) - { + if ((sid = H5Screate_simple(RANK2, dims_o, NULL)) < 0) { TEST_ERROR } /* modify dataset creation properties */ - if ((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) - { + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { TEST_ERROR } - if (H5Pset_layout (dcpl, layout) < 0) - { + if (H5Pset_layout(dcpl, layout) < 0) { TEST_ERROR } /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - { + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) { TEST_ERROR } - #if defined (H5_SET_EXTENT_DEBUG4) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - printf("%d ", buf_o[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + HDprintf("%d ", buf_o[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } @@ -2427,39 +2107,31 @@ static int test_layouts( H5D_layout_t layout, hid_t fapl ) */ H5E_BEGIN_TRY - { + { - ret = H5Dset_extent(did , dims_e); + ret = H5Dset_extent(did, dims_e); - } H5E_END_TRY; + }H5E_END_TRY; - if(ret >= 0) + if (ret >= 0) TEST_ERROR - - - - /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + /* get the space */ + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } @@ -2468,123 +2140,100 @@ static int test_layouts( H5D_layout_t layout, hid_t fapl ) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) TEST_ERROR - - #if defined (H5_SET_EXTENT_DEBUG4) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_r[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_r[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /*------------------------------------------------------------------------- - * negative test - * try to shrink dimension - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * negative test + * try to shrink dimension + *------------------------------------------------------------------------- + */ H5E_BEGIN_TRY - { + { - ret = H5Dset_extent(did , dims_s); + ret = H5Dset_extent(did, dims_s); - } H5E_END_TRY; + }H5E_END_TRY; - if(ret >= 0) + if (ret >= 0) TEST_ERROR - - /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + /* get the space */ + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r ) < 0) - { + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG4) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_r[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_r[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Pclose(dcpl) < 0) - { + if (H5Pclose(dcpl) < 0) { TEST_ERROR } - if (H5Fclose( fid ) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - return 0; - - -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( dcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(dcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } @@ -3077,16 +2726,15 @@ static void test_random_rank4_dump( unsigned ndim_sets, hsize_t dim_log[][4], { unsigned i; - printf(" Chunk dimensions: ( %u, %u, %u, %u )\n", (unsigned)cdims[0], + HDprintf(" Chunk dimensions: ( %u, %u, %u, %u )\n", (unsigned)cdims[0], (unsigned)cdims[1], (unsigned)cdims[2], (unsigned)cdims[3]); - printf(" Log of dataset dimensions (oldest first):\n"); + HDprintf(" Log of dataset dimensions (oldest first):\n"); for(i=0; i<ndim_sets; i++) - printf(" Iteration %-3u: ( %2u, %2u, %2u, %2u )\n", i, + HDprintf(" Iteration %-3u: ( %2u, %2u, %2u, %2u )\n", i, (unsigned)dim_log[i][0], (unsigned)dim_log[i][1], (unsigned)dim_log[i][2], (unsigned)dim_log[i][3]); if(j>=0) - printf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, - m); + HDprintf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, m); return; } /* end test_random_rank4_dump */ diff --git a/test/stab.c b/test/stab.c index 37097b7..80c8b06 100644 --- a/test/stab.c +++ b/test/stab.c @@ -16,13 +16,13 @@ * Tuesday, November 24, 1998 */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5G_TESTING #include "h5test.h" -#include "H5Gpkg.h" /* Groups */ +#include "H5Gpkg.h" /* Groups */ const char *FILENAME[] = { "stab", @@ -78,17 +78,17 @@ const char *FILENAME[] = { #define CORRUPT_STAB_TMP_FILE "corrupt_stab_msg_tmp.h5" #define CORRUPT_STAB_DSET "DS1" - + /*------------------------------------------------------------------------- - * Function: test_misc + * Function: test_misc * - * Purpose: Test miscellaneous group stuff. + * Purpose: Test miscellaneous group stuff. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * *------------------------------------------------------------------------- @@ -96,10 +96,10 @@ const char *FILENAME[] = { static int test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ - hid_t g1 = (-1), g2 = (-1), g3 = (-1); - char filename[NAME_BUF_SIZE]; - char comment[64]; + hid_t fid = (-1); /* File ID */ + hid_t g1 = (-1), g2 = (-1), g3 = (-1); + char filename[NAME_BUF_SIZE]; + char comment[64]; if(new_format) TESTING("miscellaneous group tests (w/new group format)") @@ -125,10 +125,10 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) if((g3 = H5Gopen2(fid, "/test_1b", H5P_DEFAULT)) < 0) TEST_ERROR if(H5Oget_comment_by_name(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0) TEST_ERROR if(HDstrcmp(comment, "hello world")) { - H5_FAILED(); - puts(" Read the wrong comment string from the group."); - printf(" got: \"%s\"\n ans: \"hello world\"\n", comment); - TEST_ERROR + H5_FAILED(); + HDputs(" Read the wrong comment string from the group."); + HDprintf(" got: \"%s\"\n ans: \"hello world\"\n", comment); + TEST_ERROR } if(H5Gclose(g1) < 0) TEST_ERROR if(H5Gclose(g2) < 0) TEST_ERROR @@ -153,21 +153,21 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) error: H5E_BEGIN_TRY { - H5Gclose(g1); - H5Gclose(g2); - H5Gclose(g3); - H5Fclose(fid); + H5Gclose(g1); + H5Gclose(g2); + H5Gclose(g3); + H5Fclose(fid); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Purpose: Creates a group with a very long name * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * * Programmer: Robb Matzke <matzke@llnl.gov> 2002-03-28 * @@ -177,10 +177,10 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) static int test_long(hid_t fcpl, hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ + hid_t fid = (-1); /* File ID */ hid_t g1 = (-1), g2 = (-1); char *name1 = NULL, *name2 = NULL; - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; size_t i; if(new_format) @@ -198,7 +198,7 @@ test_long(hid_t fcpl, hid_t fapl, hbool_t new_format) name1[i] = (char)('A' + i%26); name1[LONG_NAME_LEN - 1] = '\0'; name2 = (char *)HDmalloc((size_t)((2 * LONG_NAME_LEN) + 2)); - sprintf(name2, "%s/%s", name1, name1); + HDsprintf(name2, "%s/%s", name1, name1); /* Create groups */ if((g1 = H5Gcreate2(fid, name1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -226,22 +226,22 @@ error: H5E_BEGIN_TRY { H5Gclose(g1); H5Gclose(g2); - H5Fclose(fid); + H5Fclose(fid); HDfree(name2); HDfree(name1); } H5E_END_TRY; return 1; } /* end test_long() */ - + /*------------------------------------------------------------------------- * Function: test_large * * Purpose: Creates a really large directory. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * * Programmer: Robb Matzke * robb@maya.nuance.com @@ -252,9 +252,9 @@ error: static int test_large(hid_t fcpl, hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ + hid_t fid = (-1); /* File ID */ hid_t cwg = (-1), dir = (-1); /* Group IDs */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; char name[NAME_BUF_SIZE]; int i; @@ -275,8 +275,8 @@ test_large(hid_t fcpl, hid_t fapl, hbool_t new_format) if(new_format) if(H5G__has_stab_test(cwg) != FALSE) TEST_ERROR for(i = 0; i < LARGE_NOBJS; i++) { - sprintf(name, "%05d%05d", (HDrandom() % 100000), i); - if((dir = H5Gcreate2(cwg, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + HDsprintf(name, "%05d%05d", (HDrandom() % 100000), i); + if((dir = H5Gcreate2(cwg, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Gclose(dir) < 0) TEST_ERROR } if(new_format) @@ -291,14 +291,14 @@ test_large(hid_t fcpl, hid_t fapl, hbool_t new_format) error: H5E_BEGIN_TRY { - H5Gclose(dir); - H5Gclose(cwg); - H5Fclose(fid); + H5Gclose(dir); + H5Gclose(cwg); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_large() */ - + /*------------------------------------------------------------------------- * Function: lifecycle * @@ -318,19 +318,19 @@ test_large(hid_t fcpl, hid_t fapl, hbool_t new_format) static int lifecycle(hid_t fcpl, hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Datatype ID */ hid_t gcpl = (-1); /* Group creation property list ID */ size_t lheap_size_hint; /* Local heap size hint */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned est_num_entries; /* Estimated # of entries in group */ - unsigned est_name_len; /* Estimated length of entry name */ - unsigned nmsgs; /* Number of messages in group's header */ + unsigned est_num_entries; /* Estimated # of entries in group */ + unsigned est_name_len; /* Estimated length of entry name */ + unsigned nmsgs; /* Number of messages in group's header */ H5O_info_t oinfo; /* Object info */ char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ unsigned u; /* Local index variable */ h5_stat_size_t file_size; /* Size of each file created */ @@ -385,7 +385,7 @@ lifecycle(hid_t fcpl, hid_t fapl2) if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Create first "bottom" group */ - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ @@ -402,7 +402,7 @@ lifecycle(hid_t fcpl, hid_t fapl2) /* Create several more bottom groups, to push the top group almost to a symbol table */ /* (Start counting at '1', since we've already created one bottom group */ for(u = 1; u < LIFECYCLE_MAX_COMPACT; u++) { - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ @@ -426,7 +426,7 @@ lifecycle(hid_t fcpl, hid_t fapl2) if(oinfo.hdr.nchunks != 1) TEST_ERROR /* Create one more "bottom" group, which should push top group into using a symbol table */ - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ @@ -449,7 +449,7 @@ lifecycle(hid_t fcpl, hid_t fapl2) /* Unlink objects from top group */ while(u >= LIFECYCLE_MIN_DENSE) { - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -462,7 +462,7 @@ lifecycle(hid_t fcpl, hid_t fapl2) if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Unlink one more object from the group, which should transform back to using links */ - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR u--; @@ -472,10 +472,10 @@ lifecycle(hid_t fcpl, hid_t fapl2) if(nmsgs != (LIFECYCLE_MIN_DENSE - 1)) TEST_ERROR /* Unlink last two objects from top group */ - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR u--; - sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Check on top group's status */ @@ -505,15 +505,15 @@ lifecycle(hid_t fcpl, hid_t fapl2) error: H5E_BEGIN_TRY { - H5Gclose(gcpl); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gcpl); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end lifecycle() */ - + /*------------------------------------------------------------------------- * Function: long_compact * @@ -532,11 +532,11 @@ error: static int long_compact(hid_t fcpl, hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Group ID */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Group ID */ char *objname = NULL; /* Object name */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ @@ -638,9 +638,9 @@ long_compact(hid_t fcpl, hid_t fapl2) error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; if(objname) @@ -649,7 +649,7 @@ error: return 1; } /* end long_compact() */ - + /*------------------------------------------------------------------------- * Function: read_old * @@ -691,7 +691,7 @@ read_old(void) /* Create a bunch of objects in the group */ for(u = 0; u < READ_OLD_NGROUPS; u++) { - sprintf(objname, "Group %u", u); + HDsprintf(objname, "Group %u", u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ @@ -709,7 +709,7 @@ read_old(void) /* Delete new objects from old group */ for(u = 0; u < READ_OLD_NGROUPS; u++) { - sprintf(objname, "Group %u", u); + HDsprintf(objname, "Group %u", u); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ @@ -730,13 +730,13 @@ read_old(void) error: H5E_BEGIN_TRY { - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end read_old() */ - + /*------------------------------------------------------------------------- * Function: no_compact * @@ -755,16 +755,16 @@ error: static int no_compact(hid_t fcpl, hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Datatype ID */ hid_t gcpl = (-1); /* Group creation property list ID */ char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ - unsigned est_num_entries; /* Estimated # of entries in group */ - unsigned est_name_len; /* Estimated length of entry name */ + unsigned est_num_entries; /* Estimated # of entries in group */ + unsigned est_name_len; /* Estimated length of entry name */ TESTING("group without compact form"); @@ -802,7 +802,7 @@ no_compact(hid_t fcpl, hid_t fapl2) if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Create first "bottom" group */ - sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); + HDsprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ @@ -817,7 +817,7 @@ no_compact(hid_t fcpl, hid_t fapl2) if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Unlink object from top group */ - sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); + HDsprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Check on top group's status */ @@ -843,15 +843,15 @@ no_compact(hid_t fcpl, hid_t fapl2) error: H5E_BEGIN_TRY { - H5Gclose(gcpl); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gcpl); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end no_compact() */ - + /*------------------------------------------------------------------------- * Function: gcpl_on_root * @@ -869,15 +869,15 @@ error: static int gcpl_on_root(hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Datatype ID */ hid_t fcpl = (-1); /* File creation property list ID */ hid_t gcpl = (-1); /* Group creation property list ID */ hid_t lcpl = (-1); /* Link creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; TESTING("setting root group creation properties"); @@ -962,17 +962,17 @@ gcpl_on_root(hid_t fapl2) error: H5E_BEGIN_TRY { - H5Gclose(lcpl); - H5Gclose(gcpl); - H5Gclose(gid2); - H5Gclose(gid); - H5Gclose(fcpl); - H5Fclose(fid); + H5Gclose(lcpl); + H5Gclose(gcpl); + H5Gclose(gid2); + H5Gclose(gid); + H5Gclose(fcpl); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end gcpl_on_root() */ - + /*------------------------------------------------------------------------- * Function: old_api * @@ -990,11 +990,11 @@ static int old_api(hid_t fapl) { #ifndef H5_NO_DEPRECATED_SYMBOLS - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ h5_stat_size_t small_file_size; /* Size of small group file */ h5_stat_size_t large_file_size; /* Size of large group file */ - char filename[NAME_BUF_SIZE]; + char filename[NAME_BUF_SIZE]; #endif /* H5_NO_DEPRECATED_SYMBOLS */ TESTING("old API routines"); @@ -1049,7 +1049,7 @@ old_api(hid_t fapl) fapl = fapl; SKIPPED(); - puts(" Deprecated API symbols not enabled"); + HDputs(" Deprecated API symbols not enabled"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ return 0; @@ -1057,14 +1057,14 @@ old_api(hid_t fapl) #ifndef H5_NO_DEPRECATED_SYMBOLS error: H5E_BEGIN_TRY { - H5Gclose(gid); - H5Fclose(fid); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; return 1; #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end old_api() */ - + /*------------------------------------------------------------------------- * Function: corrupt_stab_msg * @@ -1136,24 +1136,24 @@ corrupt_stab_msg(void) error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Fclose(fid); + H5Dclose(did); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end corrupt_stab_msg() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test groups + * Purpose: Test groups * - * Return: Success: zero + * Return: Success: zero * - * Failure: non-zero + * Failure: non-zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Modifications: @@ -1163,12 +1163,12 @@ error: int main(void) { - hid_t fapl, fapl2; /* File access property list IDs */ - hid_t fcpl, fcpl2; /* File creation property list ID */ - unsigned new_format; /* Whether to use the new format or not */ - const char *env_h5_drvr; /* File Driver value from environment */ - hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ - int nerrors = 0; + hid_t fapl, fapl2; /* File access property list IDs */ + hid_t fcpl, fcpl2; /* File creation property list ID */ + unsigned new_format; /* Whether to use the new format or not */ + const char *env_h5_drvr; /* File Driver value from environment */ + hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ + int nerrors = 0; /* Get the VFD to use */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -1191,7 +1191,7 @@ main(void) /* Set up file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR if((fcpl2 = H5Pcopy(fcpl)) < 0) TEST_ERROR - + /* Set to use paged aggregation strategy and persisting free-space */ /* Skip testing for multi/split drivers */ if(H5Pset_file_space_strategy(fcpl2, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) < 0) @@ -1241,7 +1241,7 @@ main(void) if(nerrors) goto error; - puts("All symbol table tests passed."); + HDputs("All symbol table tests passed."); /* Cleanup */ if (GetTestCleanup()) { @@ -1253,7 +1253,7 @@ main(void) return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); return 1; } diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 51caa3d..df984b1 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -288,21 +288,21 @@ addrem_records(hid_t fid, unsigned verbose, unsigned long nops, unsigned long fl static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_addrem_writer [-q] [-f <# of operations between flushing\n"); - printf(" file contents>] [-r <random seed>] <# of operations>\n"); - printf("\n"); - printf("<# of operations between flushing file contents> should be 0 (for\n"); - printf("no flushing) or between 1 and (<# of operations> - 1).\n"); - printf("\n"); - printf("<# of operations> must be specified.\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n"); - printf("('-f 1000'), and will generate a random seed (no -r given).\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_addrem_writer [-q] [-f <# of operations between flushing\n"); + HDprintf(" file contents>] [-r <random seed>] <# of operations>\n"); + HDprintf("\n"); + HDprintf("<# of operations between flushing file contents> should be 0 (for\n"); + HDprintf("no flushing) or between 1 and (<# of operations> - 1).\n"); + HDprintf("\n"); + HDprintf("<# of operations> must be specified.\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n"); + HDprintf("('-f 1000'), and will generate a random seed (no -r given).\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -401,7 +401,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -414,7 +414,7 @@ int main(int argc, const char *argv[]) /* Grow and shrink datasets */ if(addrem_records(fid, verbose, (unsigned long)nops, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error adding and removing records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -424,7 +424,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -434,7 +434,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_common.c b/test/swmr_common.c index a0d79e3..b323769 100644 --- a/test/swmr_common.c +++ b/test/swmr_common.c @@ -73,7 +73,7 @@ unsigned symbol_count[NLEVELS] = {100, 200, 400, 800, 1600}; /* Array of dataset information entries (1 per dataset) */ symbol_info_t *symbol_info[NLEVELS]; - + /*------------------------------------------------------------------------- * Function: choose_dataset * @@ -101,7 +101,7 @@ choose_dataset(void) return &symbol_info[level][offset]; } /* end choose_dataset() */ - + /*------------------------------------------------------------------------- * Function: create_symbol_datatype * @@ -142,7 +142,7 @@ create_symbol_datatype(void) return sym_type_id; } /* end create_symbol_datatype() */ - + /*------------------------------------------------------------------------- * Function: generate_name * @@ -161,7 +161,7 @@ create_symbol_datatype(void) * The dataset's count * * Return: Success: 0 - * + * * Failure: Can't fail * *------------------------------------------------------------------------- @@ -170,13 +170,13 @@ int generate_name(char *name_buf, unsigned level, unsigned count) { HDassert(name_buf); - - sprintf(name_buf, "%u-%04u", level, count); + + HDsprintf(name_buf, "%u-%04u", level, count); return 0; } /* end generate_name() */ - + /*------------------------------------------------------------------------- * Function: generate_symbols * @@ -210,7 +210,7 @@ generate_symbols(void) return 0; } /* end generate_symbols() */ - + /*------------------------------------------------------------------------- * Function: shutdown_symbols * @@ -238,7 +238,7 @@ shutdown_symbols(void) return 0; } /* end shutdown_symbols() */ - + /*------------------------------------------------------------------------- * Function: print_metadata_retries_info * @@ -273,7 +273,7 @@ print_metadata_retries_info(hid_t fid) power = 1; for(j = 0; j < info.nbins; j++) { if(info.retries[i][j]) - HDfprintf(stderr, "\t# of retries for %u - %u retries: %u\n", + HDfprintf(stderr, "\t# of retries for %u - %u retries: %u\n", power, (power * 10) - 1, info.retries[i][j]); power *= 10; } /* end for */ diff --git a/test/swmr_generator.c b/test/swmr_generator.c index 23620fb..54a9900 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -266,24 +266,24 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write, static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_generator [-q] [-s] [-c <deflate compression level>]\n"); - printf(" [-i <index type>] [-r <random seed>]\n"); - printf("\n"); - printf("NOTE: The random seed option is only used by the sparse test. Other\n"); - printf(" tests specify the random seed as a reader/writer option.\n"); - printf("\n"); - printf("<deflate compression level> should be -1 (for no compression) or 0-9\n"); - printf("\n"); - printf("<index type> should be b2 or ea\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), no SWMR_WRITE mode (no '-s' given) no\n"); - printf("compression ('-c -1'), v1 b-tree indexing (-i b1), and will generate a random\n"); - printf("seed (no -r given).\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_generator [-q] [-s] [-c <deflate compression level>]\n"); + HDprintf(" [-i <index type>] [-r <random seed>]\n"); + HDprintf("\n"); + HDprintf("NOTE: The random seed option is only used by the sparse test. Other\n"); + HDprintf(" tests specify the random seed as a reader/writer option.\n"); + HDprintf("\n"); + HDprintf("<deflate compression level> should be -1 (for no compression) or 0-9\n"); + HDprintf("\n"); + HDprintf("<index type> should be b2 or ea\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), no SWMR_WRITE mode (no '-s' given) no\n"); + HDprintf("compression ('-c -1'), v1 b-tree indexing (-i b1), and will generate a random\n"); + HDprintf("seed (no -r given).\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } /* end usage() */ int main(int argc, const char *argv[]) @@ -377,7 +377,7 @@ int main(int argc, const char *argv[]) /* Generate file skeleton */ if(gen_skeleton(FILENAME, verbose, swmr_write, comp_level, index_type, random_seed) < 0) { HDfprintf(stderr, "Error generating skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_reader.c b/test/swmr_reader.c index e181d3a..cb354a7 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -371,20 +371,20 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>]\n"); - printf(" [-h <# of common symbols to poll>] [-l <# of random symbols to poll>]\n"); - printf(" [-r <random seed>] <# of seconds to test>\n"); - printf("\n"); - printf("<# of seconds to test> must be specified.\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n"); - printf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); - printf("and will generate a random seed (no -r given).\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>]\n"); + HDprintf(" [-h <# of common symbols to poll>] [-l <# of random symbols to poll>]\n"); + HDprintf(" [-r <random seed>] <# of seconds to test>\n"); + HDprintf("\n"); + HDprintf("<# of seconds to test> must be specified.\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n"); + HDprintf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); + HDprintf("and will generate a random seed (no -r given).\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -485,7 +485,7 @@ int main(int argc, const char *argv[]) HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_reader.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } } /* end if */ @@ -508,7 +508,7 @@ int main(int argc, const char *argv[]) /* Generate dataset names */ if(generate_symbols() < 0) { HDfprintf(stderr, "Error generating symbol names!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Create datatype for creating datasets */ @@ -518,7 +518,7 @@ int main(int argc, const char *argv[]) /* Reading records from datasets */ if(read_records(FILENAME, verbose, verbose_file, random_seed, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) { HDfprintf(stderr, "Error reading records from datasets (random_seed = %u)!\n", random_seed); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -528,7 +528,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -538,7 +538,7 @@ int main(int argc, const char *argv[]) /* Close objects created */ if(H5Tclose(symbol_tid) < 0) { HDfprintf(stderr, "Error closing symbol datatype!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 1fae5e7..9ca6045 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -359,18 +359,18 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_remove_reader [-q] [-s <# of seconds to sleep between\n"); - printf(" polling>] [-h <# of common symbols to poll>] [-l <# of random symbols\n"); - printf(" to poll>] [-r <random seed>] <# of seconds to test>\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n"); - printf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); - printf("and will generate a random seed (no -r given).\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_remove_reader [-q] [-s <# of seconds to sleep between\n"); + HDprintf(" polling>] [-h <# of common symbols to poll>] [-l <# of random symbols\n"); + HDprintf(" to poll>] [-r <random seed>] <# of seconds to test>\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n"); + HDprintf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); + HDprintf("and will generate a random seed (no -r given).\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -480,7 +480,7 @@ int main(int argc, const char *argv[]) /* Generate dataset names */ if(generate_symbols() < 0) { HDfprintf(stderr, "Error generating symbol names!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Create datatype for creating datasets */ @@ -490,7 +490,7 @@ int main(int argc, const char *argv[]) /* Reading records from datasets */ if(read_records(FILENAME, verbose, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) { HDfprintf(stderr, "Error reading records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -500,7 +500,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -510,7 +510,7 @@ int main(int argc, const char *argv[]) /* Close objects created */ if(H5Tclose(symbol_tid) < 0) { HDfprintf(stderr, "Error closing symbol datatype!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index 43743d9..e6d23de 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -224,19 +224,19 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_remove_writer [-q] [-o] [-f <# of shrinks between flushing\n"); - printf(" file contents>] [-r <random seed>] <# of shrinks>\n"); - printf("\n"); - printf("<# of shrinks between flushing file contents> should be 0 (for no\n"); - printf("flushing) or between 1 and (<# of shrinks> - 1)\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n"); - printf("flushing every 1000 shrinks ('-f 1000'), and will generate a random seed (no -r given).\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_remove_writer [-q] [-o] [-f <# of shrinks between flushing\n"); + HDprintf(" file contents>] [-r <random seed>] <# of shrinks>\n"); + HDprintf("\n"); + HDprintf("<# of shrinks between flushing file contents> should be 0 (for no\n"); + HDprintf("flushing) or between 1 and (<# of shrinks> - 1)\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n"); + HDprintf("flushing every 1000 shrinks ('-f 1000'), and will generate a random seed (no -r given).\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -339,7 +339,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose, old)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -352,7 +352,7 @@ int main(int argc, const char *argv[]) /* Remove records from datasets */ if(remove_records(fid, verbose, (unsigned long)nshrinks, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error removing records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -362,7 +362,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -372,7 +372,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 3c98f48..6adc6c5 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -326,19 +326,19 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n"); - printf(" [-n <# of reads between reopens>] <# of records>\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n"); - printf("between reopens ('-r 1')\n"); - printf("\n"); - printf("Note that the # of records *must* be the same as that supplied to\n"); - printf("swmr_sparse_writer\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n"); + HDprintf(" [-n <# of reads between reopens>] <# of records>\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n"); + HDprintf("between reopens ('-r 1')\n"); + HDprintf("\n"); + HDprintf("Note that the # of records *must* be the same as that supplied to\n"); + HDprintf("swmr_sparse_writer\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } /* end usage() */ int main(int argc, const char *argv[]) @@ -410,7 +410,7 @@ int main(int argc, const char *argv[]) /* Generate dataset names */ if(generate_symbols() < 0) { HDfprintf(stderr, "Error generating symbol names!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Create datatype for creating datasets */ @@ -420,7 +420,7 @@ int main(int argc, const char *argv[]) /* Reading records from datasets */ if(read_records(FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) { HDfprintf(stderr, "Error reading records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -430,7 +430,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -440,7 +440,7 @@ int main(int argc, const char *argv[]) /* Close objects created */ if(H5Tclose(symbol_tid) < 0) { HDfprintf(stderr, "Error closing symbol datatype!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index e46f54c..5173c71 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -49,7 +49,7 @@ static int add_records(hid_t fid, unsigned verbose, unsigned long nrecords, static void usage(void); - + /*------------------------------------------------------------------------- * Function: open_skeleton * @@ -117,7 +117,7 @@ open_skeleton(const char *filename, unsigned verbose) /* Emit informational message */ if(verbose) - fprintf(stderr, "Opening datasets\n"); + HDfprintf(stderr, "Opening datasets\n"); /* Seed the random number generator with the attribute in the file */ if((aid = H5Aopen(fid, "seed", H5P_DEFAULT)) < 0) @@ -139,7 +139,7 @@ open_skeleton(const char *filename, unsigned verbose) return fid; } - + /*------------------------------------------------------------------------- * Function: add_records * @@ -311,7 +311,7 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f /* Emit informational message */ if(verbose) - fprintf(stderr, "Closing datasets\n"); + HDfprintf(stderr, "Closing datasets\n"); /* Close the datasets */ for(u = 0; u < NLEVELS; u++) @@ -325,19 +325,19 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_sparse_writer [-q] [-f <# of records to write between\n"); - printf(" flushing file contents>] <# of records>\n"); - printf("\n"); - printf("<# of records to write between flushing file contents> should be 0\n"); - printf("(for no flushing) or between 1 and (<# of records> - 1)\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n"); - printf("('-f 1000')\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_sparse_writer [-q] [-f <# of records to write between\n"); + HDprintf(" flushing file contents>] <# of records>\n"); + HDprintf("\n"); + HDprintf("<# of records to write between flushing file contents> should be 0\n"); + HDprintf("(for no flushing) or between 1 and (<# of records> - 1)\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n"); + HDprintf("('-f 1000')\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -412,7 +412,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -425,7 +425,7 @@ int main(int argc, const char *argv[]) /* Append records to datasets */ if(add_records(fid, verbose, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error appending records to datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -435,7 +435,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -445,7 +445,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index af4b743..c4222ad 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -337,27 +337,27 @@ add_records(hid_t fid, hbool_t verbose, FILE *verbose_file, static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_start_write [-f <# of records to write between flushing file contents>]\n"); - printf(" [-i <index type>] [-c <deflate compression level>]\n"); - printf(" [-r <random seed>] [-q] <# of records>\n"); - printf("\n"); - printf("<# of records to write between flushing file contents> should be 0\n"); - printf("(for no flushing) or between 1 and (<# of records> - 1).\n"); - printf("\n"); - printf("<index type> should be b2 or ea\n"); - printf("\n"); - printf("<deflate compression level> should be -1 (for no compression) or 0-9\n"); - printf("\n"); - printf("<# of records> must be specified.\n"); - printf("\n"); - printf("Defaults to flushing every 10000 records ('-f 10000'),\n"); - printf("v1 b-tree indexing (-i b1), compression ('-c -1'),\n"); - printf("will generate a random seed (no -r given), and verbose (no '-q' given)\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_start_write [-f <# of records to write between flushing file contents>]\n"); + HDprintf(" [-i <index type>] [-c <deflate compression level>]\n"); + HDprintf(" [-r <random seed>] [-q] <# of records>\n"); + HDprintf("\n"); + HDprintf("<# of records to write between flushing file contents> should be 0\n"); + HDprintf("(for no flushing) or between 1 and (<# of records> - 1).\n"); + HDprintf("\n"); + HDprintf("<index type> should be b2 or ea\n"); + HDprintf("\n"); + HDprintf("<deflate compression level> should be -1 (for no compression) or 0-9\n"); + HDprintf("\n"); + HDprintf("<# of records> must be specified.\n"); + HDprintf("\n"); + HDprintf("Defaults to flushing every 10000 records ('-f 10000'),\n"); + HDprintf("v1 b-tree indexing (-i b1), compression ('-c -1'),\n"); + HDprintf("will generate a random seed (no -r given), and verbose (no '-q' given)\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } /* usage() */ /* @@ -468,7 +468,7 @@ int main(int argc, const char *argv[]) HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } } /* end if */ @@ -487,7 +487,7 @@ int main(int argc, const char *argv[]) /* Create the test file */ if((fid = create_file(FILENAME, verbose, verbose_file, random_seed)) < 0) { HDfprintf(stderr, "Error creating the file...\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Emit informational message */ @@ -501,13 +501,13 @@ int main(int argc, const char *argv[]) /* Create the datasets in the file */ if(create_datasets(fid, comp_level, verbose, verbose_file, index_type) < 0) { HDfprintf(stderr, "Error creating datasets...\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Enable SWMR writing mode */ if(H5Fstart_swmr_write(fid) < 0) { HDfprintf(stderr, "Error starting SWMR writing mode...\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -520,7 +520,7 @@ int main(int argc, const char *argv[]) /* Append records to datasets */ if(add_records(fid, verbose, verbose_file, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error appending records to datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -530,7 +530,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -540,7 +540,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_writer.c b/test/swmr_writer.c index ee7e32e..4c3e64a 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -277,21 +277,21 @@ add_records(hid_t fid, hbool_t verbose, FILE *verbose_file, static void usage(void) { - printf("\n"); - printf("Usage error!\n"); - printf("\n"); - printf("Usage: swmr_writer [-q] [-o] [-f <# of records to write between flushing\n"); - printf(" file contents>] [-r <random seed>] <# of records>\n"); - printf("\n"); - printf("<# of records to write between flushing file contents> should be 0\n"); - printf("(for no flushing) or between 1 and (<# of records> - 1).\n"); - printf("\n"); - printf("<# of records> must be specified.\n"); - printf("\n"); - printf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n"); - printf("flushing every 10000 records ('-f 10000'), and will generate a random seed (no -r given).\n"); - printf("\n"); - HDexit(1); + HDprintf("\n"); + HDprintf("Usage error!\n"); + HDprintf("\n"); + HDprintf("Usage: swmr_writer [-q] [-o] [-f <# of records to write between flushing\n"); + HDprintf(" file contents>] [-r <random seed>] <# of records>\n"); + HDprintf("\n"); + HDprintf("<# of records to write between flushing file contents> should be 0\n"); + HDprintf("(for no flushing) or between 1 and (<# of records> - 1).\n"); + HDprintf("\n"); + HDprintf("<# of records> must be specified.\n"); + HDprintf("\n"); + HDprintf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n"); + HDprintf("flushing every 10000 records ('-f 10000'), and will generate a random seed (no -r given).\n"); + HDprintf("\n"); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -379,7 +379,7 @@ int main(int argc, const char *argv[]) HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } } /* end if */ @@ -408,7 +408,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose, verbose_file, random_seed, old)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -421,7 +421,7 @@ int main(int argc, const char *argv[]) /* Append records to datasets */ if(add_records(fid, verbose, verbose_file, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error appending records to datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -431,7 +431,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -441,7 +441,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/tarray.c b/test/tarray.c index eb71ad6..0024746 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -65,7 +65,7 @@ typedef struct void *test_array_alloc_custom(size_t size, void *info); void test_array_free_custom(void *mem, void *info); - + /*------------------------------------------------------------------------- * Function: test_array_atomic_1d * @@ -189,7 +189,7 @@ test_array_atomic_1d(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_atomic_1d() */ - + /*------------------------------------------------------------------------- * Function: test_array_funcs * @@ -252,7 +252,7 @@ test_array_funcs(void) CHECK(ret, FAIL, "H5Tclose"); } /* end test_array_funcs() */ - + /*------------------------------------------------------------------------- * Function: test_array_atomic_3d * @@ -381,7 +381,7 @@ test_array_atomic_3d(void) } /* end test_array_atomic_3d() */ - + /*------------------------------------------------------------------------- * Function: test_array_array_atomic * @@ -540,7 +540,7 @@ test_array_array_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_array_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_atomic * @@ -747,7 +747,7 @@ test_array_compound_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_compound_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_array * @@ -1006,7 +1006,7 @@ test_array_compound_array(void) ** allocated. ** ****************************************************************/ - + /*------------------------------------------------------------------------- * Function: test_array_alloc_custom * @@ -1045,7 +1045,7 @@ test_array_alloc_custom(size_t size, void *info) return ret_value; } /* end test_array_alloc_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_free_custom * @@ -1081,7 +1081,7 @@ test_array_free_custom(void *_mem, void *info) return; } /* end test_array_free_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_atomic * @@ -1296,7 +1296,7 @@ test_array_vlen_atomic(void) } /* end test_array_vlen_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_array * @@ -1551,7 +1551,7 @@ test_array_vlen_array(void) } /* end test_array_vlen_array() */ - + /*------------------------------------------------------------------------- * Function: test_array_bkg * @@ -1855,7 +1855,7 @@ test_array_bkg(void) HDfree(dtsinfo); } /* end test_array_bkg() */ - + /*------------------------------------------------------------------------- * Function: test_compat * @@ -2146,11 +2146,11 @@ test_compat(void) CHECK_I(ret, "H5Fclose"); } /* end if */ else - printf("***cannot open the pre-created compound datatype test file (%s)\n",testfile); + HDprintf("***cannot open the pre-created compound datatype test file (%s)\n",testfile); } /* end test_compat() */ - + /*------------------------------------------------------------------------- * Function: test_array * @@ -2183,7 +2183,7 @@ test_array(void) } /* end test_array() */ - + /*------------------------------------------------------------------------- * Function: cleanup_array * diff --git a/test/tattr.c b/test/tattr.c index c7a2c23..7c2b5ce 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -174,7 +174,7 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static hid_t dcpl_g = H5P_DEFAULT; - + /**************************************************************** ** ** test_attr_basic_write(): Test basic H5A (attribute) code. @@ -414,7 +414,7 @@ test_attr_basic_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_write() */ - + /**************************************************************** ** ** test_attr_basic_read(): Test basic H5A (attribute) code. @@ -505,7 +505,7 @@ test_attr_basic_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_read() */ - + /**************************************************************** ** ** test_attr_flush(): Test H5A (attribute) code for performing @@ -572,7 +572,7 @@ test_attr_flush(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_flush() */ - + /**************************************************************** ** ** test_attr_plist(): Test Attribute Creation Property Lists @@ -696,7 +696,7 @@ test_attr_plist(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_plist() */ - + /**************************************************************** ** ** test_attr_compound_write(): Test H5A (attribute) code. @@ -785,7 +785,7 @@ test_attr_compound_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_write() */ - + /**************************************************************** ** ** test_attr_compound_read(): Test basic H5A (attribute) code. @@ -907,8 +907,8 @@ test_attr_compound_read(hid_t fapl) for(i = 0; i < ATTR4_DIM1; i++) for(j = 0; j < ATTR4_DIM2; j++) if(HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) { - printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); - printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); + HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); + HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c); } /* end if */ @@ -935,7 +935,7 @@ test_attr_compound_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_read() */ - + /**************************************************************** ** ** test_attr_scalar_write(): Test scalar H5A (attribute) writing code. @@ -1001,7 +1001,7 @@ test_attr_scalar_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_write() */ - + /**************************************************************** ** ** test_attr_scalar_read(): Test scalar H5A (attribute) reading code. @@ -1045,7 +1045,7 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ @@ -1072,7 +1072,7 @@ test_attr_scalar_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_read() */ - + /**************************************************************** ** ** test_attr_mult_write(): Test basic H5A (attribute) code. @@ -1193,7 +1193,7 @@ test_attr_mult_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_write() */ - + /**************************************************************** ** ** test_attr_mult_read(): Test basic H5A (attribute) code. @@ -1415,7 +1415,7 @@ test_attr_mult_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_read() */ - + /**************************************************************** ** ** attr_op1(): Attribute operator @@ -1455,7 +1455,7 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR return(ret); } /* end attr_op1() */ - + /**************************************************************** ** ** test_attr_iterate(): Test H5A (attribute) iterator code. @@ -1527,7 +1527,7 @@ test_attr_iterate(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_iterate() */ - + /**************************************************************** ** ** test_attr_delete(): Test H5A (attribute) code for deleting objects. @@ -1647,7 +1647,7 @@ test_attr_delete(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_delete() */ - + /**************************************************************** ** ** test_attr_dtype_shared(): Test H5A (attribute) code for using @@ -1823,7 +1823,7 @@ test_attr_dtype_shared(hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dtype_shared() */ - + /**************************************************************** ** ** test_attr_duplicate_ids(): Test operations with more than @@ -2068,7 +2068,7 @@ test_attr_duplicate_ids(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_duplicate_ids() */ - + /**************************************************************** ** ** test_attr_dense_verify(): Test basic H5A (attribute) code. @@ -2091,7 +2091,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) /* Re-open all the attributes by name and verify the data */ for(u = 0; u < max_attr; u++) { /* Open attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Aopen(loc_id, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); @@ -2115,7 +2115,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) CHECK(attr, FAIL, "H5Aopen_by_idx"); /* Verify Name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name); VERIFY(name_len, HDstrlen(attrname), "H5Aget_name"); if(HDstrcmp(check_name, attrname)) @@ -2138,7 +2138,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) return(-1); } /* test_attr_dense_verify() */ - + /**************************************************************** ** ** test_attr_dense_create(): Test basic H5A (attribute) code. @@ -2214,7 +2214,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2233,7 +2233,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) /* Add one more attribute, to push into "dense" storage */ /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2274,7 +2274,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_create() */ - + /**************************************************************** ** ** test_attr_dense_open(): Test basic H5A (attribute) code. @@ -2354,7 +2354,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2377,7 +2377,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) /* Add one more attribute, to push into "dense" storage */ /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2418,7 +2418,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_open() */ - + /**************************************************************** ** ** test_attr_dense_delete(): Test basic H5A (attribute) code. @@ -2510,7 +2510,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Add attributes, until well into dense storage */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2556,7 +2556,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Delete attributes until the attributes revert to compact storage again */ for(u--; u >= min_dense; u--) { /* Delete attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -2570,7 +2570,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test"); /* Delete one more attribute, which should cause reversion to compact storage */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -2583,7 +2583,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "test_attr_dense_verify"); /* Delete another attribute, to verify deletion in compact storage */ - sprintf(attrname, "attr %02u", (u - 1)); + HDsprintf(attrname, "attr %02u", (u - 1)); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -2612,7 +2612,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_delete() */ - + /**************************************************************** ** ** test_attr_dense_rename(): Test basic H5A (attribute) code. @@ -2706,7 +2706,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) /* Add attributes, until well into dense storage */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, H5I_INVALID_HID, "H5Acreate2"); @@ -2719,7 +2719,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Rename attribute */ - sprintf(new_attrname, "new attr %02u", u); + HDsprintf(new_attrname, "new attr %02u", u); /* Rename attribute */ ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT); @@ -2773,7 +2773,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) unsigned value; /* Attribute value */ /* Open attribute */ - sprintf(attrname, "new attr %02u", u); + HDsprintf(attrname, "new attr %02u", u); attr = H5Aopen(dataset, attrname, H5P_DEFAULT); CHECK(attr, H5I_INVALID_HID, "H5Aopen"); @@ -2804,7 +2804,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_rename() */ - + /**************************************************************** ** ** test_attr_dense_unlink(): Test basic H5A (attribute) code. @@ -2891,7 +2891,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) /* Add attributes, until well into dense storage */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2948,7 +2948,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_unlink() */ - + /**************************************************************** ** ** test_attr_dense_limits(): Test basic H5A (attribute) code. @@ -3035,7 +3035,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3056,7 +3056,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 1; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3088,7 +3088,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3118,7 +3118,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_limits() */ - + /**************************************************************** ** ** test_attr_dense_dup_ids(): Test operations with multiple ID @@ -3196,7 +3196,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3219,7 +3219,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3507,7 +3507,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) /* Delete a few attributes until the storage switches to compact */ for(u = min_dense-1; u <= max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); add_attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(add_attr, FAIL, "H5Acreate2"); @@ -3577,7 +3577,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(gid1, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3646,7 +3646,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_dense_dup_ids() */ - + /**************************************************************** ** ** test_attr_big(): Test basic H5A (attribute) code. @@ -3744,7 +3744,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3763,7 +3763,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 1; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3782,7 +3782,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 2; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT); if(low == H5F_LIBVER_LATEST) { CHECK(attr, FAIL, "H5Acreate2"); @@ -3806,7 +3806,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 3; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3829,7 +3829,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 1; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3844,7 +3844,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 3; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3859,7 +3859,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 2; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3874,7 +3874,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3921,7 +3921,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_big() */ - + /**************************************************************** ** ** test_attr_null_space(): Test basic H5A (attribute) code. @@ -4139,7 +4139,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_null_space() */ - + /**************************************************************** ** ** test_attr_deprec(): Test basic H5A (attribute) code. @@ -4247,7 +4247,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_attr_deprec() */ - + /**************************************************************** ** ** test_attr_many(): Test basic H5A (attribute) code. @@ -4284,7 +4284,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create many attributes */ for(u = 0; u < nattr; u++) { - sprintf(attrname, "a-%06u", u); + HDsprintf(attrname, "a-%06u", u); exists = H5Aexists(gid, attrname); VERIFY(exists, FALSE, "H5Aexists"); @@ -4337,7 +4337,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) for(u = 0; u < nattr; u++) { unsigned value; /* Attribute value */ - sprintf(attrname, "a-%06u", u); + HDsprintf(attrname, "a-%06u", u); exists = H5Aexists(gid, attrname); VERIFY(exists, TRUE, "H5Aexists"); @@ -4376,7 +4376,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_many() */ - + /**************************************************************** ** ** test_attr_corder_create_empty(): Test basic H5A (attribute) code. @@ -4497,7 +4497,7 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_basic() */ - + /**************************************************************** ** ** test_attr_corder_create_compact(): Test basic H5A (attribute) code. @@ -4587,7 +4587,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) /* Create several attributes, but keep storage in compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -4677,7 +4677,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) H5A_info_t ainfo; /* Attribute information */ /* Retrieve information for attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_name"); @@ -4700,7 +4700,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_compact() */ - + /**************************************************************** ** ** test_attr_corder_create_dense(): Test basic H5A (attribute) code. @@ -4792,7 +4792,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) /* Create several attributes, but keep storage in compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -4815,7 +4815,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) } /* end for */ /* Create another attribute, to push into dense storage */ - sprintf(attrname, "attr %02u", max_compact); + HDsprintf(attrname, "attr %02u", max_compact); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -4909,7 +4909,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) H5A_info_t ainfo; /* Attribute information */ /* Retrieve information for attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_name"); @@ -4932,7 +4932,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_dense() */ - + /**************************************************************** ** ** test_attr_corder_create_reopen(): Test basic H5A (attribute) code. @@ -5040,7 +5040,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_create_reopen() */ - + /**************************************************************** ** ** test_attr_corder_transition(): Test basic H5A (attribute) code. @@ -5185,7 +5185,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Create several attributes, but keep storage in compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5208,7 +5208,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) } /* end for */ /* Create another attribute, to push into dense storage */ - sprintf(attrname, "attr %02u", max_compact); + HDsprintf(attrname, "attr %02u", max_compact); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5236,7 +5236,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete several attributes from object, until attribute storage resumes compact form */ for(u = max_compact; u >= min_dense; u--) { - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5256,7 +5256,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) } /* end for */ /* Delete another attribute, to push attribute storage into compact form */ - sprintf(attrname, "attr %02u", (min_dense - 1)); + HDsprintf(attrname, "attr %02u", (min_dense - 1)); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5272,7 +5272,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Re-add attributes to get back into dense form */ for(u = (min_dense - 1); u < (max_compact + 1); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5360,7 +5360,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete several attributes from object, until attribute storage resumes compact form */ for(u = max_compact; u >= min_dense; u--) { - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5380,7 +5380,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) } /* end for */ /* Delete another attribute, to push attribute storage into compact form */ - sprintf(attrname, "attr %02u", (min_dense - 1)); + HDsprintf(attrname, "attr %02u", (min_dense - 1)); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5396,7 +5396,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Re-add attributes to get back into dense form */ for(u = (min_dense - 1); u < (max_compact + 1); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5425,11 +5425,11 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete all attributes */ for(u = max_compact; u > 0; u--) { - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); } /* end for */ - sprintf(attrname, "attr %02u", 0); + HDsprintf(attrname, "attr %02u", 0); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); } /* end for */ @@ -5451,7 +5451,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_transition() */ - + /**************************************************************** ** ** test_attr_corder_delete(): Test basic H5A (attribute) code. @@ -5571,7 +5571,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) /* Create attributes, until attribute storage is in dense form */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5657,7 +5657,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_delete() */ - + /*------------------------------------------------------------------------- * Function: attr_info_by_idx_check * @@ -5804,7 +5804,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, return(-1); } /* end attr_info_by_idx_check() */ - + /**************************************************************** ** ** test_attr_info_by_idx(): Test basic H5A (attribute) code. @@ -5912,7 +5912,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5949,7 +5949,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6019,7 +6019,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_info_by_idx() */ - + /*************************************************************** ** ** test_attr_info_null_info_pointer(): A test to ensure that @@ -6078,7 +6078,7 @@ test_attr_info_null_info_pointer(hid_t fcpl, hid_t fapl) CHECK(err_ret, FAIL, "H5Fclose"); } - + /*************************************************************** ** ** test_attr_rename_invalid_name(): A test to ensure that @@ -6167,7 +6167,7 @@ test_attr_rename_invalid_name(hid_t fcpl, hid_t fapl) CHECK(err_ret, FAIL, "H5Fclose"); } - + /*************************************************************** ** ** test_attr_get_name_invalid_buf(): A test to ensure that @@ -6221,7 +6221,7 @@ test_attr_get_name_invalid_buf(hid_t fcpl, hid_t fapl) CHECK(err_ret, FAIL, "H5Fclose"); } - + /**************************************************************** ** ** test_attr_delete_by_idx(): Test basic H5A (attribute) code. @@ -6357,7 +6357,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6429,9 +6429,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", (u + 1)); + HDsprintf(attrname, "attr %02u", (u + 1)); else - sprintf(attrname, "attr %02u", (max_compact - (u + 2))); + HDsprintf(attrname, "attr %02u", (max_compact - (u + 2))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6467,7 +6467,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6554,9 +6554,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", (u + 1)); + HDsprintf(attrname, "attr %02u", (u + 1)); else - sprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2))); + HDsprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6600,7 +6600,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, to push into dense form */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6665,9 +6665,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", ((u * 2) + 1)); + HDsprintf(attrname, "attr %02u", ((u * 2) + 1)); else - sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2))); + HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6714,9 +6714,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", ((u * 2) + 3)); + HDsprintf(attrname, "attr %02u", ((u * 2) + 3)); else - sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4))); + HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6758,7 +6758,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_delete_by_idx() */ - + /**************************************************************** ** ** attr_iterate2_cb(): Revised attribute operator @@ -6806,7 +6806,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); } /* end if */ /* Verify name of link */ - sprintf(attrname, "attr %02u", (unsigned)my_info.corder); + HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder); if(HDstrcmp(attr_name, attrname)) return(H5_ITER_ERROR); @@ -6832,7 +6832,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); } /* end attr_iterate2_cb() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /**************************************************************** ** ** attr_iterate1_cb(): Attribute operator @@ -6845,7 +6845,7 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data) } /* end attr_iterate1_cb() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: attr_iterate2_fail_cb * @@ -6867,7 +6867,7 @@ attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED * return(H5_ITER_ERROR); } /* end attr_iterate2_fail_cb() */ - + /*------------------------------------------------------------------------- * Function: attr_iterate_check * @@ -7167,7 +7167,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_iterate_check() */ - + /**************************************************************** ** ** test_attr_iterate2(): Test basic H5A (attribute) code. @@ -7320,7 +7320,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7390,7 +7390,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7476,7 +7476,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) HDfree(visited); } /* test_attr_iterate2() */ - + /*------------------------------------------------------------------------- * Function: attr_open_by_idx_check * @@ -7536,7 +7536,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, return(-1); } /* end attr_open_by_idx_check() */ - + /**************************************************************** ** ** test_attr_open_by_idx(): Test basic H5A (attribute) code. @@ -7671,7 +7671,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7729,7 +7729,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7803,7 +7803,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: attr_open_check * @@ -7834,7 +7834,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, /* Open each attribute on object by index and check that it's the correct one */ for(u = 0; u < max_attrs; u++) { /* Open the attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr_id = H5Aopen(obj_id, attrname, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Aopen"); @@ -7889,7 +7889,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_open_check() */ - + /**************************************************************** ** ** test_attr_open_by_name(): Test basic H5A (attribute) code. @@ -8004,7 +8004,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -8071,7 +8071,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -8149,7 +8149,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_name() */ - + /**************************************************************** ** ** test_attr_create_by_name(): Test basic H5A (attribute) code. @@ -8253,7 +8253,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate_by_name"); @@ -8310,7 +8310,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate_by_name"); @@ -8534,7 +8534,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -8870,7 +8870,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -8977,7 +8977,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Create new attribute name */ - sprintf(attrname2, "new attr %02u", u); + HDsprintf(attrname2, "new attr %02u", u); /* Change second dataset's attribute's name */ ret = H5Arename_by_name(fid, DSET2_NAME, attrname, attrname2, H5P_DEFAULT); @@ -9321,7 +9321,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -9431,7 +9431,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Delete attributes from second dataset */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Delete second dataset's attribute */ ret = H5Adelete_by_name(fid, DSET2_NAME, attrname, H5P_DEFAULT); @@ -9695,7 +9695,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -9822,7 +9822,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Check ref count on attributes of first dataset */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Open attribute on first dataset */ attr = H5Aopen(dataset, attrname, H5P_DEFAULT); @@ -10097,7 +10097,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Create attributes on group */ for (i=0; i<BUG2_NATTR; i++) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); aid = H5Acreate2(gid, aname, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -10107,7 +10107,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Delete every other attribute */ for (i=1; i<BUG2_NATTR; i+=2) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); ret = H5Adelete(gid, aname); CHECK(ret, FAIL, "H5Adelete"); } @@ -10131,7 +10131,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Open an attribute in the middle */ i = (BUG2_NATTR / 4) * 2; - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); aid = H5Aopen(gid, aname, H5P_DEFAULT); CHECK(aid, FAIL, "H5Aopen"); @@ -10174,7 +10174,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Create attributes on group */ for (i=0; i<BUG2_NATTR2; i++) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); aid = H5Acreate2(gid, aname, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -10184,7 +10184,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Delete every other attribute */ for (i=0; i<BUG2_NATTR2; i++) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); ret = H5Adelete(gid, aname); CHECK(ret, FAIL, "H5Adelete"); } @@ -11069,7 +11069,7 @@ test_attr_bug9(hid_t fcpl, hid_t fapl) /**************************************************************** ** -** test_attr_delete_dense(): +** test_attr_delete_dense(): ** This is to verify the error as described in HDFFV-9277 ** is fixed when deleting the last "large" attribute that ** is stored densely. @@ -11163,17 +11163,18 @@ test_attr(void) { hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ - hid_t dcpl = -1; - unsigned new_format; /* Whether to use the new format or not */ - unsigned use_shared; /* Whether to use shared attributes or not */ - unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */ - herr_t ret; /* Generic return value */ + hid_t dcpl = -1; /* Dataset creation property list */ + unsigned new_format; /* Whether to use the new format or not */ + unsigned use_shared; /* Whether to use shared attributes or not */ + unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */ + herr_t ret; /* Generic return value */ MESSAGE(5, ("Testing Attributes\n")); fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); + /* fapl2 uses "latest version of the format" for creating objects in the file */ fapl2 = H5Pcopy(fapl); CHECK(fapl2, FAIL, "H5Pcopy"); ret = H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); @@ -11207,6 +11208,7 @@ test_attr(void) for(new_format = FALSE; new_format <= TRUE; new_format++) { hid_t my_fapl; + /* Set the FAPL for the type of format */ if(new_format) { MESSAGE(7, ("testing with new file format\n")); my_fapl = fapl2; @@ -11262,8 +11264,7 @@ test_attr(void) test_attr_rename_invalid_name(my_fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */ test_attr_get_name_invalid_buf(my_fcpl, my_fapl); /* Test passing NULL buffer to H5Aget_name(_by_idx) */ - /* New attribute API routine tests - */ + /* New attribute API routine tests */ test_attr_info_by_idx(new_format, my_fcpl, my_fapl); /* Test querying attribute info by index */ test_attr_delete_by_idx(new_format, my_fcpl, my_fapl); /* Test deleting attribute by index */ test_attr_iterate2(new_format, my_fcpl, my_fapl); /* Test iterating over attributes by index */ @@ -11271,8 +11272,7 @@ test_attr(void) test_attr_open_by_name(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */ test_attr_create_by_name(new_format, my_fcpl, my_fapl); /* Test creating attributes by name */ - /* Tests that address specific bugs - */ + /* Tests that address specific bugs */ test_attr_bug1(my_fcpl, my_fapl); /* Test odd allocation operations */ test_attr_bug2(my_fcpl, my_fapl); /* Test many deleted attributes */ test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */ @@ -11285,8 +11285,7 @@ test_attr(void) test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */ - /* tests specific to the "new format" - */ + /* tests specific to the "new format" */ if (new_format == TRUE) { /* General attribute tests */ test_attr_dense_create(my_fcpl, my_fapl); /* Test dense attribute storage creation */ @@ -11297,8 +11296,7 @@ test_attr(void) test_attr_dense_limits(my_fcpl, my_fapl); /* Test dense attribute storage limits */ test_attr_dense_dup_ids(my_fcpl, my_fapl); /* Test duplicated IDs for dense attribute storage */ - /* Attribute creation order tests - */ + /* Attribute creation order tests */ test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */ test_attr_corder_create_compact(my_fcpl, my_fapl); /* Test compact attribute storage on an object w/attribute creation order info */ test_attr_corder_create_dense(my_fcpl, my_fapl);/* Test dense attribute storage on an object w/attribute creation order info */ @@ -11306,8 +11304,7 @@ test_attr(void) test_attr_corder_transition(my_fcpl, my_fapl); /* Test attribute storage transitions on an object w/attribute creation order info */ test_attr_corder_delete(my_fcpl, my_fapl); /* Test deleting object using dense storage w/attribute creation order info */ - /* More complex tests with exclusively both "new format" and "shared" attributes - */ + /* More complex tests with exclusively both "new format" and "shared" attributes */ if(use_shared == TRUE) { test_attr_shared_write(my_fcpl, my_fapl); /* Test writing to shared attributes in compact & dense storage */ test_attr_shared_rename(my_fcpl, my_fapl); /* Test renaming shared attributes in compact & dense storage */ @@ -11347,7 +11344,7 @@ test_attr(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_attr() */ - + /*------------------------------------------------------------------------- * Function: cleanup_attr * @@ -11365,6 +11362,6 @@ test_attr(void) void cleanup_attr(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/tcheck_version.c b/test/tcheck_version.c index 574d7c9..2611178 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -29,7 +29,7 @@ #include "h5test.h" -#define progname "tcheck_version" +#define progname "tcheck_version" /* prototypes */ void showhelp(void); @@ -37,20 +37,20 @@ void parse(int ac, char **av); void abort_intercept (int H5_ATTR_UNUSED sig); /* global variables */ -unsigned major = H5_VERS_MAJOR; -unsigned minor = H5_VERS_MINOR; -unsigned release = H5_VERS_RELEASE; +unsigned major = H5_VERS_MAJOR; +unsigned minor = H5_VERS_MINOR; +unsigned release = H5_VERS_RELEASE; void showhelp(void) { - printf("Usage: " progname " [-h] [-t<vers>]\n"); - printf("\t-h\tShow this page and version information\n"); - printf("\t-t<vers>: Test by changing (adding 1 to) the <vers> to trigger\n"); - printf("\t\t the warning. <vers> can be:\n"); - printf("\t\t\tM for Major version number (%d)\n", H5_VERS_MAJOR); - printf("\t\t\tm for Minor version number (%d)\n", H5_VERS_MINOR); - printf("\t\t\tr for Release number (%d)\n", H5_VERS_RELEASE); + HDprintf("Usage: " progname " [-h] [-t<vers>]\n"); + HDprintf("\t-h\tShow this page and version information\n"); + HDprintf("\t-t<vers>: Test by changing (adding 1 to) the <vers> to trigger\n"); + HDprintf("\t\t the warning. <vers> can be:\n"); + HDprintf("\t\t\tM for Major version number (%d)\n", H5_VERS_MAJOR); + HDprintf("\t\t\tm for Minor version number (%d)\n", H5_VERS_MINOR); + HDprintf("\t\t\tr for Release number (%d)\n", H5_VERS_RELEASE); } @@ -60,36 +60,36 @@ parse(int ac, char **av) char *pt; while (--ac > 0){ - pt = *(++av); - if (*pt != '-') { - fprintf(stderr, "Unknown option(%s). Aborted.\n", *av); - exit(EXIT_FAILURE); - }else{ - switch(*(++pt)) { - case 't': /* option -t */ - switch(*(++pt)) { - case 'M': - major++; - break; - case 'm': - minor++; - break; - case 'r': - release++; - break; - default: - fprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av); - exit(EXIT_FAILURE); - } - break; - case 'h': /* help page */ - showhelp(); - exit(EXIT_SUCCESS); - default: - fprintf(stderr, "Unknown option(%s). Aborted.\n", *av); - exit(EXIT_FAILURE); - } - } + pt = *(++av); + if (*pt != '-') { + HDfprintf(stderr, "Unknown option(%s). Aborted.\n", *av); + HDexit(EXIT_FAILURE); + }else{ + switch(*(++pt)) { + case 't': /* option -t */ + switch(*(++pt)) { + case 'M': + major++; + break; + case 'm': + minor++; + break; + case 'r': + release++; + break; + default: + HDfprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av); + HDexit(EXIT_FAILURE); + } + break; + case 'h': /* help page */ + showhelp(); + HDexit(EXIT_SUCCESS); + default: + HDfprintf(stderr, "Unknown option(%s). Aborted.\n", *av); + HDexit(EXIT_FAILURE); + } + } } } diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 8bc2078..49868ca 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -40,7 +40,7 @@ fi # Define symbols EXIT_SUCCESS=0 EXIT_FAILURE=1 -EXIT_VALUE=$EXIT_SUCCESS # Default all tests succeed +EXIT_VALUE=$EXIT_SUCCESS # Default all tests succeed RESULT_PASSED=" PASSED" RESULT_FAILED="*FAILED*" RESULT_SKIP="-SKIP-" @@ -97,17 +97,17 @@ TOOLTEST() { cat $actual_err >> $actual if [ $exit_code -eq 0 ];then - echo "$RESULT_PASSED" - test yes = "$verbose" && sed 's/^/ /' < $actual + echo "$RESULT_PASSED" + test yes = "$verbose" && sed 's/^/ /' < $actual else - echo "$RESULT_FAILED" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && sed 's/^/ /' < $actual + echo "$RESULT_FAILED" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && sed 's/^/ /' < $actual fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } @@ -122,7 +122,9 @@ for FILE in use_*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE usecases_test + if test -f "$FILE" ; then + cp $FILE usecases_test + fi done # With the --disable-shared option, swmr program files are built in the test @@ -131,7 +133,14 @@ done # always be copied, swmr files in .libs should be copied only if they exists. if [ -f .libs/use_append_chunk ]; then mkdir usecases_test/.libs - cp .libs/use_* usecases_test/.libs + for FILE in .libs/use_*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + if test -f "$FILE" ; then + cp $FILE usecases_test/.libs + fi + done cp .libs/twriteorder usecases_test/.libs fi @@ -176,10 +185,10 @@ for p in $USECASES_PROGRAMS; do TOOLTEST ./$p -l w TOOLTEST ./$p -l r # use case 1.9, testing with multi-planes chunks - TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks + TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks # cleanup temp datafile if test -z "$HDF5_NOCLEANUP"; then - rm -f $p.h5 + rm -f $p.h5 fi done diff --git a/test/testfiles/err_compat_2 b/test/testfiles/err_compat_2 index 75e8769..467ba4c 100644 --- a/test/testfiles/err_compat_2 +++ b/test/testfiles/err_compat_2 @@ -1 +1 @@ -Test skipped because backward compatbility with v1.6 is NOT configured in +Test skipped because backward compatibility with v1.6 is NOT configured in diff --git a/test/testfiles/error_test_2 b/test/testfiles/error_test_2 index 6852f6f..85bc2e7 100644 --- a/test/testfiles/error_test_2 +++ b/test/testfiles/error_test_2 @@ -1 +1 @@ -Test skipped because backward compatbility with v1.6 is configured in +Test skipped because backward compatibility with v1.6 is configured in diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index ca46dcb..3cdf10f 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -20,7 +20,7 @@ # the verification of this feature needs to occur in separate processes # from the one in which the file is being manipulated in. (i.e., we have # a single writer process, and various reader processes spawning off -# and doing the verification that individual objects are being +# and doing the verification that individual objects are being # correctly flushed). # # Programmer: @@ -80,23 +80,30 @@ fi # HDF5 has several tests that create and delete signal files to communicate # between processes, and it seems that even though the names of the files are # different, occasionally the wrong file is deleted, interrupting the flow of -# the test. Running each of these tests in its own directory should eliminate +# the test. Running each of these tests in its own directory should eliminate # the problem. mkdir flushrefresh_test cp flushrefresh flushrefresh_test # With the --disable-shared option, flushrefresh is built in the test directory, -# otherwise it is in test/.libs with a wrapper script named flushrefresh in -# the test directory. test/flushrefresh should always be copied, +# otherwise it is in test/.libs with a wrapper script named flushrefresh in +# the test directory. test/flushrefresh should always be copied, # .libs/flushrefresh should be copied only if it exists. if [ -f .libs/flushrefresh ]; then mkdir flushrefresh_test/.libs - cp .libs/flushrefresh flushrefresh_test/.libs + for FILE in .libs/flushrefresh*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + if test -f "$FILE" ; then + cp $FILE flushrefresh_test/.libs + fi + done fi cd flushrefresh_test # ================================================= -# Set up/initialize some variables to be used later +# Set up/initialize some variables to be used later # ================================================= testfile=flushrefresh.h5 startsignal=flushrefresh_VERIFICATION_START @@ -119,13 +126,13 @@ pid_main=$! # ======================================= until [ $verification_done -eq 1 ]; do - + # Wait for signal from test program that verification routine can run. before=`TimeStamp` until [ -s $startsignal ]; do after=`TimeStamp` timediff=`expr $after - $before` - if [ $timediff -gt $timeout_length ]; then + if [ $timediff -gt $timeout_length ]; then nerrors=`expr $nerrors + 1` timedout=1 break @@ -165,7 +172,7 @@ if [ $timedout -eq 0 ]; then until [ -s $startsignal ]; do after=`TimeStamp` timediff=`expr $after - $before` - if [ $timediff -gt $timeout_length ]; then + if [ $timediff -gt $timeout_length ]; then nerrors=`expr $nerrors + 1` timedout=1 break diff --git a/test/testframe.c b/test/testframe.c index 97b2d1f..3c2a335 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -42,10 +42,10 @@ typedef struct TestStruct { * Variables used by testing framework. */ static int enable_error_stack = 0; /* enable error stack; disable=0 enable=1 */ -static int num_errs = 0; /* Total number of errors during testing */ +static int num_errs = 0; /* Total number of errors during testing */ int TestVerbosity = VERBO_DEF; /* Default Verbosity is Low */ -static int Summary = 0; /* Show test summary. Default is no. */ -static int CleanUp = 1; /* Do cleanup or not. Default is yes. */ +static int Summary = 0; /* Show test summary. Default is no. */ +static int CleanUp = 1; /* Do cleanup or not. Default is yes. */ static int TestExpress = -1; /* Do TestExpress or not. -1 means not set yet. */ static TestStruct *Test = NULL; /* Array of tests */ static unsigned TestAlloc = 0; /* Size of the Test array */ @@ -74,14 +74,12 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con { /* Sanity checking */ if (HDstrlen(TheDescr) >= MAXTESTDESC) { - printf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", - TheDescr, MAXTESTDESC); - exit(EXIT_FAILURE); + HDprintf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", TheDescr, MAXTESTDESC); + HDexit(EXIT_FAILURE); } /* end if */ if (HDstrlen(TheName) >= MAXTESTNAME) { - printf("Test name too long, increase MAXTESTNAME(%d).\n", - MAXTESTNAME); - exit(EXIT_FAILURE); + HDprintf("Test name too long, increase MAXTESTNAME(%d).\n", MAXTESTNAME); + HDexit(EXIT_FAILURE); } /* end if */ /* Check for increasing the Test array size */ @@ -91,8 +89,8 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con /* Reallocate array */ if(NULL == (newTest = (TestStruct *)HDrealloc(Test, newAlloc * sizeof(TestStruct)))) { - printf("Out of memory for tests, Index = %u, TestAlloc = %u, newAlloc = %u\n", Index, TestAlloc, newAlloc); - exit(EXIT_FAILURE); + HDprintf("Out of memory for tests, Index = %u, TestAlloc = %u, newAlloc = %u\n", Index, TestAlloc, newAlloc); + HDexit(EXIT_FAILURE); } /* end if */ /* Update info */ @@ -167,7 +165,7 @@ void TestUsage(void) unsigned i; print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n", - TestProgName, (TestPrivateUsage ? "<extra options>" : "")); + TestProgName, (TestPrivateUsage ? "<extra options>" : "")); print_func(" [-[e]x[clude] name]+ \n"); print_func(" [-o[nly] name]+ \n"); print_func(" [-b[egin] name] \n"); @@ -228,78 +226,80 @@ void TestParseCmdLine(int argc, char *argv[]) int ret_code; while (argv++, --argc > 0){ - if ((HDstrcmp(*argv, "-verbose") == 0) || - (HDstrcmp(*argv, "-v") == 0)) { - if (argc > 0){ - --argc; ++argv; - ParseTestVerbosity(*argv); - }else{ - TestUsage(); - exit(EXIT_FAILURE); + if ((HDstrcmp(*argv, "-verbose") == 0) || (HDstrcmp(*argv, "-v") == 0)) { + if (argc > 0){ + --argc; ++argv; + ParseTestVerbosity(*argv); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } } - } - else if (((HDstrcmp(*argv, "-exclude") == 0) || - (HDstrcmp(*argv, "-x") == 0))) { - if (argc > 0){ - --argc; ++argv; - SetTest(*argv, SKIPTEST); - }else{ - TestUsage(); - exit(EXIT_FAILURE); + else if (((HDstrcmp(*argv, "-exclude") == 0) || + (HDstrcmp(*argv, "-x") == 0))) { + if (argc > 0){ + --argc; ++argv; + SetTest(*argv, SKIPTEST); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } } - } - else if (((HDstrcmp(*argv, "-begin") == 0) || - (HDstrcmp(*argv, "-b") == 0))) { - if (argc > 0){ - --argc; ++argv; - SetTest(*argv, BEGINTEST); - }else{ - TestUsage(); - exit(EXIT_FAILURE); + else if (((HDstrcmp(*argv, "-begin") == 0) || + (HDstrcmp(*argv, "-b") == 0))) { + if (argc > 0){ + --argc; ++argv; + SetTest(*argv, BEGINTEST); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } } - } - else if (((HDstrcmp(*argv, "-only") == 0) || - (HDstrcmp(*argv, "-o") == 0))) { - if(argc > 0) { - unsigned Loop; + else if (((HDstrcmp(*argv, "-only") == 0) || + (HDstrcmp(*argv, "-o") == 0))) { + if(argc > 0) { + unsigned Loop; - --argc; ++argv; + --argc; ++argv; - /* Skip all tests, then activate only one. */ + /* Skip all tests, then activate only one. */ if(!skipped_all) { for(Loop = 0; Loop < Index; Loop++) Test[Loop].SkipFlag = 1; skipped_all = TRUE; } /* end if */ - SetTest(*argv, ONLYTEST); - } /* end if */ - else { - TestUsage(); - exit(EXIT_FAILURE); + SetTest(*argv, ONLYTEST); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } + } + else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0)) + Summary = 1; + else if (HDstrcmp(*argv, "-enable-error-stack") == 0) + enable_error_stack = 1; + else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) { + TestUsage(); + HDexit(EXIT_SUCCESS); + } + else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0)) + SetTestNoCleanup(); + else { + /* non-standard option. Break out. */ + break; } - } - else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0)) - Summary = 1; - else if (HDstrcmp(*argv, "-enable-error-stack") == 0) - enable_error_stack = 1; - else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) { - TestUsage(); - exit(EXIT_SUCCESS); - } - else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0)) - SetTestNoCleanup(); - else { - /* non-standard option. Break out. */ - break; - } } /* Call extra parsing function if provided. */ if (NULL != TestPrivateParser){ - ret_code=TestPrivateParser(argc+1, argv-1); - if (ret_code != 0) - exit(EXIT_FAILURE); + ret_code=TestPrivateParser(argc+1, argv-1); + if (ret_code != 0) + HDexit(EXIT_FAILURE); } } @@ -318,10 +318,10 @@ void PerformTests(void) MESSAGE(2, ("Testing -- %s (%s) \n", Test[Loop].Description, Test[Loop].Name)); MESSAGE(5, ("===============================================\n")); Test[Loop].NumErrors = num_errs; - Test_parameters = Test[Loop].Parameters; - ALARM_ON; + Test_parameters = Test[Loop].Parameters; + ALARM_ON; Test[Loop].Call(); - ALARM_OFF; + ALARM_OFF; Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors; MESSAGE(5, ("===============================================\n")); MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors)); @@ -440,18 +440,18 @@ int GetTestExpress(void) /* set it here for now. Should be done in something like h5test_init(). */ if(TestExpress==-1) { - env_val = getenv("HDF5TestExpress"); - - if(env_val == NULL) - SetTestExpress(1); - else if(strcmp(env_val, "0") == 0) - SetTestExpress(0); - else if(strcmp(env_val, "1") == 0) - SetTestExpress(1); - else if(strcmp(env_val, "2") == 0) - SetTestExpress(2); - else - SetTestExpress(3); + env_val = getenv("HDF5TestExpress"); + + if(env_val == NULL) + SetTestExpress(1); + else if(strcmp(env_val, "0") == 0) + SetTestExpress(0); + else if(strcmp(env_val, "1") == 0) + SetTestExpress(1); + else if(strcmp(env_val, "2") == 0) + SetTestExpress(2); + else + SetTestExpress(3); } return(TestExpress); @@ -508,13 +508,13 @@ int SetTestNoCleanup(void) void ParseTestVerbosity(char *argv) { if (*argv == 'l') - SetTestVerbosity(VERBO_LO); + SetTestVerbosity(VERBO_LO); else if (*argv == 'm') - SetTestVerbosity(VERBO_MED); + SetTestVerbosity(VERBO_MED); else if (*argv == 'h') - SetTestVerbosity(VERBO_HI); + SetTestVerbosity(VERBO_HI); else - SetTestVerbosity(atoi(argv)); + SetTestVerbosity(atoi(argv)); } @@ -559,9 +559,9 @@ TestErrPrintf(const char *format, ...) num_errs++; /* Print the requested information */ - va_start(arglist, format); - ret_value = vprintf(format, arglist); - va_end(arglist); + HDva_start(arglist, format); + ret_value = HDvprintf(format, arglist); + HDva_end(arglist); /* Return the length of the string produced (like printf() does) */ return ret_value; @@ -582,34 +582,34 @@ void SetTest(const char *testname, int action) switch (action){ case SKIPTEST: for (Loop = 0; Loop < Index; Loop++) - if (HDstrcmp(testname, Test[Loop].Name) == 0){ - Test[Loop].SkipFlag = 1; - break; - } + if (HDstrcmp(testname, Test[Loop].Name) == 0){ + Test[Loop].SkipFlag = 1; + break; + } break; case BEGINTEST: for (Loop = 0; Loop < Index; Loop++) { - if (HDstrcmp(testname, Test[Loop].Name) != 0) - Test[Loop].SkipFlag = 1; - else{ - /* Found it. Set it to run. Done. */ - Test[Loop].SkipFlag = 0; - break; - } + if (HDstrcmp(testname, Test[Loop].Name) != 0) + Test[Loop].SkipFlag = 1; + else{ + /* Found it. Set it to run. Done. */ + Test[Loop].SkipFlag = 0; + break; + } } break; case ONLYTEST: for (Loop = 0; Loop < Index; Loop++) { - if (HDstrcmp(testname, Test[Loop].Name) == 0) { - /* Found it. Set it to run. Break to skip the rest. */ - Test[Loop].SkipFlag = 0; - break; - } + if (HDstrcmp(testname, Test[Loop].Name) == 0) { + /* Found it. Set it to run. Break to skip the rest. */ + Test[Loop].SkipFlag = 0; + break; + } } break; default: /* error */ - printf("*** ERROR: Unknown action (%d) for SetTest\n", action); + HDprintf("*** ERROR: Unknown action (%d) for SetTest\n", action); break; } } diff --git a/test/testhdf5.h b/test/testhdf5.h index 1f3f6a0..ef3b784 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -177,53 +177,53 @@ extern "C" { #endif /* Prototypes for the test routines */ -void test_metadata(void); -void test_checksum(void); -void test_tst(void); -void test_heap(void); -void test_refstr(void); -void test_file(void); -void test_h5o(void); -void test_h5t(void); -void test_h5s(void); -void test_coords(void); -void test_h5d(void); -void test_attr(void); -void test_select(void); -void test_time(void); -void test_reference(void); -void test_vltypes(void); -void test_vlstrings(void); -void test_iterate(void); -void test_array(void); -void test_genprop(void); -void test_configure(void); -void test_misc(void); -void test_ids(void); -void test_skiplist(void); -void test_sohm(void); -void test_unicode(void); +void test_metadata(void); +void test_checksum(void); +void test_tst(void); +void test_heap(void); +void test_refstr(void); +void test_file(void); +void test_h5o(void); +void test_h5t(void); +void test_h5s(void); +void test_coords(void); +void test_h5d(void); +void test_attr(void); +void test_select(void); +void test_time(void); +void test_reference(void); +void test_vltypes(void); +void test_vlstrings(void); +void test_iterate(void); +void test_array(void); +void test_genprop(void); +void test_configure(void); +void test_misc(void); +void test_ids(void); +void test_skiplist(void); +void test_sohm(void); +void test_unicode(void); /* Prototypes for the cleanup routines */ -void cleanup_metadata(void); -void cleanup_checksum(void); -void cleanup_file(void); -void cleanup_h5o(void); -void cleanup_h5s(void); -void cleanup_coords(void); -void cleanup_attr(void); -void cleanup_select(void); -void cleanup_time(void); -void cleanup_reference(void); -void cleanup_vltypes(void); -void cleanup_vlstrings(void); -void cleanup_iterate(void); -void cleanup_array(void); -void cleanup_genprop(void); -void cleanup_configure(void); -void cleanup_sohm(void); -void cleanup_misc(void); -void cleanup_unicode(void); +void cleanup_metadata(void); +void cleanup_checksum(void); +void cleanup_file(void); +void cleanup_h5o(void); +void cleanup_h5s(void); +void cleanup_coords(void); +void cleanup_attr(void); +void cleanup_select(void); +void cleanup_time(void); +void cleanup_reference(void); +void cleanup_vltypes(void); +void cleanup_vlstrings(void); +void cleanup_iterate(void); +void cleanup_array(void); +void cleanup_genprop(void); +void cleanup_configure(void); +void cleanup_sohm(void); +void cleanup_misc(void); +void cleanup_unicode(void); #ifdef __cplusplus } diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in index 94e6c7e..3d6b3ce 100644 --- a/test/testlinks_env.sh.in +++ b/test/testlinks_env.sh.in @@ -19,15 +19,15 @@ nerrors=0 ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # test for external links with HDF5_EXT_PREFIX echo "Testing external link with HDF5_EXT_PREFIX" -TEST_NAME=links_env # The test name -TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary -ENVCMD="env HDF5_EXT_PREFIX=.:tmp" # The environment variable & value +TEST_NAME=links_env # The test name +TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary +ENVCMD="env HDF5_EXT_PREFIX=.:tmp_links_env" # The environment variable & value # # Run the test echo "$ENVCMD $RUNSERIAL $TEST_BIN" @@ -36,7 +36,7 @@ exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test for HDF5_EXT_PREFIX PASSED" else - nerrors="`expr $nerrors + 1`" - echo "***Error encountered for HDF5_EXT_PREFIX test***" + nerrors="`expr $nerrors + 1`" + echo "***Error encountered for HDF5_EXT_PREFIX test***" fi exit $nerrors diff --git a/test/testmeta.c b/test/testmeta.c index b97eb68..9a40e6f 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -23,34 +23,34 @@ */ -#include "hdf5.h" +#include "h5test.h" -#define FILEN "testmeta.h5" +#define FILEN "testmeta.h5" -#define CHUNK_SIZE 512 +#define CHUNK_SIZE 512 -#define NDATAARRAYS 3 -/*#define NPOINTS 2048*/ -#define NPOINTS 20 -#define NEXTARRAYS 10 -#define NDATAOBJECTS 100000 +#define NDATAARRAYS 3 +/*#define NPOINTS 2048*/ +#define NPOINTS 20 +#define NEXTARRAYS 10 +#define NDATAOBJECTS 100000 int main(void) { - hid_t file_id, prop_id, memspace_id, type_id; - hid_t group_id; - hid_t dataset_id, dataspace_id; - herr_t status; - hsize_t dims[1]; - hsize_t maxdims[1]; - float data[NPOINTS]; - float floatval; - unsigned numdataobj = 0; - unsigned i, j; - char name[80]; - hsize_t start[1] = {0}; - hsize_t stride[1] = {1}; - hsize_t count[1] = {1}; + hid_t file_id, prop_id, memspace_id, type_id; + hid_t group_id; + hid_t dataset_id, dataspace_id; + herr_t status; + hsize_t dims[1]; + hsize_t maxdims[1]; + float data[NPOINTS]; + float floatval; + unsigned numdataobj = 0; + unsigned i, j; + char name[80]; + hsize_t start[1] = {0}; + hsize_t stride[1] = {1}; + hsize_t count[1] = {1}; /* Create a file */ file_id = H5Fcreate(FILEN, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -64,8 +64,7 @@ int main(void) H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write value to NumDataObj dataset */ - status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, - H5S_ALL, H5P_DEFAULT, &numdataobj); + status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj); /* Close the identifiers */ status = H5Dclose(dataset_id); @@ -78,16 +77,14 @@ int main(void) status = H5Pset_chunk(prop_id, 1, dims); /* Create dataspace */ - dims[0]=1; - maxdims[0]=H5S_UNLIMITED; + dims[0] = 1; + maxdims[0] = H5S_UNLIMITED; dataspace_id = H5Screate_simple(1, dims, maxdims); - for(i=0; i<NEXTARRAYS; i++) - { + for(i = 0; i < NEXTARRAYS; i++) { /* Create dataset */ sprintf(name, "/ExtArray%06d", i); - dataset_id = H5Dcreate2(file_id, name, - H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); + dataset_id = H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); /* Close the identifier */ status = H5Dclose(dataset_id); @@ -101,47 +98,43 @@ int main(void) group_id = H5Gcreate2(file_id, "/DataArray", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group_id); - for(j=0; j<NDATAOBJECTS; j++) - { + for(j = 0; j < NDATAOBJECTS; j++) { /* Removed print statement as it would lock system resources on Windows */ /* - * printf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); + * HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); * fflush(stdout); */ floatval = (float)j; /* Create group to hold data arrays for this object */ - sprintf(name, "/DataArray/%06d", j); + HDsprintf(name, "/DataArray/%06d", j); group_id = H5Gcreate2(file_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(group_id < 0) { - fprintf(stderr, "Failed to create DataArray group.\n"); + HDfprintf(stderr, "Failed to create DataArray group.\n"); status = H5Fclose(file_id); return -1; } /* Loop over data arrays */ - for(i=0; i<NDATAARRAYS; i++) - { + for(i = 0; i < NDATAARRAYS; i++) { /* Create dataspace */ dims[0]=NPOINTS; maxdims[0]=NPOINTS; dataspace_id = H5Screate_simple(1 ,dims, maxdims); /* Create dataset */ - sprintf(name, "DataArray%06d", i); - dataset_id = H5Dcreate2(group_id, name, - H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + HDsprintf(name, "DataArray%06d", i); + dataset_id = H5Dcreate2(group_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dataset_id < 0) { - fprintf(stderr, "Failed to create DataArray dataset.\n"); + HDfprintf(stderr, "Failed to create DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } /* Write the data array data */ - status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL, - H5S_ALL, H5P_DEFAULT, data); + status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if(status < 0) { - fprintf(stderr, "Failed to write DataArray dataset.\n"); + HDfprintf(stderr, "Failed to write DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } @@ -154,17 +147,16 @@ int main(void) /* Open NumDataObj dataset */ dataset_id = H5Dopen2(file_id, "/NumDataObj", H5P_DEFAULT); if(dataset_id < 0) { - fprintf(stderr, "Failed to open NumDataObj dataset.\n"); + HDfprintf(stderr, "Failed to open NumDataObj dataset.\n"); status = H5Fclose(file_id); return -1; } /* Write value to NumDataObj dataset */ numdataobj = j + 1; - status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, - H5S_ALL, H5P_DEFAULT, &numdataobj); + status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj); if(status < 0) { - fprintf(stderr, "Failed to write NumDataObj dataset.\n"); + HDfprintf(stderr, "Failed to write NumDataObj dataset.\n"); status = H5Fclose(file_id); return -1; } @@ -176,10 +168,10 @@ int main(void) /* Extend attribute arrays */ for(i = 0; i < NEXTARRAYS; i++) { /* Open extendable dataset */ - sprintf(name, "/ExtArray%06d", i); + HDsprintf(name, "/ExtArray%06d", i); dataset_id = H5Dopen2(file_id, name, H5P_DEFAULT); if(dataset_id < 0) { - fprintf(stderr, "Failed to open ExtArray dataset.\n"); + HDfprintf(stderr, "Failed to open ExtArray dataset.\n"); status = H5Fclose(file_id); return -1; } /* end if */ @@ -188,7 +180,7 @@ int main(void) dims[0] = (hsize_t)j + 1; status = H5Dset_extent(dataset_id, dims); if(status < 0) { - fprintf(stderr, "Failed to extend DataArray dataset.\n"); + HDfprintf(stderr, "Failed to extend DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } /* end if */ @@ -200,16 +192,12 @@ int main(void) type_id = H5Dget_type(dataset_id); start[0] = 0; - status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, - start, stride, count, NULL); + status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, start, stride, count, NULL); start[0] = (hssize_t)j; - status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, - start, stride, count, NULL); - status = H5Dwrite(dataset_id, type_id, memspace_id, - dataspace_id, H5P_DEFAULT, &floatval); - if(status < 0) - { - fprintf(stderr, "Failed to write DataArray dataset.\n"); + status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, stride, count, NULL); + status = H5Dwrite(dataset_id, type_id, memspace_id, dataspace_id, H5P_DEFAULT, &floatval); + if(status < 0) { + HDfprintf(stderr, "Failed to write DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } @@ -226,7 +214,7 @@ int main(void) /* Close the file */ status = H5Fclose(file_id); - printf("\n"); + HDprintf("\n"); return 0; } diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index f81a7d7..a41947e 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -131,9 +131,10 @@ for FILE in swmr*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE swmr_test + if test -f "$FILE" ; then + cp $FILE swmr_test + fi done -cp swmr* swmr_test # With the --disable-shared option, swmr program files are built in the test # directory, otherwise they are in test/.libs with a corresponding wrapper @@ -145,7 +146,9 @@ if [ -f .libs/swmr ]; then case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE swmr_test/.libs + if test -f "$FILE" ; then + cp $FILE swmr_test/.libs + fi done fi @@ -153,7 +156,7 @@ cd swmr_test # Loop over index types -for index_type in "-i ea" "-i b2" +for index_type in "-i ea" "-i b2" do # Try with and without compression for compress in "" "-c 5" diff --git a/test/testvds_env.sh.in b/test/testvds_env.sh.in index 894e52e..e9a27da 100644 --- a/test/testvds_env.sh.in +++ b/test/testvds_env.sh.in @@ -19,7 +19,7 @@ nerrors=0 ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## @@ -27,7 +27,7 @@ nerrors=0 echo "Testing basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix" TEST_NAME=vds_env # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary -ENVCMD="env HDF5_VDS_PREFIX=\${ORIGIN}/tmp" # Set the environment variable & value +ENVCMD="env HDF5_VDS_PREFIX=\${ORIGIN}/tmp_vds_env" # Set the environment variable & value UNENVCMD="unset HDF5_VDS_PREFIX" # Unset the environment variable & value # # Run the test @@ -37,8 +37,8 @@ exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test prefix for HDF5_VDS_PREFIX PASSED" else - nerrors="`expr $nerrors + 1`" - echo "***Error encountered for HDF5_VDS_PREFIX test***" + nerrors="`expr $nerrors + 1`" + echo "***Error encountered for HDF5_VDS_PREFIX test***" fi $UNENVCMD exit $nerrors diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index 32af072..28abcf5 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -117,7 +117,9 @@ for FILE in vds_swmr*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE vds_swmr_test + if test -f "$FILE" ; then + cp $FILE vds_swmr_test + fi done # With the --disable-shared option, swmr program files are built in the test @@ -126,7 +128,14 @@ done # always be copied, swmr files in .libs should be copied only if they exists. if [ -f .libs/vds_swmr_writer ]; then mkdir vds_swmr_test/.libs - cp .libs/vds_swmr* vds_swmr_test/.libs + for FILE in .libs/vds_swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + if test -f "$FILE" ; then + cp $FILE vds_swmr_test/.libs + fi + done fi cd vds_swmr_test diff --git a/test/tfile.c b/test/tfile.c index 9e17c34..f39da5a 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -966,7 +966,7 @@ test_file_close(void) ****************************************************************/ static void create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, - hid_t *ret_gid2, hid_t *ret_gid3) + hid_t *ret_gid2, hid_t *ret_gid3) { ssize_t oid_count; herr_t ret; @@ -1098,14 +1098,14 @@ test_get_obj_ids(void) /* creates NGROUPS groups under the root group */ for(m = 0; m < NGROUPS; m++) { - sprintf(gname, "group%d", m); + HDsprintf(gname, "group%d", m); gid[m] = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid[m], FAIL, "H5Gcreate2"); } /* create NDSETS datasets under the root group */ for(n = 0; n < NDSETS; n++) { - sprintf(dname, "dataset%d", n); + HDsprintf(dname, "dataset%d", n); dset[n] = H5Dcreate2(fid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset[n], FAIL, "H5Dcreate2"); } @@ -1120,8 +1120,7 @@ test_get_obj_ids(void) /* Call the public function H5F_get_obj_ids to use H5F__get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in - * (oid_list_size). - */ + * (oid_list_size) */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); @@ -1166,7 +1165,7 @@ test_get_obj_ids(void) /* Open NDSETS datasets under the root group */ for(n = 0; n < NDSETS; n++) { - sprintf(dname, "dataset%d", n); + HDsprintf(dname, "dataset%d", n); dset[n] = H5Dopen2(fid, dname, H5P_DEFAULT); CHECK(dset[n], FAIL, "H5Dcreate2"); } @@ -1434,6 +1433,9 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, VERIFY(oid_list[i], did, "H5Fget_obj_ids"); break; + case H5I_MAP: + /* TODO: Not supported in native VOL connector yet */ + case H5I_UNINIT: case H5I_BADID: case H5I_DATATYPE: @@ -4362,7 +4364,7 @@ test_file_freespace(const char *env_h5_drvr) /* Create datasets in file */ for(u = 0; u < 10; u++) { - sprintf(name, "Dataset %u", u); + HDsprintf(name, "Dataset %u", u); dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); CHECK(dset, FAIL, "H5Dcreate2"); @@ -4385,7 +4387,7 @@ test_file_freespace(const char *env_h5_drvr) /* Delete datasets in file */ for(k = 9; k >= 0; k--) { - sprintf(name, "Dataset %u", (unsigned)k); + HDsprintf(name, "Dataset %u", (unsigned)k); ret = H5Ldelete(file, name, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); } /* end for */ @@ -4513,7 +4515,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) /* Create datasets in file */ for(u = 0; u < 10; u++) { - sprintf(name, "Dataset %u", u); + HDsprintf(name, "Dataset %u", u); dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); CHECK(dset, FAIL, "H5Dcreate2"); @@ -4531,7 +4533,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) /* Delete odd-numbered datasets in file */ for(u = 0; u < 10; u++) { - sprintf(name, "Dataset %u", u); + HDsprintf(name, "Dataset %u", u); if(u % 2) { ret = H5Ldelete(file, name, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); @@ -5390,13 +5392,13 @@ test_libver_bounds_open(void) * This test is copied from the user test program: copy10.c. * (See attached programs in the jira issue.) * - * The source file used in the test is generated by the user test - * program "fill18.c" with the 1.8 library. The file is created + * The source file used in the test is generated by the user test + * program "fill18.c" with the 1.8 library. The file is created * with the latest format and the dataset created in the file * has version 3 fill value message (latest). * * The test creates the destination file with (v18, v18) version bounds. - * H5Ocopy() should succeed in copying the dataset in the source file + * H5Ocopy() should succeed in copying the dataset in the source file * to the destination file. * * Return: Success: 0 @@ -5417,7 +5419,7 @@ test_libver_bounds_copy(void) MESSAGE(5, ("Testing H5Ocopy a dataset in a 1.8 library file to a 1.10 library file\n")); /* Get the test file name */ - src_fname = H5_get_srcdir_filename(SRC_FILE); + src_fname = H5_get_srcdir_filename(SRC_FILE); /* Open the source test file */ src_fid = H5Fopen(src_fname, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -5693,7 +5695,7 @@ test_libver_bounds_super(hid_t fapl) ** File creation | succeed | ** |______________________________________________________________________________| ** -** Creating a file with SWMR-write access +** Creating a file with SWMR-write access ** -------------------------------------------------------------------------------- ** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | ** |______________________________________________________________________________| @@ -7406,7 +7408,7 @@ test_incr_filesize(void) /* Create datasets in file */ for(u = 0; u < 10; u++) { - sprintf(name, "Dataset %u", u); + HDsprintf(name, "Dataset %u", u); dset = H5Dcreate2(fid, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); CHECK(dset, FAIL, "H5Dcreate2"); @@ -7436,7 +7438,7 @@ test_incr_filesize(void) /* Get the stored EOA */ ret = H5Fget_eoa(fid, &stored_eoa); CHECK(ret, FAIL, "H5Fget_eoa"); - + /* Verify the stored EOA is the same as filesize */ VERIFY(filesize, stored_eoa, "file size"); @@ -7895,7 +7897,7 @@ test_file(void) } /* test_file() */ - + /*------------------------------------------------------------------------- * Function: cleanup_file * diff --git a/test/tgenprop.c b/test/tgenprop.c index 151913c..7ca7dca 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -678,7 +678,7 @@ test_genprop_basic_list(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); @@ -770,7 +770,7 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); @@ -783,7 +783,7 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Delete permanent property */ @@ -820,7 +820,7 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Close list */ @@ -1225,7 +1225,7 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ @@ -1240,7 +1240,7 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Verify get callback information for properties tracked */ diff --git a/test/th5o.c b/test/th5o.c index 0aa589f..93a12e8 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: th5o +* Test program: th5o * * Test public H5O functions for accessing * @@ -30,7 +30,7 @@ #define TEST6_DIM1 100 #define TEST6_DIM2 100 - + /**************************************************************** ** ** test_h5o_open(): Test H5Oopen function. @@ -140,7 +140,7 @@ test_h5o_open(void) } /* test_h5o_open() */ - + /**************************************************************** ** ** test_h5o_close(): Test H5Oclose function. @@ -230,7 +230,7 @@ test_h5o_close(void) CHECK(ret, FAIL, "H5Fclose"); } - + /**************************************************************** ** ** test_h5o_open_by_addr(): Test H5Oopen_by_addr function. @@ -367,7 +367,7 @@ test_h5o_open_by_addr(void) VERIFY(dtype, FAIL, "H5Oopen_by_addr"); } /* test_h5o_open_by_addr() */ - + /**************************************************************** ** ** test_h5o_refcount(): Test H5O refcounting functions. @@ -378,7 +378,7 @@ test_h5o_refcount(void) { hid_t fid; /* HDF5 File ID */ hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5O_info_t oinfo; /* Object info struct */ + H5O_info_t oinfo; /* Object info struct */ hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ @@ -562,7 +562,7 @@ test_h5o_refcount(void) CHECK(ret, FAIL, "H5Fclose"); } /* test_h5o_refcount() */ - + /**************************************************************** ** ** test_h5o_plist(): Test object creation properties @@ -756,7 +756,7 @@ test_h5o_plist(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_h5o_plist() */ - + /**************************************************************** ** ** test_h5o_link(): Test creating link to object @@ -850,7 +850,7 @@ test_h5o_link(void) /* Verify the data */ for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) VERIFY(wdata[i], rdata[i], "H5Dread"); - + /* Create a group with no name*/ group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(group_id, FAIL, "H5Gcreate_anon"); @@ -910,7 +910,7 @@ test_h5o_link(void) HDfree(rdata); } /* end test_h5o_link() */ - + /**************************************************************** ** ** test_h5o_comment(): Test H5Oset(get)_comment functions. @@ -1083,7 +1083,7 @@ test_h5o_comment(void) } /* test_h5o_comment() */ - + /**************************************************************** ** ** test_h5o_comment_by_name(): Test H5Oset(get)_comment_by_name functions. @@ -1242,7 +1242,7 @@ test_h5o_comment_by_name(void) } /* test_h5o_comment_by_name() */ - + /**************************************************************** ** ** test_h5o_getinfo_same_file(): Test that querying the object info for @@ -1254,7 +1254,7 @@ test_h5o_getinfo_same_file(void) { hid_t fid1, fid2; /* HDF5 File ID */ hid_t gid1, gid2; /* Group IDs */ - H5O_info_t oinfo1, oinfo2; /* Object info structs */ + H5O_info_t oinfo1, oinfo2; /* Object info structs */ herr_t ret; /* Value returned from API calls */ /* Create a new HDF5 file */ @@ -1353,7 +1353,7 @@ test_h5o_getinfo_same_file(void) /**************************************************************** ** ** visit_obj_cb(): -** This is the callback function invoked by H5Ovisit1() in +** This is the callback function invoked by H5Ovisit1() in ** test_h5o_getinfo_visit(): ** --Verify that the object info returned to the callback ** function is the same as H5Oget_info2(). @@ -1382,10 +1382,10 @@ visit_obj_cb(hid_t group_id, const char *name, const H5O_info_t *oinfo1, return(H5_ITER_CONT); } /* end visit_obj_cb() */ - + /**************************************************************** ** -** test_h5o_getinfo_visit(): +** test_h5o_getinfo_visit(): ** Verify that the object info returned via H5Oget_info1() ** and H5Oget_info2() are the same. ** Verify that the object info retrieved via H5Ovisit1() is @@ -1419,7 +1419,7 @@ test_h5o_getinfo_visit(void) /* Attach 10 attributes to "group1" */ for(j = 0; j <10; j++) { /* Create the attribute name */ - sprintf(attrname, "attr%u", j); + HDsprintf(attrname, "attr%u", j); /* Create the attribute */ aid = H5Acreate2(gid1, attrname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -1479,7 +1479,7 @@ test_h5o_getinfo_visit(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /**************************************************************** ** ** test_h5o(): Main H5O (generic object) testing routine. @@ -1491,29 +1491,29 @@ test_h5o(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Objects\n")); - test_h5o_open(); /* Test generic open function */ - test_h5o_open_by_addr(); /* Test opening objects by address */ - test_h5o_close(); /* Test generic close function */ - test_h5o_refcount(); /* Test incrementing and decrementing reference count */ - test_h5o_plist(); /* Test object creation properties */ - test_h5o_link(); /* Test object link routine */ - test_h5o_comment(); /* Test routines for comment */ - test_h5o_comment_by_name(); /* Test routines for comment by name */ + test_h5o_open(); /* Test generic open function */ + test_h5o_open_by_addr(); /* Test opening objects by address */ + test_h5o_close(); /* Test generic close function */ + test_h5o_refcount(); /* Test incrementing and decrementing reference count */ + test_h5o_plist(); /* Test object creation properties */ + test_h5o_link(); /* Test object link routine */ + test_h5o_comment(); /* Test routines for comment */ + test_h5o_comment_by_name(); /* Test routines for comment by name */ test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_h5o_getinfo_visit(); /* Test object info for H5Oget_info1/2 and H5Ovisit1 */ + test_h5o_getinfo_visit(); /* Test object info for H5Oget_info1/2 and H5Ovisit1 */ #endif } /* test_h5o() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_h5o + * Function: cleanup_h5o * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: James Laird + * Programmer: James Laird * June 3, 2006 * *------------------------------------------------------------------------- diff --git a/test/th5s.c b/test/th5s.c index a48979b..1a4456a 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -187,7 +187,7 @@ test_h5s_basic(void) CHECK(ret, FAIL, "H5Sclose"); /* - * Check to be sure we can't create a simple data space that has too many + * Check to be sure we can't create a simple dataspace that has too many * dimensions. */ H5E_BEGIN_TRY { @@ -214,7 +214,7 @@ test_h5s_basic(void) CHECK_I(ret, "H5Fclose"); } else - printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile); + HDprintf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile); } /* Verify that incorrect dimensions don't work */ @@ -318,7 +318,7 @@ test_h5s_basic(void) /**************************************************************** ** -** test_h5s_null(): Test NULL data space +** test_h5s_null(): Test NULL dataspace ** ****************************************************************/ static void @@ -460,7 +460,7 @@ test_h5s_null(void) CHECK(ret, FAIL, "H5Fclose"); /*============================================ - * Reopen the file to check the data space + * Reopen the file to check the dataspace *============================================ */ fid = H5Fopen(NULLFILE, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -683,7 +683,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -705,7 +705,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata_short[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata_short[i][j]); } } @@ -772,7 +772,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -798,7 +798,7 @@ test_h5s_zero_dim(void) for(k=0; k<SPACE1_DIM3; k++) { if(rdata_real[i][j][k] != wdata_real[i][j][k]) { H5_FAILED(); - printf("element [%d][%d][%d] is %d but should have been %d\n", + HDprintf("element [%d][%d][%d] is %d but should have been %d\n", i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]); } } @@ -822,7 +822,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -869,7 +869,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -913,7 +913,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -945,7 +945,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -967,7 +967,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata_short[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata_short[i][j]); } } @@ -1029,7 +1029,7 @@ test_h5s_zero_dim(void) for(k=0; k<SPACE1_DIM3; k++) { if(rdata_real[i][j][k] != wdata_real[i][j][k]) { H5_FAILED(); - printf("element [%d][%d][%d] is %d but should have been %d\n", + HDprintf("element [%d][%d][%d] is %d but should have been %d\n", i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]); } } @@ -1078,7 +1078,7 @@ test_h5s_zero_dim(void) CHECK(ret, FAIL, "H5Fclose"); /*============================================ - * Reopen the file to check the data space + * Reopen the file to check the dataspace *============================================ */ fid1 = H5Fopen(ZEROFILE, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -1116,7 +1116,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata[i][j]); } } @@ -1154,7 +1154,7 @@ test_h5s_zero_dim(void) for(j=0; j<SPACE1_DIM3; j++) { if(rdata_short[i][j] != 7) { H5_FAILED(); - printf("element [%d][%d] is %d but should have been 7\n", + HDprintf("element [%d][%d] is %d but should have been 7\n", i, j, rdata_short[i][j]); } } @@ -1184,24 +1184,24 @@ test_h5s_zero_dim(void) static void test_h5s_encode(H5F_libver_t low, H5F_libver_t high) { - hid_t sid1, sid2, sid3; /* Dataspace ID */ - hid_t decoded_sid1, decoded_sid2, decoded_sid3; - int rank; /* Logical rank of dataspace */ - hid_t fapl = -1; /* File access property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - size_t sbuf_size=0, null_size=0, scalar_size=0; - unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - hsize_t start[] = {0, 0, 0}; - hsize_t stride[] = {2, 5, 3}; - hsize_t count[] = {2, 2, 2}; - hsize_t block[] = {1, 3, 1}; - H5S_sel_type sel_type; - H5S_class_t space_type; - hssize_t nblocks; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t sid1, sid2, sid3; /* Dataspace ID */ + hid_t decoded_sid1, decoded_sid2, decoded_sid3; + int rank; /* Logical rank of dataspace */ + hid_t fapl = -1; /* File access property list ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + size_t sbuf_size=0, null_size=0, scalar_size=0; + unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + hsize_t start[] = {0, 0, 0}; + hsize_t stride[] = {2, 5, 3}; + hsize_t count[] = {2, 2, 2}; + hsize_t block[] = {1, 3, 1}; + H5S_sel_type sel_type; + H5S_class_t space_type; + hssize_t nblocks; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n")); @@ -1227,7 +1227,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* Encode simple data space in a buffer with the fapl setting */ + /* Encode simple dataspace in a buffer with the fapl setting */ ret = H5Sencode2(sid1, NULL, &sbuf_size, fapl); CHECK(ret, FAIL, "H5Sencode2"); @@ -1242,7 +1242,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) } H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Sdecode"); - /* Encode the simple data space in a buffer with the fapl setting */ + /* Encode the simple dataspace in a buffer with the fapl setting */ ret = H5Sencode2(sid1, sbuf, &sbuf_size, fapl); CHECK(ret, FAIL, "H5Sencode"); @@ -1289,7 +1289,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) sid2 = H5Screate(H5S_NULL); CHECK(sid2, FAIL, "H5Screate"); - /* Encode null data space in a buffer */ + /* Encode null dataspace in a buffer */ ret = H5Sencode2(sid2, NULL, &null_size, fapl); CHECK(ret, FAIL, "H5Sencode"); @@ -1298,7 +1298,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(null_sbuf, NULL, "HDcalloc"); } - /* Encode the null data space in the buffer */ + /* Encode the null dataspace in the buffer */ ret = H5Sencode2(sid2, null_sbuf, &null_size, fapl); CHECK(ret, FAIL, "H5Sencode2"); @@ -1325,7 +1325,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) sid3 = H5Screate(H5S_SCALAR); CHECK(sid3, FAIL, "H5Screate_simple"); - /* Encode scalar data space in a buffer */ + /* Encode scalar dataspace in a buffer */ ret = H5Sencode2(sid3, NULL, &scalar_size, fapl); CHECK(ret, FAIL, "H5Sencode"); @@ -1334,7 +1334,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(scalar_buf, NULL, "HDcalloc"); } - /* Encode the scalar data space in the buffer */ + /* Encode the scalar dataspace in the buffer */ ret = H5Sencode2(sid3, scalar_buf, &scalar_size, fapl); CHECK(ret, FAIL, "H5Sencode2"); @@ -1419,7 +1419,7 @@ test_h5s_encode1(void) ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* Encode simple data space in a buffer with the fapl setting */ + /* Encode simple dataspace in a buffer with the fapl setting */ ret = H5Sencode1(sid1, NULL, &sbuf_size); CHECK(ret, FAIL, "H5Sencode2"); @@ -1434,7 +1434,7 @@ test_h5s_encode1(void) } H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Sdecode"); - /* Encode the simple data space in a buffer */ + /* Encode the simple dataspace in a buffer */ ret = H5Sencode1(sid1, sbuf, &sbuf_size); CHECK(ret, FAIL, "H5Sencode"); @@ -1481,7 +1481,7 @@ test_h5s_encode1(void) sid2 = H5Screate(H5S_NULL); CHECK(sid2, FAIL, "H5Screate"); - /* Encode null data space in a buffer */ + /* Encode null dataspace in a buffer */ ret = H5Sencode1(sid2, NULL, &null_size); CHECK(ret, FAIL, "H5Sencode"); @@ -1490,7 +1490,7 @@ test_h5s_encode1(void) CHECK(null_sbuf, NULL, "HDcalloc"); } - /* Encode the null data space in the buffer */ + /* Encode the null dataspace in the buffer */ ret = H5Sencode1(sid2, null_sbuf, &null_size); CHECK(ret, FAIL, "H5Sencode2"); @@ -1515,9 +1515,9 @@ test_h5s_encode1(void) */ /* Create scalar dataspace */ sid3 = H5Screate(H5S_SCALAR); - CHECK(sid3, FAIL, "H5Screate_simple"); + CHECK(sid3, FAIL, "H5Screate"); - /* Encode scalar data space in a buffer */ + /* Encode scalar dataspace in a buffer */ ret = H5Sencode1(sid3, NULL, &scalar_size); CHECK(ret, FAIL, "H5Sencode"); @@ -1526,7 +1526,7 @@ test_h5s_encode1(void) CHECK(scalar_buf, NULL, "HDcalloc"); } - /* Encode the scalar data space in the buffer */ + /* Encode the scalar dataspace in the buffer */ ret = H5Sencode1(sid3, scalar_buf, &scalar_size); CHECK(ret, FAIL, "H5Sencode2"); @@ -1622,8 +1622,8 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, VERIFY(H5Sget_select_npoints(in_sid), H5Sget_select_npoints(d_sid), "Compare npoints"); /* Verify if the two dataspace selections (in_sid, d_sid) are the same shape */ - check = H5S__select_shape_same_test(in_sid, d_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(in_sid, d_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare the starting/ending coordinates of the bounding box for in_sid and d_sid */ ret = H5Sget_select_bounds(in_sid, in_low_bounds, in_high_bounds); @@ -2127,7 +2127,7 @@ test_h5s_encode_length(void) ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* Encode simple data space in a buffer */ + /* Encode simple dataspace in a buffer */ ret = H5Sencode2(sid, NULL, &sbuf_size, H5P_DEFAULT); CHECK(ret, FAIL, "H5Sencode"); @@ -2437,9 +2437,9 @@ test_h5s_compound_scalar_read(void) ret = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata); CHECK(ret, FAIL, "H5Dread"); if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) { - printf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c1); - printf("scalar data different: space4_data.u=%u, read_data4.u=%u\n",space4_data.u,rdata.u); - printf("scalar data different: space4_data.f=%f, read_data4.f=%f\n",(double)space4_data.f,(double)rdata.f); + HDprintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c1); + HDprintf("scalar data different: space4_data.u=%u, read_data4.u=%u\n",space4_data.u,rdata.u); + HDprintf("scalar data different: space4_data.f=%f, read_data4.f=%f\n",(double)space4_data.f,(double)rdata.f); TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c2); } /* end if */ @@ -2493,7 +2493,7 @@ test_h5s_chunk(void) status = H5Pset_chunk(plist_id, 2, csize); CHECK(status, FAIL, "H5Pset_chunk"); - /* Create the data space */ + /* Create the dataspace */ dims[0] = 50000; dims[1] = 3; space_id = H5Screate_simple(2, dims, NULL); diff --git a/test/titerate.c b/test/titerate.c index 716654d..289a46c 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -379,7 +379,7 @@ aiter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5A_info_t H5_ATTR_ return(count2 > 10 ? 1 : 0); default: - printf("invalid iteration command"); + HDprintf("invalid iteration command"); return(-1); } /* end switch */ } /* end aiter_cb() */ @@ -416,7 +416,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) CHECK(dataset, FAIL, "H5Dcreate2"); for(i = 0; i < NATTR; i++) { - sprintf(name, "Attribute %02d", i); + HDsprintf(name, "Attribute %02d", i); attribute = H5Acreate2(dataset, name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT); CHECK(attribute, FAIL, "H5Acreate2"); @@ -621,7 +621,7 @@ test_iter_group_large(hid_t fapl) /* Create a bunch of groups */ for(i = 0; i < ITER_NGROUPS; i++) { - sprintf(gname, "Group_%d", i); + HDsprintf(gname, "Group_%d", i); /* Add the name to the list of objects in the root group */ HDstrcpy(names[i].name, gname); @@ -946,7 +946,7 @@ find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_ if (searched_err == NULL) return H5_ITER_ERROR; - + /* If the searched error message is found, stop the iteration */ if (err_desc->desc != NULL && strcmp(err_desc->desc, searched_err->message) == 0) { diff --git a/test/tmisc.c b/test/tmisc.c index fef94dd..5225333 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -981,13 +981,13 @@ test_misc5(void) /* Verify the correct information was read in */ for(i=0; i<(buf.len); i++) { - /* printf("[%d]=%d\n",i, ((misc5_struct1 *)(buf.p))[i].st1_el1); */ + /* HDprintf("[%d]=%d\n",i, ((misc5_struct1 *)(buf.p))[i].st1_el1); */ VERIFY(((misc5_struct1 *)(buf.p))[i].st1_el1,MISC5_DBGELVAL1,"H5Dread"); for(j=0; j<(((misc5_struct1 *)(buf.p)) [i].st1_el2.len); j++) { - /* printf(" [%d]=%d\n",j, ((misc5_struct2 *)(((misc5_struct1 *) (buf.p))[i].st1_el2.p))[j].st2_el1); */ + /* HDprintf(" [%d]=%d\n",j, ((misc5_struct2 *)(((misc5_struct1 *) (buf.p))[i].st1_el2.p))[j].st2_el1); */ VERIFY(((misc5_struct2 *)(((misc5_struct1 *) (buf.p))[i].st1_el2.p))[j].st2_el1, MISC5_DBGELVAL2,"H5Dread"); for(k=0; k<(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.len); k++) { - /* printf(" [%d]=%d\n",k, ((misc5_struct3 *)(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.p))[k].st3_el1); */ + /* HDprintf(" [%d]=%d\n",k, ((misc5_struct3 *)(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.p))[k].st3_el1); */ VERIFY(((misc5_struct3 *)(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.p))[k].st3_el1, MISC5_DBGELVAL3,"H5Dread"); } /* end for */ } @@ -1064,7 +1064,7 @@ test_misc6(void) /* Loop through adding attributes to each dataset */ for(u = 0; u < MISC6_NUMATTR; u++) { /* Create name for attribute */ - sprintf(attr_name, "Attr#%u", u); + HDsprintf(attr_name, "Attr#%u", u); /* Open the file */ loc_id = H5Fopen(MISC6_FILE, H5F_ACC_RDWR, H5P_DEFAULT); @@ -2953,7 +2953,7 @@ test_misc18(void) /* Loop creating attributes on each dataset, flushing them to the file each time */ for(u = 0; u < 10; u++) { /* Set up attribute name */ - sprintf(attr_name, "Attr %u", u); + HDsprintf(attr_name, "Attr %u", u); /* Create & close attribute on first dataset */ aid = H5Acreate2(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT); @@ -4761,7 +4761,7 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25a() */ - + /**************************************************************** ** ** test_misc25b(): Exercise null object header message merge bug @@ -4797,7 +4797,7 @@ test_misc25b(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25b() */ - + /**************************************************************** ** ** test_misc25c(): Exercise another null object header message merge bug. @@ -4931,7 +4931,7 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25c() */ - + /**************************************************************** ** ** test_misc26(): Regression test: ensure that copying filter @@ -5017,7 +5017,7 @@ test_misc26(void) CHECK_I(ret, "H5Pclose"); } - + /**************************************************************** ** ** test_misc27(): Ensure that objects with incorrect # of object @@ -5062,7 +5062,7 @@ test_misc27(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc27() */ - + /**************************************************************** ** ** test_misc28(): Ensure that the dataset chunk cache will hold @@ -5239,7 +5239,7 @@ test_misc28(void) CHECK_I(ret, "H5Pclose"); } /* end test_misc28() */ - + /**************************************************************** ** ** test_misc29(): Ensure that speculative metadata reads don't @@ -5288,7 +5288,7 @@ test_misc30_get_info(hid_t loc_id) return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL); } - + /**************************************************************** ** ** test_misc30(): Exercise local heap code that loads prefix @@ -5332,7 +5332,7 @@ test_misc30(void) CHECK(ret, FAIL, "test_misc30_get_info"); } - sprintf(gname, "/g0/group%d", i); + HDsprintf(gname, "/g0/group%d", i); gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid, FAIL, "H5Gcreate2"); @@ -5353,7 +5353,7 @@ test_misc30(void) VERIFY(file_size[0], file_size[1], "test_misc30"); } /* end test_misc30() */ - + /**************************************************************** ** ** test_misc31(): Test reentering library through deprecated @@ -5451,7 +5451,7 @@ test_misc31(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end test_misc31() */ - + /**************************************************************** * * test_misc32(): Simple test of filter memory allocation @@ -5625,7 +5625,7 @@ test_misc34(void) } /* end test_misc34() */ - + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5678,7 +5678,7 @@ test_misc(void) } /* test_misc() */ - + /*------------------------------------------------------------------------- * Function: cleanup_misc * diff --git a/test/trefer.c b/test/trefer.c index 9af5c89..7158984 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -21,7 +21,7 @@ #include "testhdf5.h" -#define FILE1 "trefer1.h5" +#define FILE1 "trefer1.h5" #define FILE2 "trefer2.h5" #define FILE3 "trefer3.h5" @@ -941,7 +941,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Object type */ int i; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); diff --git a/test/tselect.c b/test/tselect.c index bbab868..9cfa922 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -13,50 +13,50 @@ /*********************************************************** * -* Test program: tselect +* Test program: tselect * * Test the Dataspace selection functionality * *************************************************************/ -#define H5S_FRIEND /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5S_TESTING #include "testhdf5.h" #include "hdf5.h" -#include "H5Spkg.h" /* Dataspaces */ +#include "H5Spkg.h" /* Dataspaces */ #define FILENAME "tselect.h5" /* 3-D dataset with fixed dimensions */ #define SPACE1_NAME "Space1" -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* 2-D dataset with fixed dimensions */ #define SPACE2_NAME "Space2" -#define SPACE2_RANK 2 -#define SPACE2_DIM1 30 -#define SPACE2_DIM2 26 -#define SPACE2A_RANK 1 -#define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2) +#define SPACE2_RANK 2 +#define SPACE2_DIM1 30 +#define SPACE2_DIM2 26 +#define SPACE2A_RANK 1 +#define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2) /* 2-D dataset with fixed dimensions */ #define SPACE3_NAME "Space3" -#define SPACE3_RANK 2 -#define SPACE3_DIM1 15 -#define SPACE3_DIM2 26 +#define SPACE3_RANK 2 +#define SPACE3_DIM1 15 +#define SPACE3_DIM2 26 /* 3-D dataset with fixed dimensions */ #define SPACE4_NAME "Space4" -#define SPACE4_RANK 3 -#define SPACE4_DIM1 11 -#define SPACE4_DIM2 13 -#define SPACE4_DIM3 17 +#define SPACE4_RANK 3 +#define SPACE4_DIM1 11 +#define SPACE4_DIM2 13 +#define SPACE4_DIM3 17 /* Number of random hyperslabs to test */ #define NHYPERSLABS 10 @@ -66,22 +66,22 @@ /* 5-D dataset with fixed dimensions */ #define SPACE5_NAME "Space5" -#define SPACE5_RANK 5 -#define SPACE5_DIM1 10 -#define SPACE5_DIM2 10 -#define SPACE5_DIM3 10 -#define SPACE5_DIM4 10 -#define SPACE5_DIM5 10 +#define SPACE5_RANK 5 +#define SPACE5_DIM1 10 +#define SPACE5_DIM2 10 +#define SPACE5_DIM3 10 +#define SPACE5_DIM4 10 +#define SPACE5_DIM5 10 /* 1-D dataset with same size as 5-D dataset */ -#define SPACE6_RANK 1 -#define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5) +#define SPACE6_RANK 1 +#define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5) /* 2-D dataset with easy dimension sizes */ #define SPACE7_NAME "Space7" -#define SPACE7_RANK 2 -#define SPACE7_DIM1 10 -#define SPACE7_DIM2 10 +#define SPACE7_RANK 2 +#define SPACE7_DIM1 10 +#define SPACE7_DIM2 10 #define SPACE7_FILL 254 #define SPACE7_CHUNK_DIM1 5 #define SPACE7_CHUNK_DIM2 5 @@ -89,16 +89,16 @@ /* 4-D dataset with fixed dimensions */ #define SPACE8_NAME "Space8" -#define SPACE8_RANK 4 -#define SPACE8_DIM1 11 -#define SPACE8_DIM2 13 -#define SPACE8_DIM3 17 -#define SPACE8_DIM4 19 +#define SPACE8_RANK 4 +#define SPACE8_DIM1 11 +#define SPACE8_DIM2 13 +#define SPACE8_DIM3 17 +#define SPACE8_DIM4 19 /* Another 2-D dataset with easy dimension sizes */ -#define SPACE9_RANK 2 -#define SPACE9_DIM1 12 -#define SPACE9_DIM2 12 +#define SPACE9_RANK 2 +#define SPACE9_DIM1 12 +#define SPACE9_DIM2 12 /* Element selection information */ #define POINT1_NPOINTS 10 @@ -125,13 +125,13 @@ #define SPACE10_CHUNK_SIZE 12 /* Information for bounds checking test */ -#define SPACE11_RANK 2 +#define SPACE11_RANK 2 #define SPACE11_DIM1 100 #define SPACE11_DIM2 100 #define SPACE11_NPOINTS 4 /* Information for offsets w/chunks test #2 */ -#define SPACE12_RANK 1 +#define SPACE12_RANK 1 #define SPACE12_DIM0 25 #define SPACE12_CHUNK_DIM0 5 @@ -164,10 +164,10 @@ #define SPACEUD3_DIM2 13 /* #defines for shape same / different rank tests */ -#define SS_DR_MAX_RANK 5 +#define SS_DR_MAX_RANK 5 /* Information for regular hyperslab query test */ -#define SPACE13_RANK 3 +#define SPACE13_RANK 3 #define SPACE13_DIM1 50 #define SPACE13_DIM2 50 #define SPACE13_DIM3 50 @@ -215,21 +215,21 @@ test_select_hyper_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_A static void test_select_hyper(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -380,7 +380,7 @@ test_select_hyper(hid_t xfer_plist) } /* test_select_hyper() */ struct pnt_iter { - hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */ uint8_t *buf; /* Buffer the points are in */ int offset; /* Which point we are looking at */ }; @@ -417,24 +417,24 @@ test_select_point_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_A static void test_select_point(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ - hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ struct pnt_iter pi; /* Custom Pointer iterator struct */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Element Selection Functions\n")); @@ -703,15 +703,15 @@ test_select_none_iter1(void H5_ATTR_UNUSED *_elem, hid_t H5_ATTR_UNUSED type_id, static void test_select_all(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j,k; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -784,21 +784,21 @@ test_select_all(hid_t xfer_plist) static void test_select_all_hyper(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -869,7 +869,7 @@ test_select_all_hyper(hid_t xfer_plist) /* Select no extent for disk dataset */ ret = H5Sselect_none(sid1); - CHECK(ret, FAIL, "H5Sselect_all"); + CHECK(ret, FAIL, "H5Sselect_none"); /* Read selection from disk (should fail with no selection defined) */ ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,rbuf); @@ -890,7 +890,7 @@ test_select_all_hyper(hid_t xfer_plist) /* A quick check to make certain that iterating through a "none" selection works */ ret = H5Sselect_none(sid2); - CHECK(ret, FAIL, "H5Sselect_all"); + CHECK(ret, FAIL, "H5Sselect_none"); ret = H5Diterate(rbuf,H5T_NATIVE_UCHAR,sid2,test_select_none_iter1,&tbuf); CHECK(ret, FAIL, "H5Diterate"); @@ -925,23 +925,23 @@ test_select_all_hyper(hid_t xfer_plist) static void test_select_combo(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Combination of Hyperslab & Element Selection Functions\n")); @@ -1069,16 +1069,16 @@ compare_size_t(const void *s1, const void *s2) static void test_select_hyper_stride(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ @@ -1108,7 +1108,7 @@ test_select_hyper_stride(hid_t xfer_plist) 220,221,222,246,247,248, /* Block #12 */ }; int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); @@ -1188,8 +1188,8 @@ test_select_hyper_stride(hid_t xfer_plist) tbuf=wbuf+loc1[i]; tbuf2=rbuf+loc2[i]; if(*tbuf!=*tbuf2) { - printf("%d: hyperslab values don't match!, loc1[%d]=%d, loc2[%d]=%d\n",__LINE__,i,(int)loc1[i],i,(int)loc2[i]); - printf("wbuf=%p, tbuf=%p, rbuf=%p, tbuf2=%p\n",(void *)wbuf,(void *)tbuf,(void *)rbuf,(void *)tbuf2); + HDprintf("%d: hyperslab values don't match!, loc1[%d]=%d, loc2[%d]=%d\n",__LINE__,i,(int)loc1[i],i,(int)loc2[i]); + HDprintf("wbuf=%p, tbuf=%p, rbuf=%p, tbuf2=%p\n",(void *)wbuf,(void *)tbuf,(void *)rbuf,(void *)tbuf2); TestErrPrintf("*tbuf=%u, *tbuf2=%u\n",(unsigned)*tbuf,(unsigned)*tbuf2); } /* end if */ } /* end for */ @@ -1224,19 +1224,19 @@ test_select_hyper_stride(hid_t xfer_plist) static void test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Contiguous Hyperslabs Functionality\n")); @@ -1350,17 +1350,17 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; - hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; + hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j,k,l; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing More Contiguous Hyperslabs Functionality\n")); @@ -1471,17 +1471,17 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; - hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; + hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ uint16_t *wbuf, /* Buffer to write to disk */ *rbuf, /* Buffer read from disk */ *tbuf, *tbuf2; /* Temporary buffer pointers */ unsigned i,j,k,l; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Yet More Contiguous Hyperslabs Functionality\n")); @@ -1565,13 +1565,13 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) (k>=start[2] && k<(start[2]+count[2])) && (l>=start[3] && l<(start[3]+count[3])) ) { if(*tbuf!=*tbuf2) { - printf("Error: hyperslab values don't match!\n"); + HDprintf("Error: hyperslab values don't match!\n"); TestErrPrintf("Line: %d, i=%u, j=%u, k=%u, l=%u, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2); } /* end if */ } /* end if */ else { if(*tbuf2!=0) { - printf("Error: invalid data in read buffer!\n"); + HDprintf("Error: invalid data in read buffer!\n"); TestErrPrintf("Line: %d, i=%u, j=%u, k=%u, l=%u, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2); } /* end if */ } /* end else */ @@ -1597,7 +1597,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) HDfree(rbuf); } /* test_select_hyper_contig3() */ - + /**************************************************************** ** ** verify_select_hyper_contig_dr__run_test(): Verify data from @@ -1609,10 +1609,10 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t cube_size, unsigned edge_size, unsigned cube_rank) { const uint16_t *cube_ptr; /* Pointer into the cube buffer */ - uint16_t expected_value; /* Expected value in dataset */ + uint16_t expected_value; /* Expected value in dataset */ unsigned i, j, k, l, m; /* Local index variables */ size_t s; /* Local index variable */ - hbool_t mis_match; /* Flag to indicate mis-match in expected value */ + hbool_t mis_match; /* Flag to indicate mis-match in expected value */ HDassert(cube_buf); HDassert(cube_size > 0); @@ -1656,14 +1656,14 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, TestErrPrintf("Initial cube data don't match! Line = %d\n", __LINE__); } /* verify_select_hyper_contig_dr__run_test() */ - + /**************************************************************** ** ** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace) -** selection code with contiguous source and target having -** different ranks but the same shape. We have already -** tested H5S_shape_same in isolation, so now we try to do -** I/O. +** selection code with contiguous source and target having +** different ranks but the same shape. We have already +** tested H5Sselect_shape_same in isolation, so now we try to do +** I/O. ** ****************************************************************/ static void @@ -1671,37 +1671,37 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, const uint16_t *zero_buf, unsigned edge_size, unsigned chunk_edge_size, unsigned small_rank, unsigned large_rank, hid_t dset_type, hid_t xfer_plist) { - hbool_t mis_match; /* Flag indicating a value read in wasn't what was expected */ + hbool_t mis_match; /* Flag indicating a value read in wasn't what was expected */ hid_t fapl; /* File access property list */ - hid_t fid1; /* File ID */ - hid_t small_cube_sid; /* Dataspace ID for small cube in memory & file */ - hid_t mem_large_cube_sid; /* Dataspace ID for large cube in memory */ - hid_t file_large_cube_sid; /* Dataspace ID for large cube in file */ - hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ - hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ - hid_t small_cube_dataset; /* Dataset ID */ - hid_t large_cube_dataset; /* Dataset ID */ + hid_t fid1; /* File ID */ + hid_t small_cube_sid; /* Dataspace ID for small cube in memory & file */ + hid_t mem_large_cube_sid; /* Dataspace ID for large cube in memory */ + hid_t file_large_cube_sid; /* Dataspace ID for large cube in file */ + hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ + hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ + hid_t small_cube_dataset; /* Dataset ID */ + hid_t large_cube_dataset; /* Dataset ID */ size_t start_index; /* Offset within buffer to begin inspecting */ size_t stop_index; /* Offset within buffer to end inspecting */ - uint16_t expected_value; /* Expected value in dataset */ - uint16_t * small_cube_buf_1; /* Buffer for small cube data */ - uint16_t * large_cube_buf_1; /* Buffer for large cube data */ - uint16_t * ptr_1; /* Temporary pointer into cube data */ - hsize_t dims[SS_DR_MAX_RANK]; /* Dataspace dimensions */ - hsize_t start[SS_DR_MAX_RANK]; /* Shared hyperslab start offset */ - hsize_t stride[SS_DR_MAX_RANK]; /* Shared hyperslab stride */ - hsize_t count[SS_DR_MAX_RANK]; /* Shared hyperslab count */ - hsize_t block[SS_DR_MAX_RANK]; /* Shared hyperslab block size */ - hsize_t * start_ptr; /* Actual hyperslab start offset */ - hsize_t * stride_ptr; /* Actual hyperslab stride */ - hsize_t * count_ptr; /* Actual hyperslab count */ - hsize_t * block_ptr; /* Actual hyperslab block size */ + uint16_t expected_value; /* Expected value in dataset */ + uint16_t * small_cube_buf_1; /* Buffer for small cube data */ + uint16_t * large_cube_buf_1; /* Buffer for large cube data */ + uint16_t * ptr_1; /* Temporary pointer into cube data */ + hsize_t dims[SS_DR_MAX_RANK]; /* Dataspace dimensions */ + hsize_t start[SS_DR_MAX_RANK]; /* Shared hyperslab start offset */ + hsize_t stride[SS_DR_MAX_RANK]; /* Shared hyperslab stride */ + hsize_t count[SS_DR_MAX_RANK]; /* Shared hyperslab count */ + hsize_t block[SS_DR_MAX_RANK]; /* Shared hyperslab block size */ + hsize_t * start_ptr; /* Actual hyperslab start offset */ + hsize_t * stride_ptr; /* Actual hyperslab stride */ + hsize_t * count_ptr; /* Actual hyperslab count */ + hsize_t * block_ptr; /* Actual hyperslab block size */ size_t small_cube_size; /* Number of elements in small cube */ size_t large_cube_size; /* Number of elements in large cube */ unsigned u, v, w, x; /* Local index variables */ size_t s; /* Local index variable */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ MESSAGE(7, ("\tn-cube slice through m-cube I/O test %d.\n", test_num)); MESSAGE(7, ("\tranks = %u/%u, edge_size = %u, chunk_edge_size = %u.\n", small_rank, large_rank, edge_size, chunk_edge_size)); @@ -1770,10 +1770,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, * datasets. */ if(chunk_edge_size > 0) { - hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */ + hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */ chunk_dims[0] = chunk_dims[1] = - chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; + chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); CHECK(small_cube_dcpl_id, FAIL, "H5Pcreate"); @@ -1846,11 +1846,11 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* first, verify that we can read from disk correctly using selections - * of different rank that H5S_select_shape_same() views as being of the + * of different rank that H5Sselect_shape_same() views as being of the * same shape. * * Start by reading small_rank-D slice from the on disk large cube, and - * verifying that the data read is correct. Verify that H5S_select_shape_same() + * verifying that the data read is correct. Verify that H5Sselect_shape_same() * returns true on the memory and file selections. */ @@ -1894,12 +1894,11 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S__select_shape_same_test(small_cube_sid, - file_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, file_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Read selection from disk */ ret = H5Dread(large_cube_dataset, @@ -1971,12 +1970,11 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S__select_shape_same_test(small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Read selection from disk */ @@ -2038,12 +2036,12 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* now we go in the opposite direction, verifying that we can write * from memory to file using selections of different rank that - * H5S_select_shape_same() views as being of the same shape. + * H5Sselect_shape_same() views as being of the same shape. * * Start by writing small_rank D slices from the in memory large cube, to * the the on disk small cube dataset. After each write, read the small * cube dataset back from disk, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on the + * data. Verify that H5Sselect_shape_same() returns true on the * memory and file selections. */ @@ -2087,16 +2085,15 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the in + /* verify that H5Sselect_shape_same() reports the in * memory slice through the cube selection and the * on disk full small cube selections as having the same shape. */ - check = H5S__select_shape_same_test(small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - /* write the slice from the in memory large cube to the on disk small cube */ + /* write the slice from the in memory large cube to the on disk small cube */ ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, @@ -2145,7 +2142,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* Now write the contents of the in memory small cube to slices of * the on disk cube. After each write, read the on disk cube * into memeory, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on + * data. Verify that H5Sselect_shape_same() returns true on * the memory and file selections. */ @@ -2197,17 +2194,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the in + /* verify that H5Sselect_shape_same() reports the in * memory full selection of the small cube and the * on disk slice through the large cube selection * as having the same shape. */ - check = H5S__select_shape_same_test(small_cube_sid, - file_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, file_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - /* write the cube from memory to the target slice of the disk cube */ + /* write the cube from memory to the target slice of the disk cube */ ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, @@ -2303,14 +2299,14 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } /* test_select_hyper_contig_dr__run_test() */ - + /**************************************************************** ** ** test_select_hyper_contig_dr(): Test H5S (dataspace) -** selection code with contiguous source and target having -** different ranks but the same shape. We have already -** tested H5S_shape_same in isolation, so now we try to do -** I/O. +** selection code with contiguous source and target having +** different ranks but the same shape. We have already +** tested H5Sselect_shape_same in isolation, so now we try to do +** I/O. ** ****************************************************************/ static void @@ -2371,25 +2367,25 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) } /* test_select_hyper_contig_dr() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr__select_checker_board(): -** Given an n-cube data space with each edge of length -** edge_size, and a checker_edge_size either select a checker -** board selection of the entire cube(if sel_rank == n), -** or select a checker board selection of a -** sel_rank dimensional slice through n-cube parallel to the +** Given an n-cube dataspace with each edge of length +** edge_size, and a checker_edge_size either select a checker +** board selection of the entire cube(if sel_rank == n), +** or select a checker board selection of a +** sel_rank dimensional slice through n-cube parallel to the ** sel_rank fastest changing indices, with origin (in the -** higher indices) as indicated by the start array. +** higher indices) as indicated by the start array. ** -** Note that this function, like all its relatives, is -** hard coded to presume a maximum n-cube rank of 5. -** While this maximum is declared as a constant, increasing -** it will require extensive coding in addition to changing +** Note that this function, like all its relatives, is +** hard coded to presume a maximum n-cube rank of 5. +** While this maximum is declared as a constant, increasing +** it will require extensive coding in addition to changing ** the value of the constant. ** -** JRM -- 9/9/09 +** JRM -- 9/9/09 ** ****************************************************************/ static void @@ -2397,18 +2393,18 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, unsigned tgt_n_cube_rank, unsigned edge_size, unsigned checker_edge_size, unsigned sel_rank, hsize_t sel_start[]) { - hbool_t first_selection = TRUE; - unsigned n_cube_offset; - unsigned sel_offset; - hsize_t base_count; + hbool_t first_selection = TRUE; + unsigned n_cube_offset; + unsigned sel_offset; + hsize_t base_count; hsize_t offset_count; - hsize_t start[SS_DR_MAX_RANK]; /* Offset of hyperslab selection */ - hsize_t stride[SS_DR_MAX_RANK]; /* Stride of hyperslab selection */ - hsize_t count[SS_DR_MAX_RANK]; /* Count of hyperslab selection */ - hsize_t block[SS_DR_MAX_RANK]; /* Block size of hyperslab selection */ + hsize_t start[SS_DR_MAX_RANK]; /* Offset of hyperslab selection */ + hsize_t stride[SS_DR_MAX_RANK]; /* Stride of hyperslab selection */ + hsize_t count[SS_DR_MAX_RANK]; /* Count of hyperslab selection */ + hsize_t block[SS_DR_MAX_RANK]; /* Block size of hyperslab selection */ unsigned i, j, k, l, m; /* Local index variable */ unsigned u; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ HDassert(edge_size >= 6); HDassert(0 < checker_edge_size); @@ -2567,8 +2563,8 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, /* Wierdness alert: * * Some how, it seems that selections can extend beyond the - * boundaries of the target data space -- hence the following - * code to manually clip the selection back to the data space + * boundaries of the target dataspace -- hence the following + * code to manually clip the selection back to the dataspace * proper. */ for(u = 0; u < SS_DR_MAX_RANK; u++) { @@ -2582,47 +2578,47 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* test_select_hyper_checker_board_dr__select_checker_board() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** -** The supplied buffer is presumed to contain the results -** of read or writing a checkerboard selection of an -** n-cube, or a checkerboard selection of an m (1 <= m < n) -** dimensional slice through an n-cube parallel to the +** The supplied buffer is presumed to contain the results +** of read or writing a checkerboard selection of an +** n-cube, or a checkerboard selection of an m (1 <= m < n) +** dimensional slice through an n-cube parallel to the ** fastest changing indices. ** -** It is further presumed that the buffer was zeroed before -** the read, and that the n-cube was initialize with the +** It is further presumed that the buffer was zeroed before +** the read, and that the n-cube was initialize with the ** natural numbers listed in order from the origin along ** the fastest changing axis. ** ** Thus for a 10x10x10 3-cube, the value stored in location -** (x, y, z) (assuming that z is the fastest changing index -** and x the slowest) is assumed to be: +** (x, y, z) (assuming that z is the fastest changing index +** and x the slowest) is assumed to be: ** -** (10 * 10 * x) + (10 * y) + z +** (10 * 10 * x) + (10 * y) + z ** -** Thus, if the buffer contains the result of reading a -** checker board selection of a 10x10x10 3-cube, location -** (x, y, z) will contain zero if it is not in a checker, -** and 100x + 10y + z if (x, y, z) is in a checker. +** Thus, if the buffer contains the result of reading a +** checker board selection of a 10x10x10 3-cube, location +** (x, y, z) will contain zero if it is not in a checker, +** and 100x + 10y + z if (x, y, z) is in a checker. ** -** If the buffer contains the result of reading a 3 -** dimensional slice (parallel to the three fastest changing -** indices) through an n cube (n > 3), then the expected -** values in the buffer will be the same, save that we will -** add a constant determined by the origin of the 3-cube -** in the n-cube. +** If the buffer contains the result of reading a 3 +** dimensional slice (parallel to the three fastest changing +** indices) through an n cube (n > 3), then the expected +** values in the buffer will be the same, save that we will +** add a constant determined by the origin of the 3-cube +** in the n-cube. ** -** Finally, the function presumes that the first element -** of the buffer resides either at the origin of either -** a selected or an unselected checker. +** Finally, the function presumes that the first element +** of the buffer resides either at the origin of either +** a selected or an unselected checker. ** ****************************************************************/ H5_ATTR_PURE static hbool_t @@ -2726,14 +2722,14 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, return(good_data); } /* test_select_hyper_checker_board_dr__verify_data() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr__run_test(): Test H5S ** (dataspace) selection code with checker board source and -** target selections having different ranks but the same -** shape. We have already tested H5S_shape_same in -** isolation, so now we try to do I/O. +** target selections having different ranks but the same +** shape. We have already tested H5Sselect_shape_same in +** isolation, so now we try to do I/O. ** ****************************************************************/ static void @@ -2742,36 +2738,36 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ unsigned chunk_edge_size, unsigned small_rank, unsigned large_rank, hid_t dset_type, hid_t xfer_plist) { - hbool_t data_ok; + hbool_t data_ok; hid_t fapl; /* File access property list */ - hid_t fid; /* HDF5 File IDs */ - hid_t full_small_cube_sid; /* Dataspace for small cube w/all selection */ - hid_t mem_small_cube_sid; - hid_t file_small_cube_sid; - hid_t full_large_cube_sid; /* Dataspace for large cube w/all selection */ - hid_t mem_large_cube_sid; - hid_t file_large_cube_sid; - hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ - hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ - hid_t small_cube_dataset; /* Dataset ID */ - hid_t large_cube_dataset; /* Dataset ID */ - unsigned small_rank_offset; /* Rank offset of slice */ - const unsigned test_max_rank = 5; /* must update code if this changes */ + hid_t fid; /* HDF5 File IDs */ + hid_t full_small_cube_sid; /* Dataspace for small cube w/all selection */ + hid_t mem_small_cube_sid; + hid_t file_small_cube_sid; + hid_t full_large_cube_sid; /* Dataspace for large cube w/all selection */ + hid_t mem_large_cube_sid; + hid_t file_large_cube_sid; + hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ + hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ + hid_t small_cube_dataset; /* Dataset ID */ + hid_t large_cube_dataset; /* Dataset ID */ + unsigned small_rank_offset; /* Rank offset of slice */ + const unsigned test_max_rank = 5; /* must update code if this changes */ size_t start_index; /* Offset within buffer to begin inspecting */ size_t stop_index; /* Offset within buffer to end inspecting */ - uint16_t expected_value; - uint16_t * small_cube_buf_1; - uint16_t * large_cube_buf_1; - uint16_t * ptr_1; + uint16_t expected_value; + uint16_t * small_cube_buf_1; + uint16_t * large_cube_buf_1; + uint16_t * ptr_1; size_t small_cube_size; /* Number of elements in small cube */ size_t large_cube_size; /* Number of elements in large cube */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t chunk_dims[SS_DR_MAX_RANK]; - hsize_t sel_start[SS_DR_MAX_RANK]; + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t chunk_dims[SS_DR_MAX_RANK]; + hsize_t sel_start[SS_DR_MAX_RANK]; unsigned u, v, w, x; /* Local index variables */ size_t s; /* Local index variable */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ MESSAGE(7, ("\tn-cube slice through m-cube I/O test %d.\n", test_num)); MESSAGE(7, ("\tranks = %d/%d, edge_size = %d, checker_edge_size = %d, chunk_edge_size = %d.\n", small_rank, large_rank, edge_size, checker_edge_size, chunk_edge_size)); @@ -2862,7 +2858,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ */ if(chunk_edge_size > 0) { chunk_dims[0] = chunk_dims[1] = - chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; + chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); CHECK(small_cube_dcpl_id, FAIL, "H5Pcreate"); @@ -2938,11 +2934,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* first, verify that we can read from disk correctly using selections - * of different rank that H5S_select_shape_same() views as being of the + * of different rank that H5Sselect_shape_same() views as being of the * same shape. * * Start by reading small_rank-D slice from the on disk large cube, and - * verifying that the data read is correct. Verify that H5S_select_shape_same() + * verifying that the data read is correct. Verify that H5Sselect_shape_same() * returns true on the memory and file selections. * * The first step is to set up the needed checker board selection in the @@ -3004,12 +3000,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S__select_shape_same_test(mem_small_cube_sid, - file_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mem_small_cube_sid, file_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* zero the buffer that we will be using for reading */ HDmemset(small_cube_buf_1, 0, sizeof(*small_cube_buf_1) * small_cube_size); @@ -3111,12 +3106,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S__select_shape_same_test(file_small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(file_small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* zero out the in memory large cube */ @@ -3195,12 +3189,12 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* now we go in the opposite direction, verifying that we can write * from memory to file using selections of different rank that - * H5S_select_shape_same() views as being of the same shape. + * H5Sselect_shape_same() views as being of the same shape. * * Start by writing small_rank D slices from the in memory large cube, to * the the on disk small cube dataset. After each write, read the small * cube dataset back from disk, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on the + * data. Verify that H5Sselect_shape_same() returns true on the * memory and file selections. */ @@ -3264,15 +3258,14 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S__select_shape_same_test(file_small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(file_small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - /* write the slice from the in memory large cube to the + /* write the slice from the in memory large cube to the * on disk small cube */ ret = H5Dwrite(small_cube_dataset, @@ -3332,7 +3325,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * small cube to slices of the on disk cube. After each write, * read the on disk large cube * into memeory, and verify that * it contains the expected * data. Verify that - * H5S_select_shape_same() returns true on the memory and file + * H5Sselect_shape_same() returns true on the memory and file * selections. */ @@ -3396,15 +3389,14 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S__select_shape_same_test(file_large_cube_sid, - mem_small_cube_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(file_large_cube_sid, mem_small_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - /* write the checker board selection of the in memory + /* write the checker board selection of the in memory * small cube to a slice through the on disk large * cube. */ @@ -3531,17 +3523,17 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ } /* test_select_hyper_checker_board_dr__run_test() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr(): Test H5S (dataspace) -** selection code with checkerboard source and target having -** different ranks but the same shape. We have already -** tested H5S_shape_same in isolation, so now we try to do -** I/O. +** selection code with checkerboard source and target having +** different ranks but the same shape. We have already +** tested H5Sselect_shape_same in isolation, so now we try to do +** I/O. ** -** This is just an initial smoke check, so we will work -** with a slice through a cube only. +** This is just an initial smoke check, so we will work +** with a slice through a cube only. ** ****************************************************************/ static void @@ -3616,7 +3608,7 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) } /* test_select_hyper_checker_board_dr() */ - + /**************************************************************** ** ** test_select_hyper_copy(): Test H5S (dataspace) selection code. @@ -3626,22 +3618,22 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_copy(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t data1,data2; /* Dataset IDs */ - hid_t sid1,sid2,sid3; /* Dataspace IDs */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t data1,data2; /* Dataset IDs */ + hid_t sid1,sid2,sid3; /* Dataspace IDs */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* 1st buffer read from disk */ *rbuf2, /* 2nd buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); @@ -3782,21 +3774,21 @@ test_select_hyper_copy(void) static void test_select_point_copy(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t data1,data2; /* Dataset IDs */ - hid_t sid1,sid2,sid3; /* Dataspace IDs */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t data1,data2; /* Dataset IDs */ + hid_t sid1,sid2,sid3; /* Dataspace IDs */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* 1st buffer read from disk */ *rbuf2, /* 2nd buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); @@ -3956,24 +3948,24 @@ test_select_point_copy(void) static void test_select_hyper_offset(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ - hssize_t offset[SPACE1_RANK]; /* Offset of selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hssize_t offset[SPACE1_RANK]; /* Offset of selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - htri_t valid; /* Generic boolean return value */ + herr_t ret; /* Generic return value */ + htri_t valid; /* Generic boolean return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -4118,21 +4110,21 @@ test_select_hyper_offset(void) static void test_select_hyper_offset2(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */ - hssize_t offset[SPACE7_RANK]; /* Offset of selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */ + hssize_t offset[SPACE7_RANK]; /* Offset of selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - htri_t valid; /* Generic boolean return value */ + herr_t ret; /* Generic return value */ + htri_t valid; /* Generic boolean return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing More Hyperslab Selection Functions with Offsets\n")); @@ -4239,23 +4231,23 @@ test_select_hyper_offset2(void) static void test_select_point_offset(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ - hssize_t offset[SPACE1_RANK]; /* Offset of selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hssize_t offset[SPACE1_RANK]; /* Offset of selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - htri_t valid; /* Generic boolean return value */ + herr_t ret; /* Generic return value */ + htri_t valid; /* Generic boolean return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Element Selection Functions\n")); @@ -4411,17 +4403,17 @@ test_select_point_offset(void) static void test_select_hyper_union(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t xfer; /* Dataset Transfer Property List ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t xfer; /* Dataset Transfer Property List ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ size_t begin[SPACE2_DIM1]= /* Offset within irregular block */ {0,0,0,0,0,0,0,0,0,0, /* First ten rows start at offset 0 */ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}; /* Next eighteen rows start at offset 5 */ @@ -4434,8 +4426,8 @@ test_select_hyper_union(void) *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of hyperslabs\n")); @@ -5045,10 +5037,10 @@ test_select_hyper_union_stagger(void) /* Verify input data */ for(i=0; i<8; i++) { if(data[input_loc[i][0]][input_loc[i][1]]!=data_out[output_loc[i][0]][output_loc[i][1]]) { - printf("input data #%d is wrong!\n",i); - printf("input_loc=[%d][%d]\n",input_loc[i][0],input_loc[i][1]); - printf("output_loc=[%d][%d]\n",output_loc[i][0],output_loc[i][1]); - printf("data=%d\n",data[input_loc[i][0]][input_loc[i][1]]); + HDprintf("input data #%d is wrong!\n",i); + HDprintf("input_loc=[%d][%d]\n",input_loc[i][0],input_loc[i][1]); + HDprintf("output_loc=[%d][%d]\n",output_loc[i][0],output_loc[i][1]); + HDprintf("data=%d\n",data[input_loc[i][0]][input_loc[i][1]]); TestErrPrintf("data_out=%d\n",data_out[output_loc[i][0]][output_loc[i][1]]); } /* end if */ } /* end for */ @@ -5078,18 +5070,18 @@ test_select_hyper_union_stagger(void) static void test_select_hyper_union_3d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t tmp_space; /* Temporary Dataspace ID */ - hid_t tmp2_space; /* Another temporary Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t tmp_space; /* Temporary Dataspace ID */ + hid_t tmp2_space; /* Another temporary Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ struct row_list { size_t z; size_t y; @@ -5150,8 +5142,8 @@ test_select_hyper_union_3d(void) *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j,k; /* Counters */ - herr_t ret; /* Generic return value */ - hsize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hsize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of 3-D hyperslabs\n")); @@ -5286,20 +5278,20 @@ test_select_hyper_union_3d(void) static void test_select_hyper_valid_combination(void) { - hid_t single_pt_sid; /* Dataspace ID with single point selection */ - hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ - hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ - hid_t non_existent_sid = -1; /* A non-existent space id */ - hid_t tmp_sid; /* Temporary dataspace ID */ - hsize_t dims2D[] = {SPACE9_DIM1, SPACE9_DIM2}; - hsize_t dims3D[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; - - hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t non_existent_sid = -1; /* A non-existent space id */ + hid_t tmp_sid; /* Temporary dataspace ID */ + hsize_t dims2D[] = {SPACE9_DIM1, SPACE9_DIM2}; + hsize_t dims3D[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; + + hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ hsize_t start[SPACE4_RANK]; /* Hyperslab start */ hsize_t stride[SPACE4_RANK]; /* Hyperslab stride */ hsize_t count[SPACE4_RANK]; /* Hyperslab block count */ hsize_t block[SPACE4_RANK]; /* Hyperslab block size */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Selection Combination Validity\n")); @@ -5341,35 +5333,35 @@ test_select_hyper_valid_combination(void) /* Test all the selections created */ - /* Test the invalid combinations between point and hyperslab */ - tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); - VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + /* Test the invalid combinations between point and hyperslab */ + tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); - VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); - /* Test the invalid combination between two hyperslab but of different dimension size */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); - VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + /* Test the invalid combination between two hyperslab but of different dimension size */ + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); - VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); - /* Test invalid operation inputs to the two functions */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); - VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + /* Test invalid operation inputs to the two functions */ + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); - VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); - /* Test inputs in case of non-existent space ids */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); - VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + /* Test inputs in case of non-existent space ids */ + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); - VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); - /* Close dataspaces */ + /* Close dataspaces */ ret = H5Sclose(single_pt_sid); CHECK(ret, FAIL, "H5Sclose"); ret = H5Sclose(single_hyper_sid); @@ -5388,22 +5380,22 @@ test_select_hyper_valid_combination(void) static void test_select_hyper_and_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with intersection of 2-D hyperslabs\n")); @@ -5478,12 +5470,12 @@ test_select_hyper_and_2d(void) for(j=0; j<SPACE2_DIM2; j++, tbuf++) { if((i>=5 && i<=9) && (j>=5 && j<=9)) { if(*tbuf!=*tbuf2) - printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); + HDprintf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) - printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); + HDprintf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ @@ -5517,22 +5509,22 @@ test_select_hyper_and_2d(void) static void test_select_hyper_xor_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with XOR of 2-D hyperslabs\n")); @@ -5609,12 +5601,12 @@ test_select_hyper_xor_2d(void) ((i>=5 && i<=9) && ((j>=0 && j<=4) || (j>=10 && j<=14))) || ((i>=10 && i<=14) && (j>=5 && j<=14))) { if(*tbuf!=*tbuf2) - printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); + HDprintf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) - printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); + HDprintf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ @@ -5648,22 +5640,22 @@ test_select_hyper_xor_2d(void) static void test_select_hyper_notb_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTB of 2-D hyperslabs\n")); @@ -5739,12 +5731,12 @@ test_select_hyper_notb_2d(void) if(((i>=0 && i<=4) && (j>=0 && j<=9)) || ((i>=5 && i<=9) && (j>=0 && j<=4))) { if(*tbuf!=*tbuf2) - printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); + HDprintf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) - printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); + HDprintf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ @@ -5778,22 +5770,22 @@ test_select_hyper_notb_2d(void) static void test_select_hyper_nota_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTA of 2-D hyperslabs\n")); @@ -5913,14 +5905,14 @@ test_select_hyper_iter2(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim if(*tbuf!=**tbuf2) { TestErrPrintf("Error in hyperslab iteration!\n"); - printf("location: { "); + HDprintf("location: { "); for(u=0; u<ndim; u++) { - printf("%2d",(int)point[u]); + HDprintf("%2d",(int)point[u]); if(u<(ndim-1)) - printf(", "); + HDprintf(", "); } /* end for */ - printf("}\n"); - printf("*tbuf=%d, **tbuf2=%d\n",*tbuf,**tbuf2); + HDprintf("}\n"); + HDprintf("*tbuf=%d, **tbuf2=%d\n",*tbuf,**tbuf2); return(-1); } /* end if */ else { @@ -5938,20 +5930,20 @@ test_select_hyper_iter2(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim static void test_select_hyper_union_random_5d(hid_t read_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE5_DIM1, SPACE5_DIM2, SPACE5_DIM3, SPACE5_DIM4, SPACE5_DIM5}; - hsize_t dims2[] = {SPACE6_DIM1}; - hsize_t start[SPACE5_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE5_RANK]; /* Element count of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE5_DIM1, SPACE5_DIM2, SPACE5_DIM3, SPACE5_DIM4, SPACE5_DIM5}; + hsize_t dims2[] = {SPACE6_DIM1}; + hsize_t start[SPACE5_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE5_RANK]; /* Element count of hyperslab */ int *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j,k,l,m; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints, /* Number of elements in file selection */ - npoints2; /* Number of elements in memory selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints, /* Number of elements in file selection */ + npoints2; /* Number of elements in memory selection */ unsigned seed; /* Random number seed for each test */ unsigned test_num; /* Count of tests being executed */ @@ -6120,8 +6112,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) */ tmpdata = data; for (j = 0; j < X; j++) - for (i = 0; i < Y; i++) - for (k = 0; k < Z; k++) + for (i = 0; i < Y; i++) + for (k = 0; k < Z; k++) *tmpdata++ = (short)((k+1)%256); /* @@ -6133,7 +6125,7 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(file, FAIL, "H5Fcreate"); /* - * Describe the size of the array and create the data space for fixed + * Describe the size of the array and create the dataspace for fixed * size dataset. */ dimsf[0] = X; @@ -6283,8 +6275,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) tmpdata = data; tmpdata_out = data_out; for (j = 0; j < X; j++) - for (i = 0; i < Y; i++) - for (k = 0; k < Z; k++,tmpdata++,tmpdata_out++) { + for (i = 0; i < Y; i++) + for (k = 0; k < Z; k++,tmpdata++,tmpdata_out++) { if(*tmpdata!=*tmpdata_out) TestErrPrintf("Line %d: Error! j=%d, i=%d, k=%d, *tmpdata=%x, *tmpdata_out=%x\n",__LINE__,j,i,k,(unsigned)*tmpdata,(unsigned)*tmpdata_out); } /* end for */ @@ -6331,7 +6323,7 @@ test_select_point_chunk(void) hid_t dcpl; herr_t ret; /* Generic return value */ - unsigned *data_out; /* output buffer */ + unsigned *data_out; /* output buffer */ hsize_t start[SPACE7_RANK]; /* hyperslab offset */ hsize_t count[SPACE7_RANK]; /* size of the hyperslab */ @@ -6352,7 +6344,7 @@ test_select_point_chunk(void) */ tmpdata = data; for (i = 0; i < SPACE7_DIM1; i++) - for (j = 0; j < SPACE7_DIM1; j++) + for (j = 0; j < SPACE7_DIM1; j++) *tmpdata++ = ((i*SPACE7_DIM2)+j)%256; /* @@ -7089,15 +7081,15 @@ test_select_hyper_iter3(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim static void test_select_fill_all(void) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; unsigned fill_value; /* Fill value */ fill_iter_info iter_info; /* Iterator information structure */ hsize_t points[SPACE7_DIM1*SPACE7_DIM2][SPACE7_RANK]; /* Coordinates of selection */ unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling 'all' Selections\n")); @@ -7163,8 +7155,8 @@ test_select_fill_all(void) static void test_select_fill_point(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t points[5][SPACE7_RANK] = {{2,4}, {3,8}, {8,4}, {7,5}, {7,7}}; size_t num_points = 5; /* Number of points selected */ @@ -7173,7 +7165,7 @@ test_select_fill_point(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v, w; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling 'point' Selections\n")); @@ -7258,8 +7250,8 @@ test_select_fill_point(hssize_t *offset) static void test_select_fill_hyper_simple(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block size */ @@ -7270,7 +7262,7 @@ test_select_fill_hyper_simple(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Simple 'hyperslab' Selections\n")); @@ -7358,8 +7350,8 @@ test_select_fill_hyper_simple(hssize_t *offset) static void test_select_fill_hyper_regular(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t stride[SPACE7_RANK]; /* Hyperslab stride size */ @@ -7377,7 +7369,7 @@ test_select_fill_hyper_regular(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v, w; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Regular 'hyperslab' Selections\n")); @@ -7466,8 +7458,8 @@ test_select_fill_hyper_regular(hssize_t *offset) static void test_select_fill_hyper_irregular(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ @@ -7496,7 +7488,7 @@ test_select_fill_hyper_irregular(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v, w; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Irregular 'hyperslab' Selections\n")); @@ -7589,16 +7581,16 @@ test_select_fill_hyper_irregular(hssize_t *offset) static void test_select_none(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer to read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing I/O on 0-sized Selections\n")); @@ -7687,11 +7679,11 @@ test_select_none(void) static void test_scalar_select(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ uint8_t *wbuf_uint8, /* buffer to write to disk */ @@ -7701,7 +7693,7 @@ test_scalar_select(void) rval_ushort, /* value read back in */ *tbuf_ushort; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces\n")); @@ -7833,18 +7825,18 @@ test_scalar_select(void) /**************************************************************** ** ** test_scalar_select2(): Tests selections on scalar dataspace, -** verify H5Sselect_hyperslab and H5Sselect_elements fails for -** scalar dataspace. +** verify H5Sselect_hyperslab and H5Sselect_elements fails for +** scalar dataspace. ** ****************************************************************/ static void test_scalar_select2(void) { - hid_t sid; /* Dataspace ID */ - hsize_t coord1[1]; /* Coordinates for point selection */ + hid_t sid; /* Dataspace ID */ + hsize_t coord1[1]; /* Coordinates for point selection */ hsize_t start[1]; /* Hyperslab start */ hsize_t count[1]; /* Hyperslab block count */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Selections in Scalar Dataspaces\n")); @@ -7856,7 +7848,7 @@ test_scalar_select2(void) /* Select one element in memory with a point selection */ coord1[0]=0; H5E_BEGIN_TRY { - ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1); + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_elements"); @@ -7864,7 +7856,7 @@ test_scalar_select2(void) start[0]=0; count[0]=0; H5E_BEGIN_TRY { - ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL); + ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_hyperslab"); @@ -7874,7 +7866,7 @@ test_scalar_select2(void) /* Select all elements in memory & file with "all" selection */ ret = H5Sselect_all(sid); - CHECK(ret, FAIL, "H5Sselect_none"); + CHECK(ret, FAIL, "H5Sselect_all"); /* Close disk dataspace */ ret = H5Sclose(sid); @@ -7890,18 +7882,18 @@ test_scalar_select2(void) static void test_scalar_select3(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ uint8_t wval_uint8, /* Value written out */ rval_uint8; /* Value read in */ unsigned short wval_ushort, /* Another value written out */ rval_ushort; /* Another value read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces in Memory\n")); @@ -8024,40 +8016,40 @@ test_scalar_select3(void) /**************************************************************** ** ** test_shape_same(): Tests selections on dataspace, verify that -** "shape same" routine is working correctly. +** "shape same" routine is working correctly. ** ****************************************************************/ static void test_shape_same(void) { - hid_t all_sid; /* Dataspace ID with "all" selection */ - hid_t none_sid; /* Dataspace ID with "none" selection */ - hid_t single_pt_sid; /* Dataspace ID with single point selection */ - hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ - hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ - hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab + hid_t all_sid; /* Dataspace ID with "all" selection */ + hid_t none_sid; /* Dataspace ID with "none" selection */ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab * selection that is the entire dataspace */ - hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab + hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab * selection that is the same as the single * point selection */ - hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ - hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ - hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ - hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ - hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ - hid_t tmp_sid; /* Temporary dataspace ID */ - hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; - hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ - hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ + hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ + hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ + hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ + hid_t tmp_sid; /* Temporary dataspace ID */ + hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; + hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ + hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ hsize_t start[SPACE9_RANK]; /* Hyperslab start */ hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */ hsize_t count[SPACE9_RANK]; /* Hyperslab block count */ hsize_t block[SPACE9_RANK]; /* Hyperslab block size */ unsigned u,v; /* Local index variables */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape Comparisons\n")); @@ -8202,294 +8194,294 @@ test_shape_same(void) /* Compare "all" selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(all_sid,all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid ,all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(all_sid); + tmp_sid = H5Scopy(all_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(all_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(all_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(all_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(all_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(all_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(all_sid,single_hyper_all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_hyper_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(all_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(all_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(all_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(all_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(all_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(all_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare "none" selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(none_sid,none_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(none_sid); + tmp_sid = H5Scopy(none_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(none_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(none_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(none_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(none_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(none_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(none_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(none_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(none_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(none_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(none_sid,none_hyper_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, none_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(none_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(none_sid, scalar_none_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, scalar_none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare single point selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(single_pt_sid,single_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(single_pt_sid); + tmp_sid = H5Scopy(single_pt_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(single_pt_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(single_pt_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(single_pt_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(single_pt_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid,single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_hyper_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid, scalar_all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, scalar_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(single_pt_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare multiple point selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(mult_pt_sid,mult_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, mult_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(mult_pt_sid); + tmp_sid = H5Scopy(mult_pt_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(mult_pt_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(mult_pt_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(mult_pt_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(mult_pt_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(mult_pt_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare single "normal" hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(single_hyper_sid,single_hyper_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(single_hyper_sid); + tmp_sid = H5Scopy(single_hyper_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(single_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(single_hyper_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(single_hyper_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(single_hyper_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(single_hyper_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); #ifdef NOT_YET /* In theory, these two selections are the same shape, but the - * H5S_select_shape_same() routine is just not this sophisticated yet and it + * H5Sselect_shape_same() routine is just not this sophisticated yet and it * would take too much effort to make this work. The worst case is that the * non-optimized chunk mapping routines will be invoked instead of the more * optimized routines, so this only hurts performance, not correctness @@ -8500,17 +8492,19 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select sequence of points for point selection */ - for(u=1; u<(SPACE9_DIM1-1); u++) { - for(v=1; v<(SPACE9_DIM2-1); v++) { - coord2[v-1][0]=u; coord2[v-1][1]=v; + for(u = 1; u < (SPACE9_DIM1 - 1); u++) { + for(v = 1; v < (SPACE9_DIM2 - 1); v++) { + coord2[v - 1][0] = u; + coord2[v - 1][1] = v; } /* end for */ - ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,(SPACE9_DIM2-2),coord2); + + ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, (SPACE9_DIM2 - 2), coord2); CHECK(ret, FAIL, "H5Sselect_elements"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8526,80 +8520,80 @@ test_shape_same(void) CHECK(ret, FAIL, "H5Sselect_none"); /* Select sequence of rows for hyperslab selection */ - for(u=1; u<(SPACE9_DIM1-1); u++) { - start[0]=u; start[1]=1; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=1; block[1]=(SPACE9_DIM2-2); - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 1; u < (SPACE9_DIM1 - 1); u++) { + start[0] = u; start[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 1; block[1] = (SPACE9_DIM2 - 2); + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare single "all" hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(single_hyper_all_sid,single_hyper_all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_hyper_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(single_hyper_all_sid); + tmp_sid = H5Scopy(single_hyper_all_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(single_hyper_all_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); #ifdef NOT_YET /* In theory, these two selections are the same shape, but the @@ -8614,17 +8608,18 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select sequence of points for point selection */ - for(u=0; u<SPACE9_DIM1; u++) { - for(v=0; v<SPACE9_DIM2; v++) { - coord2[v][0]=u; coord2[v][1]=v; + for(u = 0; u < SPACE9_DIM1; u++) { + for(v = 0; v < SPACE9_DIM2; v++) { + coord2[v][0] = u; + coord2[v][1] = v; } /* end for */ - ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,SPACE9_DIM2,coord2); + ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, SPACE9_DIM2, coord2); CHECK(ret, FAIL, "H5Sselect_elements"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8640,139 +8635,139 @@ test_shape_same(void) CHECK(ret, FAIL, "H5Sselect_none"); /* Select sequence of rows for hyperslab selection */ - for(u=0; u<SPACE9_DIM2; u++) { - start[0]=u; start[1]=0; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=1; block[1]=SPACE9_DIM2; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 0; u < SPACE9_DIM2; u++) { + start[0] = u; start[1] = 0; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 1; block[1] = SPACE9_DIM2; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_all_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare single "point" hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_hyper_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(single_hyper_pt_sid); + tmp_sid = H5Scopy(single_hyper_pt_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(single_hyper_pt_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,single_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid, scalar_all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, scalar_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(single_hyper_pt_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare regular, strided hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(regular_hyper_sid,regular_hyper_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, regular_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(regular_hyper_sid); + tmp_sid = H5Scopy(regular_hyper_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(regular_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Construct point selection which matches regular, strided hyperslab selection */ /* Create dataspace for point selection */ @@ -8780,17 +8775,18 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select sequence of points for point selection */ - for(u=2; u<11; u+=2) { - for(v=0; v<2; v++) { - coord2[v][0]=u; coord2[v][1]=(v*2)+2; + for(u = 2; u < 11; u += 2) { + for(v = 0; v < 2; v++) { + coord2[v][0] = u; + coord2[v][1] = (v * 2) + 2; } /* end for */ ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, (size_t)2, (const hsize_t *)coord2); CHECK(ret, FAIL, "H5Sselect_elements"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8805,18 +8801,18 @@ test_shape_same(void) CHECK(ret, FAIL, "H5Sselect_none"); /* Select sequence of rows for hyperslab selection */ - for(u=2; u<11; u+=2) { - start[0]=u; start[1]=3; - stride[0]=1; stride[1]=2; - count[0]=1; count[1]=2; - block[0]=1; block[1]=1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 2; u < 11; u += 2) { + start[0] = u; start[1] = 3; + stride[0] = 1; stride[1] = 2; + count[0] = 1; count[1] = 2; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8827,237 +8823,237 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select regular, strided hyperslab selection at an offset */ - start[0]=1; start[1]=1; - stride[0]=2; stride[1]=2; - count[0]=5; count[1]=2; - block[0]=1; block[1]=1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block); + start[0] = 1; start[1] = 1; + stride[0] = 2; stride[1] = 2; + count[0] = 5; count[1] = 2; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(regular_hyper_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare irregular hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(irreg_hyper_sid,irreg_hyper_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, irreg_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(irreg_hyper_sid); + tmp_sid = H5Scopy(irreg_hyper_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(irreg_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Construct hyperslab selection which matches irregular hyperslab selection */ /* Create dataspace for hyperslab selection */ tmp_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); CHECK(tmp_sid, FAIL, "H5Screate_simple"); - start[0]=2; start[1]=2; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=1; block[1]=1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block); + start[0] = 2; start[1] = 2; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Select sequence of columns for hyperslab selection */ - for(u=0; u<3; u++) { - start[0]=4; start[1]=u+4; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=3; block[1]=1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 0; u < 3; u++) { + start[0] = 4; start[1] = u + 4; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 3; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ /* Compare against hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid,tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(irreg_hyper_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare scalar "all" dataspace with all selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(scalar_all_sid, scalar_all_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, scalar_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(scalar_all_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(scalar_all_sid, tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(scalar_all_sid, all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(scalar_all_sid, none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(scalar_all_sid, single_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(scalar_all_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_hyper_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S__select_shape_same_test(scalar_all_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare scalar "none" dataspace with all selections created */ /* Compare against itself */ - check = H5S__select_shape_same_test(scalar_none_sid, scalar_none_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, scalar_none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(scalar_none_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__select_shape_same_test(scalar_none_sid, tmp_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S__select_shape_same_test(scalar_none_sid, all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S__select_shape_same_test(scalar_none_sid, none_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S__select_shape_same_test(scalar_none_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S__select_shape_same_test(scalar_none_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, none_hyper_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, none_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S__select_shape_same_test(scalar_none_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -9091,52 +9087,52 @@ test_shape_same(void) ** ** test_shape_same_dr__smoke_check_1(): ** -** Create a square, 2 D data space (10 X 10), and select -** all of it. +** Create a square, 2-D dataspace (10 X 10), and select +** all of it. ** -** Similarly, create nine, 3 D data spaces (10 X 10 X 10), -** and select (10 X 10 X 1) hyper slabs in each, three with -** the slab parallel to the xy plane, three parallel to the -** xz plane, and three parallel to the yz plane. +** Similarly, create nine, 3-D dataspaces (10 X 10 X 10), +** and select (10 X 10 X 1) hyperslabs in each, three with +** the slab parallel to the xy plane, three parallel to the +** xz plane, and three parallel to the yz plane. ** -** Assuming that z is the fastest changing dimension, -** H5S_select_shape_same() should return TRUE when comparing -** the full 2 D space against any hyperslab parallel to the -** yz plane in the 3 D space, and FALSE when comparing the -** full 2 D space against the other two hyper slabs. +** Assuming that z is the fastest changing dimension, +** H5Sselect_shape_same() should return TRUE when comparing +** the full 2-D space against any hyperslab parallel to the +** yz plane in the 3-D space, and FALSE when comparing the +** full 2-D space against the other two hyperslabs. ** -** Also create two additional 3 D data spaces (10 X 10 X 10), -** and select a (10 X 10 X 2) hyper slab parallel to the yz -** axis in one of them, and two parallel (10 X 10 X 1) hyper -** slabs parallel to the yz axis in the other. -** H5S_select_shape_same() should return FALSE when comparing -** each to the 2 D selection. +** Also create two additional 3-D dataspaces (10 X 10 X 10), +** and select a (10 X 10 X 2) hyperslab parallel to the yz +** axis in one of them, and two parallel (10 X 10 X 1) hyper +** slabs parallel to the yz axis in the other. +** H5Sselect_shape_same() should return FALSE when comparing +** each to the 2-D selection. ** ****************************************************************/ static void test_shape_same_dr__smoke_check_1(void) { - hid_t small_square_sid; - hid_t small_cube_xy_slice_0_sid; - hid_t small_cube_xy_slice_1_sid; - hid_t small_cube_xy_slice_2_sid; - hid_t small_cube_xz_slice_0_sid; - hid_t small_cube_xz_slice_1_sid; - hid_t small_cube_xz_slice_2_sid; - hid_t small_cube_yz_slice_0_sid; - hid_t small_cube_yz_slice_1_sid; - hid_t small_cube_yz_slice_2_sid; - hid_t small_cube_yz_slice_3_sid; - hid_t small_cube_yz_slice_4_sid; - hsize_t small_cube_dims[] = {10, 10, 10}; - hsize_t start[3]; - hsize_t stride[3]; - hsize_t count[3]; - hsize_t block[3]; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 1: Slices through a cube.\n")); + hid_t small_square_sid; + hid_t small_cube_xy_slice_0_sid; + hid_t small_cube_xy_slice_1_sid; + hid_t small_cube_xy_slice_2_sid; + hid_t small_cube_xz_slice_0_sid; + hid_t small_cube_xz_slice_1_sid; + hid_t small_cube_xz_slice_2_sid; + hid_t small_cube_yz_slice_0_sid; + hid_t small_cube_yz_slice_1_sid; + hid_t small_cube_yz_slice_2_sid; + hid_t small_cube_yz_slice_3_sid; + hid_t small_cube_yz_slice_4_sid; + hsize_t small_cube_dims[] = {10, 10, 10}; + hsize_t start[3]; + hsize_t stride[3]; + hsize_t count[3]; + hsize_t block[3]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 1: Slices through a cube.\n")); /* Create the 10 x 10 dataspace */ small_square_sid = H5Screate_simple(2, small_cube_dims, NULL); @@ -9152,24 +9148,24 @@ test_shape_same_dr__smoke_check_1(void) small_cube_xy_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ /* stride is a bit silly here, since we are only selecting a single */ /* contiguous plane, but include it anyway, with values large enough */ /* to ensure that we will only get the single block selected. */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 10; /* x */ - block[1] = 10; /* y */ - block[2] = 1; /* z */ + block[0] = 10; /* x */ + block[1] = 10; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9195,24 +9191,24 @@ test_shape_same_dr__smoke_check_1(void) small_cube_xz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ /* stride is a bit silly here, since we are only selecting a single */ /* contiguous chunk, but include it anyway, with values large enough */ /* to ensure that we will only get the single chunk. */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 10; /* x */ - block[1] = 1; /* y */ - block[2] = 10; /* z */ + block[0] = 10; /* x */ + block[1] = 1; /* y */ + block[2] = 10; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9244,24 +9240,24 @@ test_shape_same_dr__smoke_check_1(void) small_cube_yz_slice_4_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_yz_slice_4_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ /* stride is a bit silly here, since we are only selecting a single */ /* contiguous chunk, but include it anyway, with values large enough */ /* to ensure that we will only get the single chunk. */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 10; /* y */ - block[2] = 10; /* z */ + block[0] = 1; /* x */ + block[1] = 10; /* y */ + block[2] = 10; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); @@ -9298,42 +9294,42 @@ test_shape_same_dr__smoke_check_1(void) /* setup is done -- run the tests: */ /* Compare against "xy" selection */ - check = H5S__select_shape_same_test(small_cube_xy_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xy_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xy_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "xz" selection */ - check = H5S__select_shape_same_test(small_cube_xz_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xz_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xz_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "yz" selection */ - check = H5S__select_shape_same_test(small_cube_yz_slice_0_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_0_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_1_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_1_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_2_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_2_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_3_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_3_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_4_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_4_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -9382,98 +9378,98 @@ test_shape_same_dr__smoke_check_1(void) ** ** test_shape_same_dr__smoke_check_2(): ** -** Create a square, 2 D data space (10 X 10), and select -** a "checker board" hyper slab as follows: +** Create a square, 2-D dataspace (10 X 10), and select +** a "checker board" hyperslab as follows: ** -** * * - - * * - - * * +** * * - - * * - - * * ** * * - - * * - - * * ** - - * * - - * * - - ** - - * * - - * * - - -** * * - - * * - - * * +** * * - - * * - - * * ** * * - - * * - - * * ** - - * * - - * * - - ** - - * * - - * * - - -** * * - - * * - - * * +** * * - - * * - - * * ** * * - - * * - - * * ** -** where asterisks indicate selected elements, and dashes -** indicate unselected elements. -** -** Similarly, create nine, 3 D data spaces (10 X 10 X 10), -** and select similar (10 X 10 X 1) checker board hyper -** slabs in each, three with the slab parallel to the xy -** plane, three parallel to the xz plane, and three parallel -** to the yz plane. -** -** Assuming that z is the fastest changing dimension, -** H5S_select_shape_same() should return TRUE when comparing -** the 2 D space checker board selection against a checker -** board hyperslab parallel to the yz plane in the 3 D -** space, and FALSE when comparing the 2 D checkerboard -** selection against two hyper slabs parallel to the xy -** or xz planes. -** -** Also create an additional 3 D data spaces (10 X 10 X 10), -** and select a checker board parallel with the yz axis, -** save with some squares being on different planes. -** H5S_select_shape_same() should return FALSE when -** comparing this selection to the 2 D selection. +** where asterisks indicate selected elements, and dashes +** indicate unselected elements. +** +** Similarly, create nine, 3-D dataspaces (10 X 10 X 10), +** and select similar (10 X 10 X 1) checker board hyper +** slabs in each, three with the slab parallel to the xy +** plane, three parallel to the xz plane, and three parallel +** to the yz plane. +** +** Assuming that z is the fastest changing dimension, +** H5Sselect_shape_same() should return TRUE when comparing +** the 2-D space checker board selection against a checker +** board hyperslab parallel to the yz plane in the 3-D +** space, and FALSE when comparing the 2-D checkerboard +** selection against two hyperslabs parallel to the xy +** or xz planes. +** +** Also create an additional 3-D dataspaces (10 X 10 X 10), +** and select a checker board parallel with the yz axis, +** save with some squares being on different planes. +** H5Sselect_shape_same() should return FALSE when +** comparing this selection to the 2-D selection. ** ****************************************************************/ static void test_shape_same_dr__smoke_check_2(void) { - hid_t small_square_sid; - hid_t small_cube_xy_slice_0_sid; - hid_t small_cube_xy_slice_1_sid; - hid_t small_cube_xy_slice_2_sid; - hid_t small_cube_xz_slice_0_sid; - hid_t small_cube_xz_slice_1_sid; - hid_t small_cube_xz_slice_2_sid; - hid_t small_cube_yz_slice_0_sid; - hid_t small_cube_yz_slice_1_sid; - hid_t small_cube_yz_slice_2_sid; - hid_t small_cube_yz_slice_3_sid; - hsize_t small_cube_dims[] = {10, 10, 10}; - hsize_t start[3]; - hsize_t stride[3]; - hsize_t count[3]; - hsize_t block[3]; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 2: Checker board slices through a cube.\n")); + hid_t small_square_sid; + hid_t small_cube_xy_slice_0_sid; + hid_t small_cube_xy_slice_1_sid; + hid_t small_cube_xy_slice_2_sid; + hid_t small_cube_xz_slice_0_sid; + hid_t small_cube_xz_slice_1_sid; + hid_t small_cube_xz_slice_2_sid; + hid_t small_cube_yz_slice_0_sid; + hid_t small_cube_yz_slice_1_sid; + hid_t small_cube_yz_slice_2_sid; + hid_t small_cube_yz_slice_3_sid; + hsize_t small_cube_dims[] = {10, 10, 10}; + hsize_t start[3]; + hsize_t stride[3]; + hsize_t count[3]; + hsize_t block[3]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 2: Checker board slices through a cube.\n")); /* Create the 10 x 10 dataspace */ small_square_sid = H5Screate_simple(2, small_cube_dims, NULL); CHECK(small_square_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ - count[0] = 3; /* x */ - count[1] = 3; /* y */ + count[0] = 3; /* x */ + count[1] = 3; /* y */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 2; /* x */ - start[1] = 2; /* y */ + start[0] = 2; /* x */ + start[1] = 2; /* y */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ - count[0] = 2; /* x */ - count[1] = 2; /* y */ + count[0] = 2; /* x */ + count[1] = 2; /* y */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9490,21 +9486,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ - stride[2] = 20; /* z -- large enough that there will only be one slice */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ + stride[2] = 20; /* z -- large enough that there will only be one slice */ - count[0] = 3; /* x */ - count[1] = 3; /* y */ - count[2] = 1; /* z */ + count[0] = 3; /* x */ + count[1] = 3; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9520,21 +9516,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 2; /* x */ - start[1] = 2; /* y */ - start[2] = 0; /* z */ + start[0] = 2; /* x */ + start[1] = 2; /* y */ + start[2] = 0; /* z */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ - stride[2] = 20; /* z -- large enough that there will only be one slice */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ + stride[2] = 20; /* z -- large enough that there will only be one slice */ - count[0] = 2; /* x */ - count[1] = 2; /* y */ - count[2] = 1; /* z */ + count[0] = 2; /* x */ + count[1] = 2; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9561,21 +9557,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ - stride[0] = 4; /* x */ - stride[1] = 20; /* y -- large enough that there will only be one slice */ - stride[2] = 4; /* z */ + stride[0] = 4; /* x */ + stride[1] = 20; /* y -- large enough that there will only be one slice */ + stride[2] = 4; /* z */ - count[0] = 3; /* x */ - count[1] = 1; /* y */ - count[2] = 3; /* z */ + count[0] = 3; /* x */ + count[1] = 1; /* y */ + count[2] = 3; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9590,21 +9586,21 @@ test_shape_same_dr__smoke_check_2(void) start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 2; /* x */ - start[1] = 0; /* y */ - start[2] = 2; /* z */ + start[0] = 2; /* x */ + start[1] = 0; /* y */ + start[2] = 2; /* z */ - stride[0] = 4; /* x */ - stride[1] = 20; /* y -- large enough that there will only be one slice */ - stride[2] = 4; /* z */ + stride[0] = 4; /* x */ + stride[1] = 20; /* y -- large enough that there will only be one slice */ + stride[2] = 4; /* z */ - count[0] = 2; /* x */ - count[1] = 1; /* y */ - count[2] = 2; /* z */ + count[0] = 2; /* x */ + count[1] = 1; /* y */ + count[2] = 2; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9633,21 +9629,21 @@ test_shape_same_dr__smoke_check_2(void) small_cube_yz_slice_3_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_yz_slice_3_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ - stride[0] = 20; /* x -- large enough that there will only be one slice */ - stride[1] = 4; /* y */ - stride[2] = 4; /* z */ + stride[0] = 20; /* x -- large enough that there will only be one slice */ + stride[1] = 4; /* y */ + stride[2] = 4; /* z */ - count[0] = 1; /* x */ - count[1] = 3; /* y */ - count[2] = 3; /* z */ + count[0] = 1; /* x */ + count[1] = 3; /* y */ + count[2] = 3; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9668,21 +9664,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 0; /* x */ - start[1] = 2; /* y */ - start[2] = 2; /* z */ + start[0] = 0; /* x */ + start[1] = 2; /* y */ + start[2] = 2; /* z */ - stride[0] = 20; /* x -- large enough that there will only be one slice */ - stride[1] = 4; /* y */ - stride[2] = 4; /* z */ + stride[0] = 20; /* x -- large enough that there will only be one slice */ + stride[1] = 4; /* y */ + stride[2] = 4; /* z */ - count[0] = 1; /* x */ - count[1] = 2; /* y */ - count[2] = 2; /* z */ + count[0] = 1; /* x */ + count[1] = 2; /* y */ + count[2] = 2; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9711,39 +9707,39 @@ test_shape_same_dr__smoke_check_2(void) /* setup is done -- run the tests: */ /* Compare against "xy" selection */ - check = H5S__select_shape_same_test(small_cube_xy_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xy_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xy_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "xz" selection */ - check = H5S__select_shape_same_test(small_cube_xz_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xz_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xz_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "yz" selection */ - check = H5S__select_shape_same_test(small_cube_yz_slice_0_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_0_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_1_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_1_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_2_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_2_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_3_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_3_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -9790,109 +9786,109 @@ test_shape_same_dr__smoke_check_2(void) ** ** test_shape_same_dr__smoke_check_3(): ** -** Create a square, 2 D data space (10 X 10), and select an -** irregular hyper slab as follows: -** -** y -** 9 - - - - - - - - - - -** 8 - - - - - - - - - - -** 7 - - - * * * * - - - -** 6 - - * * * * * - - - -** 5 - - * * - - - - - - -** 4 - - * * - * * - - - -** 3 - - * * - * * - - - -** 2 - - - - - - - - - - -** 1 - - - - - - - - - - -** 0 - - - - - - - - - - +** Create a square, 2-D dataspace (10 X 10), and select an +** irregular hyperslab as follows: +** +** y +** 9 - - - - - - - - - - +** 8 - - - - - - - - - - +** 7 - - - * * * * - - - +** 6 - - * * * * * - - - +** 5 - - * * - - - - - - +** 4 - - * * - * * - - - +** 3 - - * * - * * - - - +** 2 - - - - - - - - - - +** 1 - - - - - - - - - - +** 0 - - - - - - - - - - ** 0 1 2 3 4 5 6 7 8 9 x ** -** where asterisks indicate selected elements, and dashes -** indicate unselected elements. +** where asterisks indicate selected elements, and dashes +** indicate unselected elements. ** -** Similarly, create nine, 3 D data spaces (10 X 10 X 10), -** and select similar irregular hyper slabs in each, three -** with the slab parallel to the xy plane, three parallel -** to the xz plane, and three parallel to the yz plane. -** Further, translate the irregular slab in 2/3rds of the -** cases. +** Similarly, create nine, 3-D dataspaces (10 X 10 X 10), +** and select similar irregular hyperslabs in each, three +** with the slab parallel to the xy plane, three parallel +** to the xz plane, and three parallel to the yz plane. +** Further, translate the irregular slab in 2/3rds of the +** cases. ** -** Assuming that z is the fastest changing dimension, -** H5S_select_shape_same() should return TRUE when -** comparing the 2 D irregular hyperslab selection -** against the irregular hyperslab selections parallel -** to the yz plane in the 3 D space, and FALSE when -** comparing it against the irregular hyper slabs -** selections parallel to the xy or xz planes. +** Assuming that z is the fastest changing dimension, +** H5Sselect_shape_same() should return TRUE when +** comparing the 2-D irregular hyperslab selection +** against the irregular hyperslab selections parallel +** to the yz plane in the 3-D space, and FALSE when +** comparing it against the irregular hyperslabs +** selections parallel to the xy or xz planes. ** ****************************************************************/ static void test_shape_same_dr__smoke_check_3(void) { - hid_t small_square_sid; - hid_t small_cube_xy_slice_0_sid; - hid_t small_cube_xy_slice_1_sid; - hid_t small_cube_xy_slice_2_sid; - hid_t small_cube_xz_slice_0_sid; - hid_t small_cube_xz_slice_1_sid; - hid_t small_cube_xz_slice_2_sid; - hid_t small_cube_yz_slice_0_sid; - hid_t small_cube_yz_slice_1_sid; - hid_t small_cube_yz_slice_2_sid; - hsize_t small_cube_dims[] = {10, 10, 10}; - hsize_t start[3]; - hsize_t stride[3]; - hsize_t count[3]; - hsize_t block[3]; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 3: Offset subsets of slices through a cube.\n")); + hid_t small_square_sid; + hid_t small_cube_xy_slice_0_sid; + hid_t small_cube_xy_slice_1_sid; + hid_t small_cube_xy_slice_2_sid; + hid_t small_cube_xz_slice_0_sid; + hid_t small_cube_xz_slice_1_sid; + hid_t small_cube_xz_slice_2_sid; + hid_t small_cube_yz_slice_0_sid; + hid_t small_cube_yz_slice_1_sid; + hid_t small_cube_yz_slice_2_sid; + hsize_t small_cube_dims[] = {10, 10, 10}; + hsize_t start[3]; + hsize_t stride[3]; + hsize_t count[3]; + hsize_t block[3]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 3: Offset subsets of slices through a cube.\n")); /* Create the 10 x 10 dataspace */ small_square_sid = H5Screate_simple(2, small_cube_dims, NULL); CHECK(small_square_sid, FAIL, "H5Screate_simple"); - start[0] = 2; /* x */ - start[1] = 3; /* y */ + start[0] = 2; /* x */ + start[1] = 3; /* y */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ - block[0] = 2; /* x */ - block[1] = 4; /* y */ + block[0] = 2; /* x */ + block[1] = 4; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 3; /* x */ - start[1] = 6; /* y */ + start[0] = 3; /* x */ + start[1] = 6; /* y */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ - block[0] = 4; /* x */ - block[1] = 2; /* y */ + block[0] = 4; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 5; /* x */ - start[1] = 3; /* y */ + start[0] = 5; /* x */ + start[1] = 3; /* y */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9909,101 +9905,101 @@ test_shape_same_dr__smoke_check_3(void) CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 2; /* x */ - start[1] = 3; /* y */ - start[2] = 5; /* z */ + start[0] = 2; /* x */ + start[1] = 3; /* y */ + start[2] = 5; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 4; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 4; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[1] -= 2; /* y */ + start[0] -= 1; /* x */ + start[1] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[1] += 5; /* y */ + start[0] += 5; /* x */ + start[1] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 3; /* x */ - start[1] = 6; /* y */ - start[2] = 5; /* z */ + start[0] = 3; /* x */ + start[1] = 6; /* y */ + start[2] = 5; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 4; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 4; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[1] -= 2; /* y */ + start[0] -= 1; /* x */ + start[1] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[1] += 5; /* y */ + start[0] += 5; /* x */ + start[1] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 5; /* x */ - start[1] = 3; /* y */ - start[2] = 5; /* z */ + start[0] = 5; /* x */ + start[1] = 3; /* y */ + start[2] = 5; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[1] -= 2; /* y */ + start[0] -= 1; /* x */ + start[1] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[1] += 5; /* y */ + start[0] += 5; /* x */ + start[1] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -10019,101 +10015,101 @@ test_shape_same_dr__smoke_check_3(void) small_cube_xz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 2; /* x */ - start[1] = 5; /* y */ - start[2] = 3; /* z */ + start[0] = 2; /* x */ + start[1] = 5; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 4; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 4; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[2] -= 2; /* y */ + start[0] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 3; /* x */ - start[1] = 5; /* y */ - start[2] = 6; /* z */ + start[0] = 3; /* x */ + start[1] = 5; /* y */ + start[2] = 6; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 4; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 4; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[2] -= 2; /* y */ + start[0] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 5; /* x */ - start[1] = 5; /* y */ - start[2] = 3; /* z */ + start[0] = 5; /* x */ + start[1] = 5; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[2] -= 2; /* y */ + start[0] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -10131,101 +10127,101 @@ test_shape_same_dr__smoke_check_3(void) small_cube_yz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_yz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 8; /* x */ - start[1] = 2; /* y */ - start[2] = 3; /* z */ + start[0] = 8; /* x */ + start[1] = 2; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x -- large enough that there will only be one slice */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x -- large enough that there will only be one slice */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 4; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 4; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[1] -= 1; /* x */ - start[2] -= 2; /* y */ + start[1] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 8; /* x */ - start[1] = 3; /* y */ - start[2] = 6; /* z */ + start[0] = 8; /* x */ + start[1] = 3; /* y */ + start[2] = 6; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 4; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 4; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[1] -= 1; /* x */ - start[2] -= 2; /* y */ + start[1] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 8; /* x */ - start[1] = 5; /* y */ - start[2] = 3; /* z */ + start[0] = 8; /* x */ + start[1] = 5; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[1] -= 1; /* x */ - start[2] -= 2; /* y */ + start[1] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -10234,36 +10230,36 @@ test_shape_same_dr__smoke_check_3(void) /* setup is done -- run the tests: */ /* Compare against "xy" selection */ - check = H5S__select_shape_same_test(small_cube_xy_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xy_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xy_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "xz" selection */ - check = H5S__select_shape_same_test(small_cube_xz_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xz_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_xz_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "yz" selection */ - check = H5S__select_shape_same_test(small_cube_yz_slice_0_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_0_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_1_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_1_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(small_cube_yz_slice_2_sid, small_square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_2_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -10299,7 +10295,6 @@ test_shape_same_dr__smoke_check_3(void) ret = H5Sclose(small_cube_yz_slice_2_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__smoke_check_3() */ @@ -10307,79 +10302,79 @@ test_shape_same_dr__smoke_check_3(void) ** ** test_shape_same_dr__smoke_check_4(): ** -** Create a square, 2 D data space (10 X 10), and select -** the entire space. +** Create a square, 2-D dataspace (10 X 10), and select +** the entire space. ** -** Similarly, create 3 D and 4 D data spaces: +** Similarly, create 3-D and 4-D dataspaces: ** -** (1 X 10 X 10) -** (10 X 1 X 10) -** (10 X 10 X 1) -** (10 X 10 X 10) +** (1 X 10 X 10) +** (10 X 1 X 10) +** (10 X 10 X 1) +** (10 X 10 X 10) ** -** (1 X 1 X 10 X 10) -** (1 X 10 X 1 X 10) -** (1 X 10 X 10 X 1) -** (10 X 1 X 1 X 10) -** (10 X 1 X 10 X 1) -** (10 X 10 X 1 X 1) -** (10 X 1 X 10 X 10) +** (1 X 1 X 10 X 10) +** (1 X 10 X 1 X 10) +** (1 X 10 X 10 X 1) +** (10 X 1 X 1 X 10) +** (10 X 1 X 10 X 1) +** (10 X 10 X 1 X 1) +** (10 X 1 X 10 X 10) ** -** And select these entire spaces as well. +** And select these entire spaces as well. ** -** Compare the 2 D space against all the other spaces -** with H5S_select_shape_same(). The (1 X 10 X 10) & -** (1 X 1 X 10 X 10) should return TRUE. All others -** should return FALSE. +** Compare the 2-D space against all the other spaces +** with H5Sselect_shape_same(). The (1 X 10 X 10) & +** (1 X 1 X 10 X 10) should return TRUE. All others +** should return FALSE. ** ****************************************************************/ static void test_shape_same_dr__smoke_check_4(void) { - hid_t square_sid; - hid_t three_d_space_0_sid; - hid_t three_d_space_1_sid; - hid_t three_d_space_2_sid; - hid_t three_d_space_3_sid; - hid_t four_d_space_0_sid; - hid_t four_d_space_1_sid; - hid_t four_d_space_2_sid; - hid_t four_d_space_3_sid; - hid_t four_d_space_4_sid; - hid_t four_d_space_5_sid; - hid_t four_d_space_6_sid; - hsize_t dims[] = {10, 10, 10, 10}; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 4: Spaces of different dimension but same size.\n")); + hid_t square_sid; + hid_t three_d_space_0_sid; + hid_t three_d_space_1_sid; + hid_t three_d_space_2_sid; + hid_t three_d_space_3_sid; + hid_t four_d_space_0_sid; + hid_t four_d_space_1_sid; + hid_t four_d_space_2_sid; + hid_t four_d_space_3_sid; + hid_t four_d_space_4_sid; + hid_t four_d_space_5_sid; + hid_t four_d_space_6_sid; + hsize_t dims[] = {10, 10, 10, 10}; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 4: Spaces of different dimension but same size.\n")); /* Create the 10 x 10 dataspace */ square_sid = H5Screate_simple(2, dims, NULL); CHECK(square_sid, FAIL, "H5Screate_simple"); - /* create (1 X 10 X 10) data space */ + /* create (1 X 10 X 10) dataspace */ dims[0] = 1; dims[1] = 10; dims[2] = 10; three_d_space_0_sid = H5Screate_simple(3, dims, NULL); CHECK(three_d_space_0_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 10) data space */ + /* create (10 X 1 X 10) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 10; three_d_space_1_sid = H5Screate_simple(3, dims, NULL); CHECK(three_d_space_1_sid, FAIL, "H5Screate_simple"); - /* create (10 X 10 X 1) data space */ + /* create (10 X 10 X 1) dataspace */ dims[0] = 10; dims[1] = 10; dims[2] = 1; three_d_space_2_sid = H5Screate_simple(3, dims, NULL); CHECK(three_d_space_2_sid, FAIL, "H5Screate_simple"); - /* create (10 X 10 X 10) data space */ + /* create (10 X 10 X 10) dataspace */ dims[0] = 10; dims[1] = 10; dims[2] = 10; @@ -10387,7 +10382,7 @@ test_shape_same_dr__smoke_check_4(void) CHECK(three_d_space_3_sid, FAIL, "H5Screate_simple"); - /* create (1 X 1 X 10 X 10) data space */ + /* create (1 X 1 X 10 X 10) dataspace */ dims[0] = 1; dims[1] = 1; dims[2] = 10; @@ -10395,7 +10390,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_0_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_0_sid, FAIL, "H5Screate_simple"); - /* create (1 X 10 X 1 X 10) data space */ + /* create (1 X 10 X 1 X 10) dataspace */ dims[0] = 1; dims[1] = 10; dims[2] = 1; @@ -10403,7 +10398,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_1_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_1_sid, FAIL, "H5Screate_simple"); - /* create (1 X 10 X 10 X 1) data space */ + /* create (1 X 10 X 10 X 1) dataspace */ dims[0] = 1; dims[1] = 10; dims[2] = 10; @@ -10411,7 +10406,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_2_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_2_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 1 X 10) data space */ + /* create (10 X 1 X 1 X 10) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 1; @@ -10419,7 +10414,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_3_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_3_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 10 X 1) data space */ + /* create (10 X 1 X 10 X 1) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 10; @@ -10427,7 +10422,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_4_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_4_sid, FAIL, "H5Screate_simple"); - /* create (10 X 10 X 1 X 1) data space */ + /* create (10 X 10 X 1 X 1) dataspace */ dims[0] = 10; dims[1] = 10; dims[2] = 1; @@ -10435,7 +10430,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_5_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_5_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 10 X 10) data space */ + /* create (10 X 1 X 10 X 10) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 10; @@ -10446,39 +10441,39 @@ test_shape_same_dr__smoke_check_4(void) /* setup is done -- run the tests: */ - check = H5S__select_shape_same_test(three_d_space_0_sid, square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_0_sid, square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(three_d_space_1_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_1_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(three_d_space_2_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_2_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(three_d_space_3_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_3_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_0_sid, square_sid); - VERIFY(check, TRUE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_0_sid, square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_1_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_1_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_2_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_2_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_3_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_3_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_4_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_4_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_5_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_5_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S__select_shape_same_test(four_d_space_6_sid, square_sid); - VERIFY(check, FALSE, "H5S__select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_6_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -10519,21 +10514,20 @@ test_shape_same_dr__smoke_check_4(void) ret = H5Sclose(four_d_space_6_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__smoke_check_4() */ /**************************************************************** ** ** test_shape_same_dr__full_space_vs_slice(): Tests selection -** of a full n-cube data space vs an n-dimensional slice of -** of an m-cube (m > n) in a call to H5S_select_shape_same(). -** Note that this test does not require the n-cube and the -** n-dimensional slice to have the same rank (although -** H5S_select_shape_same() should always return FALSE if -** they don't). +** of a full n-cube dataspace vs an n-dimensional slice of +** of an m-cube (m > n) in a call to H5Sselect_shape_same(). +** Note that this test does not require the n-cube and the +** n-dimensional slice to have the same rank (although +** H5Sselect_shape_same() should always return FALSE if +** they don't). ** -** Per Quincey's suggestion, only test up to 5 dimensional -** spaces. +** Per Quincey's suggestion, only test up to 5 dimensional +** spaces. ** ****************************************************************/ static void @@ -10545,22 +10539,22 @@ test_shape_same_dr__full_space_vs_slice(int test_num, hbool_t dim_selected[], hbool_t expected_result) { - char test_desc_0[128]; - char test_desc_1[256]; + char test_desc_0[128]; + char test_desc_1[256]; int i; - hid_t n_cube_0_sid; /* the fully selected hyper cube */ - hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t start[SS_DR_MAX_RANK]; - hsize_t * start_ptr; - hsize_t stride[SS_DR_MAX_RANK]; - hsize_t * stride_ptr; - hsize_t count[SS_DR_MAX_RANK]; - hsize_t * count_ptr; - hsize_t block[SS_DR_MAX_RANK]; - hsize_t * block_ptr; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + hid_t n_cube_0_sid; /* the fully selected hyper cube */ + hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */ + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t start[SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t stride[SS_DR_MAX_RANK]; + hsize_t * stride_ptr; + hsize_t count[SS_DR_MAX_RANK]; + hsize_t * count_ptr; + hsize_t block[SS_DR_MAX_RANK]; + hsize_t * block_ptr; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ HDassert( 0 < small_rank ); HDassert( small_rank <= large_rank ); @@ -10570,13 +10564,13 @@ test_shape_same_dr__full_space_vs_slice(int test_num, HDassert( edge_size > 0 ); HDassert( edge_size <= 1000 ); - sprintf(test_desc_0, + HDsprintf(test_desc_0, "\tn-cube slice through m-cube (n <= m) test %d.\n", test_num); MESSAGE(7, (test_desc_0)); /* This statement must be updated if SS_DR_MAX_RANK is changed */ - sprintf(test_desc_1, + HDsprintf(test_desc_1, "\t\tranks: %d/%d offset: %d dim_selected: %d/%d/%d/%d/%d.\n", small_rank, large_rank, offset, (int)dim_selected[0], @@ -10634,15 +10628,15 @@ test_shape_same_dr__full_space_vs_slice(int test_num, block_ptr = &(block[i]); - /* select the hyper slab */ + /* select the hyperslab */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_SET, start_ptr, stride_ptr, count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* setup is done -- run the test: */ - check = H5S__select_shape_same_test(n_cube_0_sid, n_cube_1_sid); - VERIFY(check, expected_result, "test_shape_same_dr__full_space_vs_slice"); + check = H5Sselect_shape_same(n_cube_0_sid, n_cube_1_sid); + VERIFY(check, expected_result, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -10651,7 +10645,6 @@ test_shape_same_dr__full_space_vs_slice(int test_num, ret = H5Sclose(n_cube_1_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__full_space_vs_slice() */ @@ -10659,26 +10652,26 @@ test_shape_same_dr__full_space_vs_slice(int test_num, ** ** test_shape_same_dr__run_full_space_vs_slice_tests(): ** -** Run the est_shape_same_dr__full_space_vs_slice() test -** over a variety of ranks and offsets. +** Run the test_shape_same_dr__full_space_vs_slice() test +** over a variety of ranks and offsets. ** -** At present, we test H5S_select_shape_same() with -** fully selected 1, 2, 3, and 4 cubes as one parameter, and -** 1, 2, 3, and 4 dimensional slices through a n-cube of rank -** no more than 5 (and at least the rank of the slice). -** We stop at rank 5, as Quincey suggested that it would be -** sufficient. +** At present, we test H5Sselect_shape_same() with +** fully selected 1, 2, 3, and 4 cubes as one parameter, and +** 1, 2, 3, and 4 dimensional slices through a n-cube of rank +** no more than 5 (and at least the rank of the slice). +** We stop at rank 5, as Quincey suggested that it would be +** sufficient. ** -** All the n-cubes will have lengths of the same size, so -** H5S_select_shape_same() should return true iff: +** All the n-cubes will have lengths of the same size, so +** H5Sselect_shape_same() should return true iff: ** -** 1) the rank for the fully selected n cube equals the +** 1) the rank for the fully selected n cube equals the ** number of dimensions selected in the slice through the ** m-cube (m >= n). ** -** 2) The dimensions selected in the slice through the m-cube -** are the dimesnions with the most quickly changing -** indices. +** 2) The dimensions selected in the slice through the m-cube +** are the dimesnions with the most quickly changing +** indices. ** ****************************************************************/ static void @@ -10800,24 +10793,23 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void) } while((v < 2) && (large_rank >= 5)); } /* end for */ } /* end for */ - } /* test_shape_same_dr__run_full_space_vs_slice_tests() */ /**************************************************************** ** ** test_shape_same_dr__checkerboard(): Tests selection of a -** "checker board" subset of a full n-cube data space vs -** a "checker board" n-dimensional slice of an m-cube (m > n). -** in a call to H5S_select_shape_same(). +** "checker board" subset of a full n-cube dataspace vs +** a "checker board" n-dimensional slice of an m-cube (m > n). +** in a call to H5Sselect_shape_same(). ** -** Note that this test does not require the n-cube and the -** n-dimensional slice to have the same rank (although -** H5S_select_shape_same() should always return FALSE if -** they don't). +** Note that this test does not require the n-cube and the +** n-dimensional slice to have the same rank (although +** H5Sselect_shape_same() should always return FALSE if +** they don't). ** -** Per Quincey's suggestion, only test up to 5 dimensional -** spaces. +** Per Quincey's suggestion, only test up to 5 dimensional +** spaces. ** ****************************************************************/ static void @@ -10830,31 +10822,31 @@ test_shape_same_dr__checkerboard(int test_num, hbool_t dim_selected[], hbool_t expected_result) { - char test_desc_0[128]; - char test_desc_1[256]; + char test_desc_0[128]; + char test_desc_1[256]; int i; - int dims_selected = 0; - hid_t n_cube_0_sid; /* the checker board selected + int dims_selected = 0; + hid_t n_cube_0_sid; /* the checker board selected * hyper cube */ - hid_t n_cube_1_sid; /* the hyper cube in which a + hid_t n_cube_1_sid; /* the hyper cube in which a * checkerboard slice is selected */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t base_start[2]; - hsize_t start[SS_DR_MAX_RANK]; - hsize_t * start_ptr; - hsize_t base_stride[2]; - hsize_t stride[SS_DR_MAX_RANK]; - hsize_t * stride_ptr; - hsize_t base_count[2]; - hsize_t count[SS_DR_MAX_RANK]; - hsize_t * count_ptr; - hsize_t base_block[2]; - hsize_t block[SS_DR_MAX_RANK]; - hsize_t * block_ptr; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t base_start[2]; + hsize_t start[SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t base_stride[2]; + hsize_t stride[SS_DR_MAX_RANK]; + hsize_t * stride_ptr; + hsize_t base_count[2]; + hsize_t count[SS_DR_MAX_RANK]; + hsize_t * count_ptr; + hsize_t base_block[2]; + hsize_t block[SS_DR_MAX_RANK]; + hsize_t * block_ptr; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ HDassert( 0 < small_rank ); HDassert( small_rank <= large_rank ); @@ -10872,13 +10864,13 @@ test_shape_same_dr__checkerboard(int test_num, HDassert( dims_selected >= 0 ); HDassert( dims_selected <= large_rank ); - sprintf(test_desc_0, + HDsprintf(test_desc_0, "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n", test_num); MESSAGE(7, (test_desc_0)); /* This statement must be updated if SS_DR_MAX_RANK is changed */ - sprintf(test_desc_1, + HDsprintf(test_desc_1, "\tranks: %d/%d edge/chkr size: %d/%d offset: %d dim_selected: %d/%d/%d/%d/%d:%d.\n", small_rank, large_rank, (int)edge_size, (int)checker_size, @@ -10903,19 +10895,19 @@ test_shape_same_dr__checkerboard(int test_num, * * In the 1-D case, the "checkerboard" would look like this: * - * * * - - * * - - * * + * * * - - * * - - * * * * and in the 2-D case, it would look like this: * - * * * - - * * - - * * + * * * - - * * - - * * * * * - - * * - - * * * - - * * - - * * - - * - - * * - - * * - - - * * * - - * * - - * * + * * * - - * * - - * * * * * - - * * - - * * * - - * * - - * * - - * - - * * - - * * - - - * * * - - * * - - * * + * * * - - * * - - * * * * * - - * * - - * * * * In both cases, asterisks indicate selected elements, @@ -10931,15 +10923,15 @@ test_shape_same_dr__checkerboard(int test_num, * are not even divisors of the edge size -- thus * something like the following is also possible: * - * * * * - - - * * * - - * * * * - - - * * * - - * * * * - - - * * * - + * * * * - - - * * * - + * * * * - - - * * * - + * * * * - - - * * * - * - - - * * * - - - * * - - - * * * - - - * * - - - * * * - - - * - * * * * - - - * * * - - * * * * - - - * * * - - * * * * - - - * * * - + * * * * - - - * * * - + * * * * - - - * * * - + * * * * - - - * * * - * - - - * * * - - - * * * As the above pattern can't be selected in one @@ -10969,7 +10961,7 @@ test_shape_same_dr__checkerboard(int test_num, base_count[0] = edge_size / (checker_size * 2); if((edge_size % (checker_size * 2)) > 0) - base_count[0]++; + base_count[0]++; base_count[1] = (edge_size - checker_size) / (checker_size * 2); if(((edge_size - checker_size) % (checker_size * 2)) > 0) @@ -11016,8 +11008,8 @@ test_shape_same_dr__checkerboard(int test_num, /* Wierdness alert: * * Some how, it seems that selections can extend beyond the - * boundaries of the target data space -- hence the following - * code to manually clip the selection back to the data space + * boundaries of the target dataspace -- hence the following + * code to manually clip the selection back to the dataspace * proper. */ for(i = 0; i < SS_DR_MAX_RANK; i++) { @@ -11078,7 +11070,7 @@ test_shape_same_dr__checkerboard(int test_num, count_ptr = &(count[i]); block_ptr = &(block[i]); - /* select the hyper slab */ + /* select the hyperslab */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_SET, start_ptr, stride_ptr, count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -11117,8 +11109,8 @@ test_shape_same_dr__checkerboard(int test_num, /* Wierdness alert: * * Again, it seems that selections can extend beyond the - * boundaries of the target data space -- hence the following - * code to manually clip the selection back to the data space + * boundaries of the target dataspace -- hence the following + * code to manually clip the selection back to the dataspace * proper. */ for(i = 0; i < SS_DR_MAX_RANK; i++) { @@ -11133,8 +11125,8 @@ test_shape_same_dr__checkerboard(int test_num, CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* setup is done -- run the test: */ - check = H5S__select_shape_same_test(n_cube_0_sid, n_cube_1_sid); - VERIFY(check, expected_result, "test_shape_same_dr__checkerboard"); + check = H5Sselect_shape_same(n_cube_0_sid, n_cube_1_sid); + VERIFY(check, expected_result, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -11143,7 +11135,6 @@ test_shape_same_dr__checkerboard(int test_num, ret = H5Sclose(n_cube_1_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__checkerboard() */ @@ -11151,14 +11142,14 @@ test_shape_same_dr__checkerboard(int test_num, ** ** test_shape_same_dr__run_checkerboard_tests(): ** -** In this set of tests, we test H5S_select_shape_same() +** In this set of tests, we test H5Sselect_shape_same() ** with a "checkerboard" selection of 1, 2, 3, and 4 cubes as ** one parameter, and 1, 2, 3, and 4 dimensional checkerboard ** slices through a n-cube of rank no more than 5 (and at ** least the rank of the slice). ** ** All the n-cubes will have lengths of the same size, so -** H5S_select_shape_same() should return true iff: +** H5Sselect_shape_same() should return true iff: ** ** 1) the rank of the n cube equals the number of dimensions ** selected in the checker board slice through the m-cube @@ -11414,7 +11405,6 @@ test_shape_same_dr__run_checkerboard_tests(void) } while((v < 2) && (large_rank >= 5)); } /* end for */ } /* end for */ - } /* test_shape_same_dr__run_checkerboard_tests() */ @@ -11422,15 +11412,15 @@ test_shape_same_dr__run_checkerboard_tests(void) ** ** test_shape_same_dr__irregular(): ** -** Tests selection of an "irregular" subset of a full -** n-cube data space vs an identical "irregular" subset -** of an n-dimensional slice of an m-cube (m > n). -** in a call to H5S_select_shape_same(). +** Tests selection of an "irregular" subset of a full +** n-cube dataspace vs an identical "irregular" subset +** of an n-dimensional slice of an m-cube (m > n). +** in a call to H5Sselect_shape_same(). ** -** Note that this test does not require the n-cube and the -** n-dimensional slice to have the same rank (although -** H5S_select_shape_same() should always return FALSE if -** they don't). +** Note that this test does not require the n-cube and the +** n-dimensional slice to have the same rank (although +** H5Sselect_shape_same() should always return FALSE if +** they don't). ** ****************************************************************/ static void @@ -11442,71 +11432,71 @@ test_shape_same_dr__irregular(int test_num, hbool_t dim_selected[], hbool_t expected_result) { - char test_desc_0[128]; - char test_desc_1[256]; - int edge_size = 10; + char test_desc_0[128]; + char test_desc_1[256]; + int edge_size = 10; int i; int j; int k; - int dims_selected = 0; - hid_t n_cube_0_sid; /* the hyper cube containing + int dims_selected = 0; + hid_t n_cube_0_sid; /* the hyper cube containing * an irregular selection */ - hid_t n_cube_1_sid; /* the hyper cube in which a + hid_t n_cube_1_sid; /* the hyper cube in which a * slice contains an irregular * selection. */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t start_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 5}; - hsize_t stride_0[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_0[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t start_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 5}; + hsize_t stride_0[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_0[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 3}; - hsize_t start_1[SS_DR_MAX_RANK] = { 2, 2, 2, 5, 2}; - hsize_t stride_1[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_1[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_1[SS_DR_MAX_RANK] = { 2, 2, 2, 5, 2}; + hsize_t stride_1[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_1[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_1[SS_DR_MAX_RANK] = { 2, 2, 2, 3, 2}; - hsize_t start_2[SS_DR_MAX_RANK] = { 2, 2, 5, 2, 2}; - hsize_t stride_2[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_2[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_2[SS_DR_MAX_RANK] = { 2, 2, 5, 2, 2}; + hsize_t stride_2[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_2[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_2[SS_DR_MAX_RANK] = { 2, 2, 3, 2, 2}; - hsize_t start_3[SS_DR_MAX_RANK] = { 2, 5, 2, 2, 2}; - hsize_t stride_3[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_3[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_3[SS_DR_MAX_RANK] = { 2, 5, 2, 2, 2}; + hsize_t stride_3[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_3[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_3[SS_DR_MAX_RANK] = { 2, 3, 2, 2, 2}; - hsize_t start_4[SS_DR_MAX_RANK] = { 5, 2, 2, 2, 2}; - hsize_t stride_4[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_4[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_4[SS_DR_MAX_RANK] = { 5, 2, 2, 2, 2}; + hsize_t stride_4[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_4[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_4[SS_DR_MAX_RANK] = { 3, 2, 2, 2, 2}; - hsize_t clip_start[SS_DR_MAX_RANK] = { 0, 0, 0, 0, 0}; - hsize_t clip_stride[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t clip_count[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t clip_start[SS_DR_MAX_RANK] = { 0, 0, 0, 0, 0}; + hsize_t clip_stride[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t clip_count[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t clip_block[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t *(starts[SS_DR_MAX_RANK]) = - {start_0, start_1, start_2, start_3, start_4}; + hsize_t *(starts[SS_DR_MAX_RANK]) = + {start_0, start_1, start_2, start_3, start_4}; hsize_t *(strides[SS_DR_MAX_RANK]) = - {stride_0, stride_1, stride_2, stride_3, stride_4}; + {stride_0, stride_1, stride_2, stride_3, stride_4}; hsize_t *(counts[SS_DR_MAX_RANK]) = - {count_0, count_1, count_2, count_3, count_4}; + {count_0, count_1, count_2, count_3, count_4}; hsize_t *(blocks[SS_DR_MAX_RANK]) = - {block_0, block_1, block_2, block_3, block_4}; - - hsize_t start[SS_DR_MAX_RANK]; - hsize_t * start_ptr; - hsize_t stride[SS_DR_MAX_RANK]; - hsize_t * stride_ptr; - hsize_t count[SS_DR_MAX_RANK]; - hsize_t * count_ptr; - hsize_t block[SS_DR_MAX_RANK]; - hsize_t * block_ptr; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + {block_0, block_1, block_2, block_3, block_4}; + + hsize_t start[SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t stride[SS_DR_MAX_RANK]; + hsize_t * stride_ptr; + hsize_t count[SS_DR_MAX_RANK]; + hsize_t * count_ptr; + hsize_t block[SS_DR_MAX_RANK]; + hsize_t * block_ptr; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ HDassert( 0 < small_rank ); HDassert( small_rank <= large_rank ); @@ -11525,13 +11515,13 @@ test_shape_same_dr__irregular(int test_num, HDassert( dims_selected >= 0 ); HDassert( dims_selected <= large_rank ); - sprintf(test_desc_0, + HDsprintf(test_desc_0, "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n", test_num); MESSAGE(7, (test_desc_0)); /* This statement must be updated if SS_DR_MAX_RANK is changed */ - sprintf(test_desc_1, + HDsprintf(test_desc_1, "\tranks: %d/%d edge: %d s/p offset: %d/%d dim_selected: %d/%d/%d/%d/%d:%d.\n", small_rank, large_rank, edge_size, @@ -11563,23 +11553,23 @@ test_shape_same_dr__irregular(int test_num, * In the 1-D case, the projection of the pattern looks * like this: * - * - - * * - * * * - - + * - - * * - * * * - - * 0 1 2 3 4 5 6 7 8 9 x * * and in the 2-D case, it would look like this: * * - * y - * 9 - - - - - - - - - - - * 8 - - - - - - - - - - - * 7 - - * * - - - - - - - * 6 - - * * - - - - - - - * 5 - - * * - - - - - - - * 4 - - - - - - - - - - - * 3 - - * * - * * * - - - * 2 - - * * - * * * - - - * 1 - - - - - - - - - - - * 0 - - - - - - - - - - + * y + * 9 - - - - - - - - - - + * 8 - - - - - - - - - - + * 7 - - * * - - - - - - + * 6 - - * * - - - - - - + * 5 - - * * - - - - - - + * 4 - - - - - - - - - - + * 3 - - * * - * * * - - + * 2 - - * * - * * * - - + * 1 - - - - - - - - - - + * 0 - - - - - - - - - - * 0 1 2 3 4 5 6 7 8 9 x * * In both cases, asterisks indicate selected elements, @@ -11588,7 +11578,7 @@ test_shape_same_dr__irregular(int test_num, * Note that is this case, since the edge size is fixed, * the pattern does not change. However, we do use the * displacement parameter to allow it to be moved around - * within the n-cube or hyper slab. + * within the n-cube or hyperslab. */ /* first, ensure that the small n-cube has no selection */ @@ -11664,13 +11654,13 @@ test_shape_same_dr__irregular(int test_num, } /* end else */ } /* end for */ - /* select the hyper slab */ + /* select the hyperslab */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_OR, start_ptr, stride_ptr, count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ - /* it is possible that the selection extends beyond the data space. + /* it is possible that the selection extends beyond the dataspace. * clip the selection to ensure that it doesn't. */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_AND, @@ -11679,8 +11669,8 @@ test_shape_same_dr__irregular(int test_num, /* setup is done -- run the test: */ - check = H5S__select_shape_same_test(n_cube_0_sid, n_cube_1_sid); - VERIFY(check, expected_result, "test_shape_same_dr__checkerboard"); + check = H5Sselect_shape_same(n_cube_0_sid, n_cube_1_sid); + VERIFY(check, expected_result, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -11689,7 +11679,6 @@ test_shape_same_dr__irregular(int test_num, ret = H5Sclose(n_cube_1_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__irregular() */ @@ -11697,16 +11686,16 @@ test_shape_same_dr__irregular(int test_num, ** ** test_shape_same_dr__run_irregular_tests(): ** -** In this set of tests, we test H5S_select_shape_same() +** In this set of tests, we test H5Sselect_shape_same() ** with an "irregular" subselection of 1, 2, 3, and 4 cubes as ** one parameter, and irregular subselections of 1, 2, 3, ** and 4 dimensional slices through a n-cube of rank no more ** than 5 (and at least the rank of the slice) as the other. ** Note that the "irregular" selection may be offset between -** the n-cube and the slice. +** the n-cube and the slice. ** ** All the irregular selections will be identical (modulo rank) -** so H5S_select_shape_same() should return true iff: +** so H5Sselect_shape_same() should return true iff: ** ** 1) the rank of the n cube equals the number of dimensions ** selected in the irregular slice through the m-cube @@ -11904,7 +11893,6 @@ test_shape_same_dr__run_irregular_tests(void) } while((v < 2 ) && (large_rank >= 5)); } /* end for */ } /* end for */ - } /* test_shape_same_dr__run_irregular_tests() */ @@ -11912,7 +11900,7 @@ test_shape_same_dr__run_irregular_tests(void) ** ** test_shape_same_dr(): Tests selections on dataspace with ** different ranks, to verify that "shape same" routine -** is now handling this case correctly. +** is now handling this case correctly. ** ****************************************************************/ static void @@ -11921,19 +11909,16 @@ test_shape_same_dr(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape/Different Rank Comparisons\n")); - /* first run some smoke checks */ test_shape_same_dr__smoke_check_1(); test_shape_same_dr__smoke_check_2(); test_shape_same_dr__smoke_check_3(); test_shape_same_dr__smoke_check_4(); - /* now run more intensive tests. */ test_shape_same_dr__run_full_space_vs_slice_tests(); test_shape_same_dr__run_checkerboard_tests(); test_shape_same_dr__run_irregular_tests(); - } /* test_shape_same_dr() */ @@ -12042,8 +12027,8 @@ test_space_rebuild(void) } /* end if */ if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S__select_shape_same_test(sid_reg1,sid_reg_ori1); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg1, sid_reg_ori1); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* end if */ /* For irregular hyperslab */ @@ -12130,8 +12115,8 @@ test_space_rebuild(void) } /* end if */ if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S__select_shape_same_test(sid_reg2,sid_reg_ori2); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg2, sid_reg_ori2); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* end if */ /* 2-D irregular case */ @@ -12228,8 +12213,8 @@ test_space_rebuild(void) } /* end if */ if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S__select_shape_same_test(sid_reg3,sid_reg_ori3); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg3, sid_reg_ori3); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* end if */ sid_irreg3 = H5Screate_simple(SPACERE3_RANK,dims3,NULL); @@ -12339,8 +12324,8 @@ test_space_rebuild(void) } /* end if */ if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S__select_shape_same_test(sid_reg4,sid_reg_ori4); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg4, sid_reg_ori4); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* end if */ /* Testing irregular selection */ @@ -12465,8 +12450,8 @@ test_space_rebuild(void) } /* end if */ if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S__select_shape_same_test(sid_reg5,sid_reg_ori5); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg5, sid_reg_ori5); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* end if */ sid_irreg5 = H5Screate_simple(SPACERE5_RANK,dims5,NULL); @@ -12659,7 +12644,7 @@ test_space_rebuild(void) CHECK(ret, FAIL, "H5Sclose"); } - + /**************************************************************** ** ** test_space_update_diminfo(): Tests selection diminfo update @@ -13444,7 +13429,7 @@ test_space_update_diminfo(void) CHECK(ret, FAIL, "H5Sclose"); } /* end test_space_update_diminfo() */ - + /**************************************************************** ** ** test_select_hyper_chunk_offset(): Tests selections on dataspace, @@ -14565,33 +14550,33 @@ test_hyper_unlim(void) static void test_internal_consistency(void) { - hid_t all_sid; /* Dataspace ID with "all" selection */ - hid_t none_sid; /* Dataspace ID with "none" selection */ - hid_t single_pt_sid; /* Dataspace ID with single point selection */ - hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ - hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ - hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab + hid_t all_sid; /* Dataspace ID with "all" selection */ + hid_t none_sid; /* Dataspace ID with "none" selection */ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab * selection that is the entire dataspace */ - hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab + hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab * selection that is the same as the single * point selection */ - hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ - hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ - hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ - hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ - hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ - hid_t tmp_sid; /* Temporary dataspace ID */ - hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; - hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ - hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ + hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ + hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ + hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ + hid_t tmp_sid; /* Temporary dataspace ID */ + hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; + hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ + hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ hsize_t start[SPACE9_RANK]; /* Hyperslab start */ hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */ hsize_t count[SPACE9_RANK]; /* Hyperslab block count */ hsize_t block[SPACE9_RANK]; /* Hyperslab block size */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Consistency of Internal States\n")); @@ -14736,59 +14721,59 @@ test_internal_consistency(void) /* Test all the selections created */ - /* Test the copy of itself */ - tmp_sid=H5Scopy(all_sid); - CHECK(tmp_sid, FAIL, "H5Scopy"); + /* Test the copy of itself */ + tmp_sid=H5Scopy(all_sid); + CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S__internal_consistency_test(tmp_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + check = H5S__internal_consistency_test(tmp_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - ret = H5Sclose(tmp_sid); - CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(tmp_sid); + CHECK(ret, FAIL, "H5Sclose"); - /* Test "none" selection */ - check = H5S__internal_consistency_test(none_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test "none" selection */ + check = H5S__internal_consistency_test(none_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test single point selection */ - check = H5S__internal_consistency_test(single_pt_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test single point selection */ + check = H5S__internal_consistency_test(single_pt_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test multiple point selection */ - check = H5S__internal_consistency_test(mult_pt_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test multiple point selection */ + check = H5S__internal_consistency_test(mult_pt_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test "plain" single hyperslab selection */ - check = H5S__internal_consistency_test(single_hyper_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test "plain" single hyperslab selection */ + check = H5S__internal_consistency_test(single_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test "all" single hyperslab selection */ - check = H5S__internal_consistency_test(single_hyper_all_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test "all" single hyperslab selection */ + check = H5S__internal_consistency_test(single_hyper_all_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test "single point" single hyperslab selection */ - check = H5S__internal_consistency_test(single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test "single point" single hyperslab selection */ + check = H5S__internal_consistency_test(single_hyper_pt_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test regular, strided hyperslab selection */ - check = H5S__internal_consistency_test(regular_hyper_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test regular, strided hyperslab selection */ + check = H5S__internal_consistency_test(regular_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test irregular hyperslab selection */ - check = H5S__internal_consistency_test(irreg_hyper_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test irregular hyperslab selection */ + check = H5S__internal_consistency_test(irreg_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test "no" hyperslab selection */ - check = H5S__internal_consistency_test(none_hyper_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test "no" hyperslab selection */ + check = H5S__internal_consistency_test(none_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test scalar "all" hyperslab selection */ - check = H5S__internal_consistency_test(scalar_all_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test scalar "all" hyperslab selection */ + check = H5S__internal_consistency_test(scalar_all_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); - /* Test scalar "none" hyperslab selection */ - check = H5S__internal_consistency_test(scalar_none_sid); - VERIFY(check, TRUE, "H5S__internal_consistency_test"); + /* Test scalar "none" hyperslab selection */ + check = H5S__internal_consistency_test(scalar_none_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); /* Close dataspaces */ ret = H5Sclose(all_sid); @@ -14831,9 +14816,9 @@ test_irreg_io(void) hid_t dcpl_id; /* Dataset creation property list ID */ hid_t sid; /* File dataspace ID */ hid_t mem_sid; /* Memory dataspace ID */ - hsize_t dims[] = {6, 12}; /* Dataspace dimensions */ - hsize_t chunk_dims[] = {2, 2}; /* Chunk dimensions */ - hsize_t mem_dims[] = {32}; /* Memory dataspace dimensions */ + hsize_t dims[] = {6, 12}; /* Dataspace dimensions */ + hsize_t chunk_dims[] = {2, 2}; /* Chunk dimensions */ + hsize_t mem_dims[] = {32}; /* Memory dataspace dimensions */ hsize_t start[2]; /* Hyperslab start */ hsize_t stride[2]; /* Hyperslab stride */ hsize_t count[2]; /* Hyperslab block count */ @@ -14841,7 +14826,7 @@ test_irreg_io(void) unsigned char wbuf[72]; /* Write buffer */ unsigned char rbuf[32]; /* Read buffer */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Irregular Hyperslab I/O\n")); @@ -14924,8 +14909,8 @@ test_sel_iter(void) { hid_t sid; /* Dataspace ID */ hid_t iter_id; /* Dataspace selection iterator ID */ - hsize_t dims1[] = {6, 12}; /* 2-D Dataspace dimensions */ - hsize_t coord1[POINT1_NPOINTS][2]; /* Coordinates for point selection */ + hsize_t dims1[] = {6, 12}; /* 2-D Dataspace dimensions */ + hsize_t coord1[POINT1_NPOINTS][2]; /* Coordinates for point selection */ hsize_t start[2]; /* Hyperslab start */ hsize_t stride[2]; /* Hyperslab stride */ hsize_t count[2]; /* Hyperslab block count */ @@ -14937,7 +14922,7 @@ test_sel_iter(void) H5S_sel_type sel_type; /* Selection type */ unsigned sel_share; /* Whether to share selection with dataspace */ unsigned sel_iter_flags; /* Flags for selection iterator creation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Dataspace Selection Iterators\n")); @@ -15189,7 +15174,149 @@ test_sel_iter(void) CHECK(ret, FAIL, "H5Sclose"); } /* test_sel_iter() */ - +/**************************************************************** +** +** test_select_intersect_block(): Test selections on dataspace, +** verify that "intersect block" routine is working correctly. +** +****************************************************************/ +static void +test_select_intersect_block(void) +{ + hid_t sid; /* Dataspace ID */ + hsize_t dims1[] = {6, 12}; /* 2-D Dataspace dimensions */ + hsize_t block_start[] = {1, 3}; /* Start offset for block */ + hsize_t block_end[] = {2, 5}; /* End offset for block */ + hsize_t block_end2[] = {0, 5}; /* Bad end offset for block */ + hsize_t block_end3[] = {2, 2}; /* Another bad end offset for block */ + hsize_t block_end4[] = {1, 3}; /* End offset that makes a single element block */ + hsize_t coord[10][2]; /* Coordinates for point selection */ + hsize_t start[2]; /* Starting location of hyperslab */ + hsize_t stride[2]; /* Stride of hyperslab */ + hsize_t count[2]; /* Element count of hyperslab */ + hsize_t block[2]; /* Block size of hyperslab */ + htri_t status; /* Intersection status */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing Dataspace Selection Block Intersection\n")); + + /* Create dataspace */ + sid = H5Screate_simple(2, dims1, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + + /* Try intersection calls with bad parameters */ + H5E_BEGIN_TRY { /* Bad dataspace ID */ + status = H5Sselect_intersect_block(H5I_INVALID_HID, block_start, block_end); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Bad start pointer */ + status = H5Sselect_intersect_block(sid, NULL, block_end); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Bad end pointer */ + status = H5Sselect_intersect_block(sid, block_start, NULL); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Invalid block */ + status = H5Sselect_intersect_block(sid, block_start, block_end2); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Another invalid block */ + status = H5Sselect_intersect_block(sid, block_start, block_end3); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + + + /* Set selection to 'none' */ + ret = H5Sselect_none(sid); + CHECK(ret, FAIL, "H5Sselect_none"); + + /* Test block intersection with 'none' selection (always false) */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + + /* Set selection to 'all' */ + ret = H5Sselect_all(sid); + CHECK(ret, FAIL, "H5Sselect_all"); + + /* Test block intersection with 'all' selection (always true) */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + + + /* Select sequence of ten points */ + coord[0][0] = 0; coord[0][1] = 10; + coord[1][0] = 1; coord[1][1] = 2; + coord[2][0] = 2; coord[2][1] = 4; + coord[3][0] = 0; coord[3][1] = 6; + coord[4][0] = 1; coord[4][1] = 8; + coord[5][0] = 2; coord[5][1] = 11; + coord[6][0] = 0; coord[6][1] = 4; + coord[7][0] = 1; coord[7][1] = 0; + coord[8][0] = 2; coord[8][1] = 1; + coord[9][0] = 0; coord[9][1] = 3; + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)10, (const hsize_t *)coord); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Test block intersection with 'point' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + + /* Select single 4x6 hyperslab block at (2,1) */ + start[0] = 2; start[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 4; count[1] = 6; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Test block intersection with single 'hyperslab' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + /* 'OR' another hyperslab block in, making an irregular hyperslab selection */ + start[0] = 3; start[1] = 2; + stride[0] = 1; stride[1] = 1; + count[0] = 4; count[1] = 6; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Test block intersection with 'hyperslab' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + /* Select regular, strided hyperslab selection */ + start[0] = 2; start[1] = 1; + stride[0] = 2; stride[1] = 2; + count[0] = 2; count[1] = 4; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Test block intersection with single 'hyperslab' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + + /* Close dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_select_intersect_block() */ + + /**************************************************************** ** ** test_select(): Main H5S selection testing routine. @@ -15205,7 +15332,7 @@ test_select(void) size_t rdcc_nbytes; /* Raw data number of bytes */ double rdcc_w0; /* Raw data write percentage */ hssize_t offset[SPACE7_RANK] = {1, 1}; /* Offset for testing selection offsets */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Selections\n")); @@ -15369,21 +15496,22 @@ test_select(void) /* Test selection iterators */ test_sel_iter(); + + /* Test selection intersection with block */ + test_select_intersect_block(); } /* test_select() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_select + * Function: cleanup_select * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/test/tsohm.c b/test/tsohm.c index 9216b3e..a064940 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -3730,8 +3730,7 @@ test_sohm_external_dtype(void) ret = H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); CHECK_I(ret, "H5Tinsert"); - /* Set up dataset in first file - */ + /* Set up dataset in first file */ file1 = H5Fcreate(FILENAME_SRC, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT); CHECK_I(file1, "H5Fcreate"); @@ -3767,8 +3766,7 @@ test_sohm_external_dtype(void) ret = H5Dclose(dataset1); CHECK_I(ret, "H5Dclose"); - /* Create dataset in second file using datatype from dataset in the first file - */ + /* Create dataset in second file using datatype from dataset in the first file */ file2 = H5Fcreate(FILENAME_DST, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT); CHECK_I(file2, "H5Fcreate"); @@ -3797,8 +3795,7 @@ test_sohm_external_dtype(void) ret = H5Fclose(file1); CHECK_I(ret, "H5Fclose"); - /* Verify that datatype details are still accessible by second file - */ + /* Verify that datatype details are still accessible by second file */ dataset2 = H5Dopen2(file2, "dataset_2", H5P_DEFAULT); CHECK_I(dataset2, "H5Dopen2"); @@ -3808,8 +3805,7 @@ test_sohm_external_dtype(void) dtype_class = H5Tget_class(dset2_tid); VERIFY(dtype_class, H5T_COMPOUND, "H5Tget_class"); - /* Cleanup - */ + /* Cleanup */ ret = H5Tclose(dset2_tid); CHECK_I(ret, "H5Tclose"); ret = H5Dclose(dataset2); diff --git a/test/tunicode.c b/test/tunicode.c index 255dc50..b3fa237 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -774,15 +774,15 @@ void dump_string(const char * string) size_t length; size_t x; - printf("The string was:\n %s", string); - printf("Or in hex:\n"); + HDprintf("The string was:\n %s", string); + HDprintf("Or in hex:\n"); length = HDstrlen(string); for(x=0; x<length; x++) - printf("%x ", string[x] & (0x000000FF)); + HDprintf("%x ", string[x] & (0x000000FF)); - printf("\n"); + HDprintf("\n"); } /* Main test. diff --git a/test/twriteorder.c b/test/twriteorder.c index 60ee384..b104b72 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -134,7 +134,7 @@ parse_option(int argc, char * const argv[]) switch (c) { case 'h': usage(progname_g); - HDexit(0); + HDexit(EXIT_SUCCESS); break; case 'b': /* number of planes to write/read */ if ((blocksize_g = atoi(optarg)) <= 0) { @@ -407,12 +407,12 @@ main(int argc, char *argv[]) HDprintf("%d: launch reader process\n", mypid); if (read_wo_file() < 0) { HDfprintf(stderr, "read_wo_file encountered error\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Reader is done. Clean up by removing the data file */ HDremove(DATAFILE); - HDexit(0); + HDexit(EXIT_SUCCESS); } } diff --git a/test/unlink.c b/test/unlink.c index 2a7bbcd..6825dec 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -15,16 +15,16 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Friday, September 25, 1998 * - * Purpose: Test unlinking operations. + * Purpose: Test unlinking operations. */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5G_TESTING #include "h5test.h" -#include "H5Gpkg.h" /* Groups */ +#include "H5Gpkg.h" /* Groups */ const char *FILENAME[] = { "unlink", @@ -77,18 +77,18 @@ const char *FILENAME[] = { #define FULL_GROUP_EST_NUM_ENTRIES 8 #define FULL_GROUP_EST_ENTRY_LEN 9 - + /*------------------------------------------------------------------------- - * Function: test_one + * Function: test_one * - * Purpose: Creates a group that has just one entry and then unlinks that - * entry. + * Purpose: Creates a group that has just one entry and then unlinks that + * entry. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * * Modifications: @@ -98,8 +98,8 @@ const char *FILENAME[] = { static int test_one(hid_t file) { - hid_t work = -1, grp = -1; - herr_t status; + hid_t work = -1, grp = -1; + herr_t status; /* Create a test group */ if((work = H5Gcreate2(file, "/test_one", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -122,10 +122,10 @@ test_one(hid_t file) TESTING("unlink without a name"); if((grp = H5Gcreate2(work, "foo", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { - status = H5Ldelete(grp, ".", H5P_DEFAULT); + status = H5Ldelete(grp, ".", H5P_DEFAULT); } H5E_END_TRY; if(status>=0) - FAIL_PUTS_ERROR(" Unlinking object w/o a name should have failed.") + FAIL_PUTS_ERROR(" Unlinking object w/o a name should have failed.") if(H5Gclose(grp) < 0) FAIL_STACK_ERROR /* Cleanup */ @@ -136,23 +136,23 @@ test_one(hid_t file) error: H5E_BEGIN_TRY { - H5Gclose(work); - H5Gclose(grp); + H5Gclose(work); + H5Gclose(grp); } H5E_END_TRY; return 1; } /* end test_one() */ - + /*------------------------------------------------------------------------- - * Function: test_many + * Function: test_many * - * Purpose: Tests many unlinks in a single directory. + * Purpose: Tests many unlinks in a single directory. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * * Modifications: @@ -162,10 +162,10 @@ test_one(hid_t file) static int test_many(hid_t file) { - hid_t work=-1, grp=-1; - int i; - const int how_many=500; - char name[32]; + hid_t work=-1, grp=-1; + int i; + const int how_many=500; + char name[32]; /* Create a test group */ if((work = H5Gcreate2(file, "/test_many", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; @@ -175,54 +175,54 @@ test_many(hid_t file) /* Create a bunch of names and unlink them in order */ TESTING("forward unlink"); for(i = 0; i < how_many; i++) { - sprintf(name, "obj_%05d", i); - if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + HDsprintf(name, "obj_%05d", i); + if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ for(i = 0; i < how_many; i++) { - sprintf(name, "obj_%05d", i); - if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + HDsprintf(name, "obj_%05d", i); + if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ PASSED(); /* Create a bunch of names and unlink them in reverse order */ TESTING("backward unlink"); for(i = 0; i < how_many; i++) { - sprintf(name, "obj_%05d", i); - if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + HDsprintf(name, "obj_%05d", i); + if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ for(i = (how_many - 1); i >= 0; --i) { - sprintf(name, "obj_%05d", i); - if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + HDsprintf(name, "obj_%05d", i); + if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ PASSED(); /* Create a bunch of names and unlink them from both directions */ TESTING("inward unlink"); for(i = 0; i < how_many; i++) { - sprintf(name, "obj_%05d", i); - if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + HDsprintf(name, "obj_%05d", i); + if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ for(i = 0; i < how_many; i++) { - if(i % 2) - sprintf(name, "obj_%05d", how_many - (1 + i / 2)); - else - sprintf(name, "obj_%05d", i / 2); - if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if(i % 2) + HDsprintf(name, "obj_%05d", how_many - (1 + i / 2)); + else + HDsprintf(name, "obj_%05d", i / 2); + if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ PASSED(); /* Create a bunch of names and unlink them from the midle */ TESTING("outward unlink"); for(i = 0; i < how_many; i++) { - sprintf(name, "obj_%05d", i); - if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + HDsprintf(name, "obj_%05d", i); + if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ for(i = (how_many - 1); i >= 0; --i) { - if(i % 2) - sprintf(name, "obj_%05d", how_many - (1 + i / 2)); - else - sprintf(name, "obj_%05d", i / 2); - if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if(i % 2) + HDsprintf(name, "obj_%05d", how_many - (1 + i / 2)); + else + HDsprintf(name, "obj_%05d", i / 2); + if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ PASSED(); @@ -233,23 +233,23 @@ test_many(hid_t file) error: H5E_BEGIN_TRY { - H5Gclose(work); - H5Gclose(grp); + H5Gclose(work); + H5Gclose(grp); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- - * Function: test_symlink + * Function: test_symlink * - * Purpose: Tests removal of symbolic links. + * Purpose: Tests removal of symbolic links. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * *------------------------------------------------------------------------- @@ -257,7 +257,7 @@ test_many(hid_t file) static int test_symlink(hid_t file) { - hid_t work=-1; + hid_t work=-1; TESTING("symlink removal"); @@ -274,22 +274,22 @@ test_symlink(hid_t file) error: H5E_BEGIN_TRY { - H5Gclose(work); + H5Gclose(work); } H5E_END_TRY; return 1; } /* end test_symlink() */ - + /*------------------------------------------------------------------------- - * Function: test_rename + * Function: test_rename * - * Purpose: Tests H5Lmove() + * Purpose: Tests H5Lmove() * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * * Modifications: @@ -299,7 +299,7 @@ error: static int test_rename(hid_t file) { - hid_t work=-1, foo=-1, inner=-1; + hid_t work=-1, foo=-1, inner=-1; /* Create a test group and rename something */ TESTING("object renaming"); @@ -326,14 +326,14 @@ test_rename(hid_t file) error: H5E_BEGIN_TRY { - H5Gclose(work); - H5Gclose(foo); - H5Gclose(inner); + H5Gclose(work); + H5Gclose(foo); + H5Gclose(inner); } H5E_END_TRY; return 1; } /* end test_rename() */ - + /*------------------------------------------------------------------------- * Function: test_new_move * @@ -353,9 +353,9 @@ error: static int test_new_move(hid_t fapl) { - hid_t file_a, file_b=(-1); - hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1); - char filename[1024]; + hid_t file_a, file_b=(-1); + hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1); + char filename[1024]; TESTING("new move"); @@ -403,17 +403,17 @@ test_new_move(hid_t fapl) error: H5E_BEGIN_TRY { - H5Gclose(grp_1); - H5Gclose(grp_2); - H5Gclose(grp_move); + H5Gclose(grp_1); + H5Gclose(grp_2); + H5Gclose(grp_move); H5Gclose(moved_grp); - H5Fclose(file_a); - H5Fclose(file_b); + H5Fclose(file_a); + H5Fclose(file_b); } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: check_new_move * @@ -433,10 +433,10 @@ test_new_move(hid_t fapl) static int check_new_move(hid_t fapl) { - hid_t file; - H5O_info_t oi_hard1, oi_hard2; - char filename[1024]; - char linkval[1024]; + hid_t file; + H5O_info_t oi_hard1, oi_hard2; + char filename[1024]; + char linkval[1024]; TESTING("check new move function"); @@ -473,7 +473,7 @@ error: return 1; } /* end check_new_move() */ - + /*------------------------------------------------------------------------- * Function: test_filespace * @@ -492,21 +492,21 @@ error: static int test_filespace(hid_t fapl) { - hid_t fapl_nocache; /* File access property list with raw data cache turned off */ - hid_t contig_dcpl; /* Dataset creation property list for contiguous dataset */ - hid_t early_chunk_dcpl; /* Dataset creation property list for chunked dataset & early allocation */ - hid_t late_chunk_dcpl; /* Dataset creation property list for chunked dataset & late allocation */ - hid_t comp_dcpl; /* Dataset creation property list for compressed, chunked dataset */ - hid_t compact_dcpl; /* Dataset creation property list for compact dataset */ - hid_t file; /* File ID */ - hid_t group, group2; /* Group IDs */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t space; /* Dataspace ID */ - hid_t type; /* Datatype ID */ - hid_t attr_space; /* Dataspace ID for attributes */ - hid_t attr; /* Attribute ID */ - char filename[1024]; /* Name of file to create */ - char objname[128]; /* Name of object to create */ + hid_t fapl_nocache; /* File access property list with raw data cache turned off */ + hid_t contig_dcpl; /* Dataset creation property list for contiguous dataset */ + hid_t early_chunk_dcpl; /* Dataset creation property list for chunked dataset & early allocation */ + hid_t late_chunk_dcpl; /* Dataset creation property list for chunked dataset & late allocation */ + hid_t comp_dcpl; /* Dataset creation property list for compressed, chunked dataset */ + hid_t compact_dcpl; /* Dataset creation property list for compact dataset */ + hid_t file; /* File ID */ + hid_t group, group2; /* Group IDs */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t space; /* Dataspace ID */ + hid_t type; /* Datatype ID */ + hid_t attr_space; /* Dataspace ID for attributes */ + hid_t attr; /* Attribute ID */ + char filename[1024]; /* Name of file to create */ + char objname[128]; /* Name of object to create */ hsize_t dims[FILESPACE_NDIMS]= {FILESPACE_DIM0, FILESPACE_DIM1, FILESPACE_DIM2}; /* Dataset dimensions */ hsize_t chunk_dims[FILESPACE_NDIMS]= {FILESPACE_CHUNK0, FILESPACE_CHUNK1, FILESPACE_CHUNK2}; /* Chunk dimensions */ hsize_t attr_dims[FILESPACE_ATTR_NDIMS]= {FILESPACE_ATTR_DIM0, FILESPACE_ATTR_DIM1}; /* Attribute dimensions */ @@ -514,7 +514,7 @@ test_filespace(hid_t fapl) int *tmp_data; /* Temporary pointer to dataset buffer */ h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ - herr_t status; /* Function status return value */ + herr_t status; /* Function status return value */ unsigned u,v,w; /* Local index variables */ /* Metadata cache parameters */ @@ -806,7 +806,7 @@ test_filespace(hid_t fapl) /* Alternate adding attributes to each one */ for(u = 0; u < FILESPACE_NATTR; u++) { /* Set the name of the attribute to create */ - sprintf(objname,"%s %u",ATTRNAME,u); + HDsprintf(objname,"%s %u",ATTRNAME,u); /* Create an attribute on the first dataset */ if((attr = H5Acreate2(dataset, objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -912,7 +912,7 @@ test_filespace(hid_t fapl) /* Create a many groups to remove */ for(u = 0; u < UNLINK_NGROUPS; u++) { - sprintf(objname, "%s %u", GROUPNAME, u); + HDsprintf(objname, "%s %u", GROUPNAME, u); if((group = H5Gcreate2(file, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(group) < 0) FAIL_STACK_ERROR } /* end for */ @@ -920,7 +920,7 @@ test_filespace(hid_t fapl) /* Remove the all the groups */ /* (Remove them in reverse order just to make file size calculation easier -QAK) */ for(u = UNLINK_NGROUPS; u > 0; u--) { - sprintf(objname, "%s %u", GROUPNAME, (u - 1)); + HDsprintf(objname, "%s %u", GROUPNAME, (u - 1)); if(H5Ldelete(file, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ @@ -975,19 +975,19 @@ test_filespace(hid_t fapl) /* Create a complex group hierarchy to remove */ for(u = 0; u < FILESPACE_TOP_GROUPS; u++) { /* Create group */ - sprintf(objname,"%s %u",GROUPNAME,u); + HDsprintf(objname,"%s %u",GROUPNAME,u); if((group = H5Gcreate2(file, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create nested groups inside top groups */ for(v = 0; v < FILESPACE_NESTED_GROUPS; v++) { /* Create group */ - sprintf(objname, "%s %u", GROUP2NAME, v); + HDsprintf(objname, "%s %u", GROUP2NAME, v); if((group2 = H5Gcreate2(group, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create datasets inside nested groups */ for(w = 0; w < FILESPACE_NDATASETS; w++) { /* Create & close a dataset */ - sprintf(objname, "%s %u", DATASETNAME, w); + HDsprintf(objname, "%s %u", DATASETNAME, w); if((dataset = H5Dcreate2(group2, objname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1004,19 +1004,19 @@ test_filespace(hid_t fapl) /* (Remove them in reverse order just to make file size calculation easier -QAK) */ for(u = FILESPACE_TOP_GROUPS; u > 0; u--) { /* Open group */ - sprintf(objname, "%s %u", GROUPNAME, (u - 1)); + HDsprintf(objname, "%s %u", GROUPNAME, (u - 1)); if((group = H5Gopen2(file, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Open nested groups inside top groups */ for(v = 0; v < FILESPACE_NESTED_GROUPS; v++) { /* Create group */ - sprintf(objname, "%s %u", GROUP2NAME, v); + HDsprintf(objname, "%s %u", GROUP2NAME, v); if((group2 = H5Gopen2(group, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Remove datasets inside nested groups */ for(w = 0; w < FILESPACE_NDATASETS; w++) { /* Remove dataset */ - sprintf(objname, "%s %u", DATASETNAME, w); + HDsprintf(objname, "%s %u", DATASETNAME, w); if(H5Ldelete(group2, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1024,7 +1024,7 @@ test_filespace(hid_t fapl) if(H5Gclose(group2) < 0) FAIL_STACK_ERROR /* Remove nested group */ - sprintf(objname, "%s %u",GROUP2NAME, v); + HDsprintf(objname, "%s %u",GROUP2NAME, v); if(H5Ldelete(group, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1032,7 +1032,7 @@ test_filespace(hid_t fapl) if(H5Gclose(group) < 0) FAIL_STACK_ERROR /* Remove top group */ - sprintf(objname, "%s %u", GROUPNAME, (u - 1)); + HDsprintf(objname, "%s %u", GROUPNAME, (u - 1)); if(H5Ldelete(file, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1232,7 +1232,7 @@ error: return 1; } /* end test_filespace() */ - + /*------------------------------------------------------------------------- * Function: test_create_unlink * @@ -1251,10 +1251,10 @@ error: static int test_create_unlink(const char *msg, hid_t fapl) { - hid_t file, group; + hid_t file, group; unsigned u; - char groupname[1024]; - char filename[1024]; + char groupname[1024]; + char filename[1024]; TESTING(msg); @@ -1265,25 +1265,25 @@ test_create_unlink(const char *msg, hid_t fapl) /* Create a many groups to remove */ for(u = 0; u < UNLINK_NGROUPS; u++) { - sprintf(groupname, "%s %u", GROUPNAME, u); + HDsprintf(groupname, "%s %u", GROUPNAME, u); if((group = H5Gcreate2(file, groupname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf("group %s creation failed\n", groupname); + HDprintf("group %s creation failed\n", groupname); goto error; } /* end if */ if(H5Gclose (group) < 0) { H5_FAILED(); - printf("closing group %s failed\n", groupname); + HDprintf("closing group %s failed\n", groupname); goto error; } /* end if */ } /* end for */ /* Remove the all the groups */ for(u = 0; u < UNLINK_NGROUPS; u++) { - sprintf(groupname, "%s %u", GROUPNAME, u); + HDsprintf(groupname, "%s %u", GROUPNAME, u); if(H5Ldelete(file, groupname, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Unlinking group %s failed\n", groupname); + HDprintf("Unlinking group %s failed\n", groupname); goto error; } /* end if */ } /* end for */ @@ -1299,7 +1299,7 @@ error: return 1; } /* end test_create_unlink() */ - + /*------------------------------------------------------------------------- * Function: test_link_slashes * @@ -1320,7 +1320,7 @@ test_link_slashes(hid_t fapl) { hid_t fid; /* File ID */ hid_t gid, gid2; /* Group ID */ - char filename[1024]; + char filename[1024]; TESTING("creating links with multiple slashes"); @@ -1367,7 +1367,7 @@ error: return 1; } /* end test_link_slashes() */ - + /*------------------------------------------------------------------------- * Function: test_unlink_slashes * @@ -1388,7 +1388,7 @@ test_unlink_slashes(hid_t fapl) { hid_t fid; /* File ID */ hid_t gid; /* Group ID */ - char filename[1024]; + char filename[1024]; TESTING("deleting links with multiple slashes"); @@ -1464,7 +1464,7 @@ delete_node(hid_t pid, hid_t id) return(0); } - + /*------------------------------------------------------------------------- * Function: test_unlink_rightleaf * @@ -1499,14 +1499,14 @@ test_unlink_rightleaf(hid_t fid) /* Create all the groups */ for (n = 0; n < ngroups; n++) { - sprintf(name, "Zone%d", n + 1); + HDsprintf(name, "Zone%d", n + 1); if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR } /* end for */ /* Unlink & re-create each group */ for (n = 0; n < ngroups; n++) { if(delete_node (rootid, gids[n]) < 0) TEST_ERROR - sprintf(name, "Zone%d", n + 1); + HDsprintf(name, "Zone%d", n + 1); if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR } /* end for */ @@ -1543,7 +1543,7 @@ error: return 1; } /* end test_unlink_rightleaf() */ - + /*------------------------------------------------------------------------- * Function: test_unlink_rightnode * @@ -1578,7 +1578,7 @@ test_unlink_rightnode(hid_t fid) /* Create all the groups */ for (n = 0; n < ngroups; n++) { - sprintf(name, "ZoneB%d", n + 1); + HDsprintf(name, "ZoneB%d", n + 1); if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1622,7 +1622,7 @@ error: return 1; } /* end test_unlink_rightnode() */ - + /*------------------------------------------------------------------------- * Function: test_unlink_middlenode * @@ -1657,7 +1657,7 @@ test_unlink_middlenode(hid_t fid) /* Create all the groups */ for (n = 0; n < ngroups; n++) { - sprintf(name, "ZoneC%d", n + 1); + HDsprintf(name, "ZoneC%d", n + 1); if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1844,7 +1844,7 @@ error: return 1; } /* end test_unlink_middlenode() */ - + /*------------------------------------------------------------------------- * Function: test_resurrect_dataset * @@ -1865,7 +1865,7 @@ static int test_resurrect_dataset(hid_t fapl) { hid_t f = -1, s = -1, d = -1; - char filename[1024]; + char filename[1024]; TESTING("resurrecting dataset after deletion"); @@ -1908,14 +1908,14 @@ test_resurrect_dataset(hid_t fapl) error: H5E_BEGIN_TRY { - H5Sclose(s); - H5Dclose(d); - H5Fclose(f); + H5Sclose(s); + H5Dclose(d); + H5Fclose(f); } H5E_END_TRY; return 1; } /* end test_resurrect_dataset() */ - + /*------------------------------------------------------------------------- * Function: test_resurrect_datatype * @@ -1978,13 +1978,13 @@ test_resurrect_datatype(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Fclose(file); + H5Tclose(type); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_resurrect_datatype() */ - + /*------------------------------------------------------------------------- * Function: test_resurrect_group * @@ -2046,13 +2046,13 @@ test_resurrect_group(hid_t fapl) error: H5E_BEGIN_TRY { - H5Gclose(group); - H5Fclose(file); + H5Gclose(group); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_resurrect_group() */ - + /*------------------------------------------------------------------------- * Function: test_unlink_chunked_dataset * @@ -2129,15 +2129,15 @@ test_unlink_chunked_dataset(hid_t fapl) error: H5E_BEGIN_TRY { - H5Pclose(dcpl_id); - H5Sclose(space_id); - H5Dclose(dset_id); - H5Fclose(file_id); + H5Pclose(dcpl_id); + H5Sclose(space_id); + H5Dclose(dset_id); + H5Fclose(file_id); } H5E_END_TRY; return 1; } /* end test_unlink_chunked_dataset() */ - + /*------------------------------------------------------------------------- * Function: test_full_group_compact * @@ -2156,7 +2156,7 @@ test_full_group_compact(hid_t fapl) { hid_t file_id = -1; hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5O_info_t oi; /* Stat buffer for object */ + H5O_info_t oi; /* Stat buffer for object */ char objname[128]; /* Buffer for name of objects to create */ char objname2[128]; /* Buffer for name of objects to create */ char filename[1024]; /* Buffer for filename */ @@ -2177,7 +2177,7 @@ test_full_group_compact(hid_t fapl) /* Create several objects to link to */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "keep %u\n", u); + HDsprintf(objname, "keep %u\n", u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2205,14 +2205,14 @@ test_full_group_compact(hid_t fapl) /* Create hard links to objects in group to keep */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "/keep/keep %u\n", u); - sprintf(objname2, "keep %u\n", u); + HDsprintf(objname, "/keep/keep %u\n", u); + HDsprintf(objname2, "keep %u\n", u); if(H5Lcreate_hard(file_id, objname, gid, objname2, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ /* Create several objects to delete */ for(u = 0; u < FULL_GROUP_NUM_DELETE_COMPACT; u++) { - sprintf(objname, "delete %u\n", u); + HDsprintf(objname, "delete %u\n", u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2227,7 +2227,7 @@ test_full_group_compact(hid_t fapl) /* Check reference count on objects to keep */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "/keep/keep %u\n", u); + HDsprintf(objname, "/keep/keep %u\n", u); if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(oi.rc != 2) TEST_ERROR } /* end for */ @@ -2244,7 +2244,7 @@ test_full_group_compact(hid_t fapl) /* Check reference count on objects to keep */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "/keep/keep %u\n", u); + HDsprintf(objname, "/keep/keep %u\n", u); if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(oi.rc != 1) TEST_ERROR } /* end for */ @@ -2263,14 +2263,14 @@ test_full_group_compact(hid_t fapl) error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(file_id); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(file_id); } H5E_END_TRY; return 1; } /* end test_full_group_compact() */ - + /*------------------------------------------------------------------------- * Function: test_full_group_dense * @@ -2290,7 +2290,7 @@ test_full_group_dense(hid_t fapl) hid_t file_id = -1; hid_t gcpl = (-1); /* Group creation property list ID */ hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5O_info_t oi; /* Stat buffer for object */ + H5O_info_t oi; /* Stat buffer for object */ char objname[128]; /* Buffer for name of objects to create */ char objname2[128]; /* Buffer for name of objects to create */ char filename[1024]; /* Buffer for filename */ @@ -2311,7 +2311,7 @@ test_full_group_dense(hid_t fapl) /* Create several objects to link to */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "keep %u\n", u); + HDsprintf(objname, "keep %u\n", u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2351,14 +2351,14 @@ test_full_group_dense(hid_t fapl) /* Create hard links to objects in group to keep */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "/keep/keep %u\n", u); - sprintf(objname2, "keep %u\n", u); + HDsprintf(objname, "/keep/keep %u\n", u); + HDsprintf(objname2, "keep %u\n", u); if(H5Lcreate_hard(file_id, objname, gid, objname2, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ /* Create several objects to delete */ for(u = 0; u < FULL_GROUP_NUM_DELETE_DENSE; u++) { - sprintf(objname, "delete %u\n", u); + HDsprintf(objname, "delete %u\n", u); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2373,7 +2373,7 @@ test_full_group_dense(hid_t fapl) /* Check reference count on objects to keep */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "/keep/keep %u\n", u); + HDsprintf(objname, "/keep/keep %u\n", u); if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(oi.rc != 2) TEST_ERROR } /* end for */ @@ -2390,7 +2390,7 @@ test_full_group_dense(hid_t fapl) /* Check reference count on objects to keep */ for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) { - sprintf(objname, "/keep/keep %u\n", u); + HDsprintf(objname, "/keep/keep %u\n", u); if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(oi.rc != 1) TEST_ERROR } /* end for */ @@ -2409,38 +2409,34 @@ test_full_group_dense(hid_t fapl) error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Pclose(gcpl); - H5Fclose(file_id); + H5Gclose(gid2); + H5Gclose(gid); + H5Pclose(gcpl); + H5Fclose(file_id); } H5E_END_TRY; return 1; } /* end test_full_group_dense() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test unlinking operations + * Purpose: Test unlinking operations * - * Return: Success: zero + * Return: EXIT_SUCCESS/EXIT_FAILURE * - * Failure: non-zero - * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int main(void) { - hid_t fapl, fapl2, file; - int nerrors = 0; - char filename[1024]; - unsigned new_format; + hid_t fapl, fapl2, file; + int nerrors = 0; + char filename[1024]; + unsigned new_format; /* Metadata cache parameters */ int mdc_nelmts; @@ -2467,11 +2463,11 @@ main(void) /* Set the FAPL for the type of format */ if(new_format) { - puts("\nTesting with new group format:"); + HDputs("\nTesting with new group format:"); my_fapl = fapl2; } /* end if */ else { - puts("Testing with old group format:"); + HDputs("Testing with old group format:"); my_fapl = fapl; } /* end else */ @@ -2500,12 +2496,12 @@ main(void) /* Get FAPL cache settings */ if(H5Pget_cache(fapl_small_mdc, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) - printf("H5Pget_cache failed\n"); + HDprintf("H5Pget_cache failed\n"); /* Change FAPL cache settings */ mdc_nelmts=1; if(H5Pset_cache(fapl_small_mdc, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) - printf("H5Pset_cache failed\n"); + HDprintf("H5Pset_cache failed\n"); /* Test creating & unlinking lots of objects with a 1-element metadata cache FAPL */ nerrors += test_create_unlink("create and unlink large number of objects with small cache", fapl_small_mdc); @@ -2550,17 +2546,17 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); if (nerrors) { - printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - exit(EXIT_FAILURE); + HDprintf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); + HDexit(EXIT_FAILURE); } - puts("All unlink tests passed."); + HDputs("All unlink tests passed."); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 4e8c672..6b34f1e 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -174,9 +174,9 @@ main(int argc, char *argv[]) HDprintf("%d: launch reader process\n", mypid); if (read_uc_file(send_wait) < 0){ HDfprintf(stderr, "read_uc_file encountered error\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } - HDexit(0); + HDexit(EXIT_SUCCESS); } } diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index 0414628..b7d45a4 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -167,9 +167,9 @@ main(int argc, char *argv[]) HDprintf("%d: launch reader process\n", mypid); if (read_uc_file(send_wait) < 0){ HDfprintf(stderr, "read_uc_file encountered error\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } - HDexit(0); + HDexit(EXIT_SUCCESS); } } diff --git a/test/use_common.c b/test/use_common.c index 3ecb2e1..9effa06 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -21,7 +21,7 @@ #include "use.h" -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING #include "H5Dpkg.h" @@ -57,88 +57,88 @@ parse_option(int argc, char * const argv[]) opterr = 0; while (1){ - c = getopt (argc, argv, nagg_options); - if (-1 == c) - break; - switch (c) { - case 'h': - usage(progname_g); - exit(0); - break; - case 'f': /* usecase data file name */ - UC_opts.filename = optarg; - break; - case 'i': /* iterations */ - if ((UC_opts.iterations = HDatoi(optarg)) <= 0) { - fprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case 'l': /* launch reader or writer only */ - switch (*optarg) { - case 'r': /* reader only */ - UC_opts.launch = UC_READER; - break; - case 'w': /* writer only */ - UC_opts.launch = UC_WRITER; - break; - default: - fprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg); - usage(progname_g); - Hgoto_error(-1); - break; - } - break; - case 'n': /* number of planes to write/read */ - if ((UC_opts.nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { - fprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case 's': /* use swmr file open mode */ + c = getopt (argc, argv, nagg_options); + if (-1 == c) + break; + switch (c) { + case 'h': + usage(progname_g); + HDexit(EXIT_SUCCESS); + break; + case 'f': /* usecase data file name */ + UC_opts.filename = optarg; + break; + case 'i': /* iterations */ + if ((UC_opts.iterations = HDatoi(optarg)) <= 0) { + HDfprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case 'l': /* launch reader or writer only */ + switch (*optarg) { + case 'r': /* reader only */ + UC_opts.launch = UC_READER; + break; + case 'w': /* writer only */ + UC_opts.launch = UC_WRITER; + break; + default: + HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg); + usage(progname_g); + Hgoto_error(-1); + break; + } + break; + case 'n': /* number of planes to write/read */ + if ((UC_opts.nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { + HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case 's': /* use swmr file open mode */ use_swmr = HDatoi(optarg); - if (use_swmr != 0 && use_swmr != 1) { + if (use_swmr != 0 && use_swmr != 1) { HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); usage(progname_g); Hgoto_error(-1); - } + } UC_opts.use_swmr = (hbool_t)use_swmr; - break; - case 'y': /* Number of planes per chunk */ - if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { - fprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case 'z': /* size of chunk=(z,z) */ - if ((UC_opts.chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) { - fprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case '?': - fprintf(stderr, "getopt returned '%c'.\n", c); - Hgoto_error(-1); - default: - fprintf(stderr, "getopt returned unexpected value.\n"); - fprintf(stderr, "Unexpected value is %d\n", c); - Hgoto_error(-1); - } + break; + case 'y': /* Number of planes per chunk */ + if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { + HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case 'z': /* size of chunk=(z,z) */ + if ((UC_opts.chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) { + HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case '?': + HDfprintf(stderr, "getopt returned '%c'.\n", c); + Hgoto_error(-1); + default: + HDfprintf(stderr, "getopt returned unexpected value.\n"); + HDfprintf(stderr, "Unexpected value is %d\n", c); + Hgoto_error(-1); + } } /* set test file name if not given */ if (!UC_opts.filename){ - /* default data file name is <progname>.h5 */ - if ((UC_opts.filename=(char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) { - fprintf(stderr, "malloc: failed\n"); - Hgoto_error(-1); - }; - HDstrcpy(UC_opts.filename, progname_g); - HDstrcat(UC_opts.filename, ".h5"); + /* default data file name is <progname>.h5 */ + if ((UC_opts.filename=(char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) { + HDfprintf(stderr, "malloc: failed\n"); + Hgoto_error(-1); + }; + HDstrcpy(UC_opts.filename, progname_g); + HDstrcat(UC_opts.filename, ".h5"); } done: @@ -148,31 +148,31 @@ done: /* Show parameters used for this use case */ void show_parameters(void){ - printf("===Parameters used:===\n"); - printf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.chunkdims[0], + HDprintf("===Parameters used:===\n"); + printf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.chunkdims[0], (unsigned long long)UC_opts.chunkdims[1], (unsigned long long)UC_opts.chunkdims[2]); - printf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.max_dims[0], + printf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.max_dims[0], (unsigned long long)UC_opts.max_dims[1], (unsigned long long)UC_opts.max_dims[2]); - printf("number of planes to write=%llu\n", (unsigned long long)UC_opts.nplanes); - printf("using SWMR mode=%s\n", UC_opts.use_swmr ? "yes(1)" : "no(0)"); - printf("data filename=%s\n", UC_opts.filename); - printf("launch part="); - switch (UC_opts.launch){ - case UC_READWRITE: - printf("Reader/Writer\n"); - break; - case UC_WRITER: - printf("Writer\n"); - break; - case UC_READER: - printf("Reader\n"); - break; - default: - /* should not happen */ - printf("Illegal part(%d)\n", UC_opts.launch); - }; - printf("number of iterations=%d (not used yet)\n", UC_opts.iterations); - printf("===Parameters shown===\n"); + HDprintf("number of planes to write=%llu\n", (unsigned long long)UC_opts.nplanes); + HDprintf("using SWMR mode=%s\n", UC_opts.use_swmr ? "yes(1)" : "no(0)"); + HDprintf("data filename=%s\n", UC_opts.filename); + HDprintf("launch part="); + switch (UC_opts.launch){ + case UC_READWRITE: + printf("Reader/Writer\n"); + break; + case UC_WRITER: + printf("Writer\n"); + break; + case UC_READER: + printf("Reader\n"); + break; + default: + /* should not happen */ + printf("Illegal part(%d)\n", UC_opts.launch); + }; + HDprintf("number of iterations=%d (not used yet)\n", UC_opts.iterations); + HDprintf("===Parameters shown===\n"); } /* Create the skeleton use case file for testing. @@ -185,7 +185,7 @@ void show_parameters(void){ */ int create_uc_file(void) { - hsize_t dims[3]; /* Dataset starting dimensions */ + hsize_t dims[3]; /* Dataset starting dimensions */ hid_t fid; /* File ID for new HDF5 file */ hid_t dcpl; /* Dataset creation property list */ hid_t sid; /* Dataspace ID */ @@ -217,7 +217,7 @@ int create_uc_file(void) /* create dataset of progname */ if((dsid = H5Dcreate2(fid, progname_g, UC_DATATYPE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - return -1; + return -1; /* Check that the chunk index type is not version 1 B-tree. * Version 1 B-trees are not supported under SWMR. @@ -225,13 +225,13 @@ int create_uc_file(void) if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) return -1; if(idx_type == H5D_CHUNK_IDX_BTREE) { - fprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n"); + HDfprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n"); return -1; } /* Close everything */ if(H5Dclose(dsid) < 0) - return -1; + return -1; if(H5Pclose(fapl) < 0) return -1; if(H5Pclose(dcpl) < 0) @@ -254,17 +254,17 @@ int create_uc_file(void) */ int write_uc_file(hbool_t tosend, hid_t fid) { - hid_t dsid; /* dataset ID */ - hid_t dcpl; /* Dataset creation property list */ - UC_CTYPE *buffer, *bufptr; /* data buffer */ - hsize_t cz=UC_opts.chunksize; /* Chunk size */ - hid_t f_sid; /* dataset file space id */ - hid_t m_sid; /* memory space id */ - int rank; /* rank */ - hsize_t chunk_dims[3]; /* Chunk dimensions */ - hsize_t dims[3]; /* Dataspace dimensions */ - hsize_t memdims[3]; /* Memory space dimensions */ - hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ + hid_t dsid; /* dataset ID */ + hid_t dcpl; /* Dataset creation property list */ + UC_CTYPE *buffer, *bufptr; /* data buffer */ + hsize_t cz=UC_opts.chunksize; /* Chunk size */ + hid_t f_sid; /* dataset file space id */ + hid_t m_sid; /* memory space id */ + int rank; /* rank */ + hsize_t chunk_dims[3]; /* Chunk dimensions */ + hsize_t dims[3]; /* Dataspace dimensions */ + hsize_t memdims[3]; /* Memory space dimensions */ + hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ hsize_t i, j, k; if(tosend) @@ -273,30 +273,30 @@ int write_uc_file(hbool_t tosend, hid_t fid) /* Open the dataset of the program name */ if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){ - fprintf(stderr, "H5Dopen2 failed\n"); - return -1; + HDfprintf(stderr, "H5Dopen2 failed\n"); + return -1; } /* Find chunksize used */ if ((dcpl = H5Dget_create_plist(dsid)) < 0){ - fprintf(stderr, "H5Dget_create_plist failed\n"); - return -1; + HDfprintf(stderr, "H5Dget_create_plist failed\n"); + return -1; } if (H5D_CHUNKED != H5Pget_layout(dcpl)){ - fprintf(stderr, "storage layout is not chunked\n"); - return -1; + HDfprintf(stderr, "storage layout is not chunked\n"); + return -1; } if ((rank = H5Pget_chunk(dcpl, 3, chunk_dims)) != 3){ - fprintf(stderr, "storage rank is not 3\n"); - return -1; + HDfprintf(stderr, "storage rank is not 3\n"); + return -1; } /* verify chunk_dims against set paramenters */ if (chunk_dims[0]!=UC_opts.chunkdims[0] || chunk_dims[1] != cz || chunk_dims[2] != cz){ - fprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n", - (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1], + HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n", + (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1], (unsigned long long)chunk_dims[2]); - return -1; + return -1; } /* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */ @@ -304,8 +304,8 @@ int write_uc_file(hbool_t tosend, hid_t fid) memdims[1] = UC_opts.dims[1]; memdims[2] = UC_opts.dims[2]; if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) { - fprintf(stderr, "malloc: failed\n"); - return -1; + HDfprintf(stderr, "malloc: failed\n"); + return -1; }; /* @@ -314,28 +314,28 @@ int write_uc_file(hbool_t tosend, hid_t fid) f_sid = H5Dget_space(dsid); /* Get filespace handle first. */ rank = H5Sget_simple_extent_ndims(f_sid); if (rank != UC_RANK){ - fprintf(stderr, "rank(%d) of dataset does not match\n", rank); - return -1; + HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank); + return -1; } if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){ - fprintf(stderr, "H5Sget_simple_extent_dims got error\n"); - return -1; + HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n"); + return -1; } - printf("dataset rank %d, dimensions %llu x %llu x %llu\n", - rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]), + HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", + rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]), (unsigned long long)(dims[2])); /* verify that file space dims are as expected and are consistent with memory space dims */ if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]){ - fprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", - (unsigned long long)dims[0], (unsigned long long)dims[1], + HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", + (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]); - return -1; + return -1; } - + /* setup mem-space for buffer */ if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){ - fprintf(stderr, "H5Screate_simple for memory failed\n"); - return -1; + HDfprintf(stderr, "H5Screate_simple for memory failed\n"); + return -1; }; /* write planes */ @@ -343,73 +343,73 @@ int write_uc_file(hbool_t tosend, hid_t fid) count[1]=dims[1]; count[2]=dims[2]; for (i=0; i<UC_opts.nplanes; i++){ - /* fill buffer with value i+1 */ - bufptr = buffer; - for (j=0; j<dims[1]; j++) - for (k=0; k<dims[2]; k++) - *bufptr++ = (UC_CTYPE)i; + /* fill buffer with value i+1 */ + bufptr = buffer; + for (j=0; j<dims[1]; j++) + for (k=0; k<dims[2]; k++) + *bufptr++ = (UC_CTYPE)i; /* Cork the dataset's metadata in the cache, if SWMR is enabled */ if(UC_opts.use_swmr) if(H5Odisable_mdc_flushes(dsid) < 0) { - fprintf(stderr, "H5Odisable_mdc_flushes failed\n"); + HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n"); return -1; } - /* extend the dataset by one for new plane */ - dims[0]=i+1; + /* extend the dataset by one for new plane */ + dims[0]=i+1; if(H5Dset_extent(dsid, dims) < 0){ - fprintf(stderr, "H5Dset_extent failed\n"); + HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } /* Get the dataset's dataspace */ if((f_sid = H5Dget_space(dsid)) < 0){ - fprintf(stderr, "H5Dset_extent failed\n"); + HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } - start[0]=i; + start[0]=i; /* Choose the next plane to write */ if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){ - fprintf(stderr, "Failed H5Sselect_hyperslab\n"); + HDfprintf(stderr, "Failed H5Sselect_hyperslab\n"); return -1; - } + } /* Write plane to the dataset */ if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){ - fprintf(stderr, "Failed H5Dwrite\n"); + HDfprintf(stderr, "Failed H5Dwrite\n"); return -1; - } + } /* Uncork the dataset's metadata from the cache, if SWMR is enabled */ if(UC_opts.use_swmr) if(H5Oenable_mdc_flushes(dsid) < 0) { - fprintf(stderr, "H5Oenable_mdc_flushes failed\n"); + HDfprintf(stderr, "H5Oenable_mdc_flushes failed\n"); return -1; } - /* flush file to make the just written plane available. */ - if(H5Dflush(dsid) < 0) - { - fprintf(stderr, "Failed to H5Fflush file\n"); - return -1; - } + /* flush file to make the just written plane available. */ + if(H5Dflush(dsid) < 0) + { + HDfprintf(stderr, "Failed to H5Fflush file\n"); + return -1; + } } /* Done writing. Free/Close all resources including data file */ HDfree(buffer); if (H5Dclose(dsid) < 0){ - fprintf(stderr, "Failed to close datasete\n"); - return -1; + HDfprintf(stderr, "Failed to close datasete\n"); + return -1; } if (H5Sclose(m_sid) < 0){ - fprintf(stderr, "Failed to close memory space\n"); - return -1; + HDfprintf(stderr, "Failed to close memory space\n"); + return -1; } if (H5Sclose(f_sid) < 0){ - fprintf(stderr, "Failed to close file space\n"); - return -1; + HDfprintf(stderr, "Failed to close file space\n"); + return -1; } return 0; @@ -429,21 +429,21 @@ int write_uc_file(hbool_t tosend, hid_t fid) int read_uc_file(hbool_t towait) { hid_t fapl; /* file access property list ID */ - hid_t fid; /* File ID for new HDF5 file */ - hid_t dsid; /* dataset ID */ - char *name; - UC_CTYPE *buffer, *bufptr; /* read data buffer */ - hid_t f_sid; /* dataset file space id */ - hid_t m_sid; /* memory space id */ - int rank; /* rank */ - hsize_t dims[3]; /* Dataspace dimensions */ - hsize_t memdims[3]; /* Memory space dimensions */ - hsize_t nplane=0, nplane_old=0; /* nth plane, last nth plane */ - hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ - hsize_t j, k; - int nreadererr=0; - int nerrs; - int nonewplane; + hid_t fid; /* File ID for new HDF5 file */ + hid_t dsid; /* dataset ID */ + char *name; + UC_CTYPE *buffer, *bufptr; /* read data buffer */ + hid_t f_sid; /* dataset file space id */ + hid_t m_sid; /* memory space id */ + int rank; /* rank */ + hsize_t dims[3]; /* Dataspace dimensions */ + hsize_t memdims[3]; /* Memory space dimensions */ + hsize_t nplane=0, nplane_old=0; /* nth plane, last nth plane */ + hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ + hsize_t j, k; + int nreadererr=0; + int nerrs; + int nonewplane; /* Before reading, wait for the message that H5Fopen is complete--file lock is released */ if(towait && h5_wait_message(WRITER_MESSAGE) < 0) { @@ -461,8 +461,8 @@ int read_uc_file(hbool_t towait) return -1; } if (H5Pclose(fapl) < 0){ - HDfprintf(stderr, "Failed to property list\n"); - return -1; + HDfprintf(stderr, "Failed to property list\n"); + return -1; } @@ -504,11 +504,11 @@ int read_uc_file(hbool_t towait) (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]); HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n", - (unsigned long long)memdims[0], (unsigned long long)memdims[1], + (unsigned long long)memdims[0], (unsigned long long)memdims[1], (unsigned long long)memdims[2]); return -1; } - + /* setup mem-space for buffer */ if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){ HDfprintf(stderr, "H5Screate_simple for memory failed\n"); @@ -523,102 +523,102 @@ int read_uc_file(hbool_t towait) /* quit when all nplanes have been read */ nonewplane=0; while (nplane_old < UC_opts.nplanes ){ - /* print progress message according to if new planes are availalbe */ - if (nplane_old < dims[0]) { - if (nonewplane){ + /* print progress message according to if new planes are availalbe */ + if (nplane_old < dims[0]) { + if (nonewplane){ /* end the previous message */ HDprintf("\n"); nonewplane=0; - } - HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplane_old, + } + HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplane_old, (unsigned long long)dims[0]); - }else{ - if (nonewplane){ + }else{ + if (nonewplane){ HDprintf("."); - if (nonewplane>=30){ - HDfprintf(stderr, "waited too long for new plane, quit.\n"); - return -1; - } - }else{ + if (nonewplane>=30){ + HDfprintf(stderr, "waited too long for new plane, quit.\n"); + return -1; + } + }else{ /* print mesg only the first time; dots still no new plane */ HDprintf("no new planes to read "); - } - nonewplane++; - /* pause for a second */ + } + nonewplane++; + /* pause for a second */ HDsleep(1); - } - for (nplane=nplane_old; nplane < dims[0]; nplane++){ - /* read planes between last old nplanes and current extent */ - /* Get the dataset's dataspace */ - if((f_sid = H5Dget_space(dsid)) < 0){ + } + for (nplane=nplane_old; nplane < dims[0]; nplane++){ + /* read planes between last old nplanes and current extent */ + /* Get the dataset's dataspace */ + if((f_sid = H5Dget_space(dsid)) < 0){ HDfprintf(stderr, "H5Dget_space failed\n"); return -1; - } + } - start[0]=nplane; - /* Choose the next plane to read */ - if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){ + start[0]=nplane; + /* Choose the next plane to read */ + if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){ HDfprintf(stderr, "H5Sselect_hyperslab failed\n"); return -1; - } + } - /* Read the plane from the dataset */ - if(H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){ + /* Read the plane from the dataset */ + if(H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){ HDfprintf(stderr, "H5Dread failed\n"); return -1; - } + } - /* compare read data with expected data value which is nplane */ - bufptr = buffer; - nerrs=0; - for (j=0; j<dims[1]; j++){ + /* compare read data with expected data value which is nplane */ + bufptr = buffer; + nerrs=0; + for (j=0; j<dims[1]; j++){ for (k=0; k<dims[2]; k++){ if ((hsize_t)*bufptr++ != nplane){ if (++nerrs < ErrorReportMax){ HDfprintf(stderr, "found error %llu plane(%llu,%llu), expected %llu, got %d\n", - (unsigned long long)nplane, (unsigned long long)j, + (unsigned long long)nplane, (unsigned long long)j, (unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr-1)); } } } - } - if (nerrs){ + } + if (nerrs){ nreadererr++; - HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs, + HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs, (unsigned long long)nplane); - } - } - /* Have read all current planes */ - nplane_old=dims[0]; + } + } + /* Have read all current planes */ + nplane_old=dims[0]; - /* check if dataset has grown since last time */ + /* check if dataset has grown since last time */ #if 0 - /* close dsid and file, then reopen them */ - if (H5Dclose(dsid) < 0){ - HDfprintf(stderr, "H5Dclose failed\n"); - return -1; - } - if (H5Fclose(fid) < 0){ - HDfprintf(stderr, "H5Fclose failed\n"); - return -1; - } - if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), H5P_DEFAULT)) < 0){ - HDfprintf(stderr, "H5Fopen failed\n"); - return -1; - } - if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){ - HDfprintf(stderr, "H5Dopen2 failed\n"); - return -1; - } + /* close dsid and file, then reopen them */ + if (H5Dclose(dsid) < 0){ + HDfprintf(stderr, "H5Dclose failed\n"); + return -1; + } + if (H5Fclose(fid) < 0){ + HDfprintf(stderr, "H5Fclose failed\n"); + return -1; + } + if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), H5P_DEFAULT)) < 0){ + HDfprintf(stderr, "H5Fopen failed\n"); + return -1; + } + if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){ + HDfprintf(stderr, "H5Dopen2 failed\n"); + return -1; + } #else - H5Drefresh(dsid); + H5Drefresh(dsid); #endif - f_sid = H5Dget_space(dsid); /* Get filespace handle first. */ - if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){ - HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n"); - return -1; - } + f_sid = H5Dget_space(dsid); /* Get filespace handle first. */ + if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){ + HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n"); + return -1; + } } /* Close the file */ diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index 67e2226..9cd202c 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -24,12 +24,12 @@ */ #ifdef H5_HAVE_FORK -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING #include "H5Dpkg.h" /* Global Variable definitions */ -const char *progname_g="use_disable_mdc_flushes"; /* program name */ +const char *progname_g="use_disable_mdc_flushes"; /* program name */ /* these two definitions must match each other */ #define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */ @@ -59,7 +59,7 @@ static int setup_parameters(int argc, char * const argv[]); * * usage: use_disable_mdc_flushes [OPTIONS] * OPTIONS - * -h, --help Print a usage message and exit + * -h, --help Print a usage message and exit * -f FN Test file name [default: use_disable_mdc_flushes.h5] * -n N, --nplanes=N Number of planes to write. [default: 1000] * -s N, --swmr=N Use SWMR mode (0: no, non-0: yes) default is yes @@ -69,19 +69,19 @@ static int setup_parameters(int argc, char * const argv[]); static void usage(const char *prog) { - fprintf(stderr, "usage: %s [OPTIONS]\n", prog); - fprintf(stderr, " OPTIONS\n"); - fprintf(stderr, " -h Print a usage message and exit\n"); - fprintf(stderr, " -f FN Test file name [default: %s.h5]\n", prog); - fprintf(stderr, " -n N Number of planes to write. [default: 1000]\n"); - fprintf(stderr, " -s N Use SWMR mode (0: no, non-0: yes) default is yes\n"); - fprintf(stderr, " -z N Chunk size [default: %d]\n", Chunksize_DFT); - fprintf(stderr, " -y N Number of planes per chunk [default: 1]\n"); - fprintf(stderr, "\n"); + HDfprintf(stderr, "usage: %s [OPTIONS]\n", prog); + HDfprintf(stderr, " OPTIONS\n"); + HDfprintf(stderr, " -h Print a usage message and exit\n"); + HDfprintf(stderr, " -f FN Test file name [default: %s.h5]\n", prog); + HDfprintf(stderr, " -n N Number of planes to write. [default: 1000]\n"); + HDfprintf(stderr, " -s N Use SWMR mode (0: no, non-0: yes) default is yes\n"); + HDfprintf(stderr, " -z N Chunk size [default: %d]\n", Chunksize_DFT); + HDfprintf(stderr, " -y N Number of planes per chunk [default: 1]\n"); + HDfprintf(stderr, "\n"); } /* usage() */ -/* +/* * Setup Use Case parameters by parsing command line options. * Setup default values if not set by options. */ static int @@ -96,64 +96,64 @@ parse_option(int argc, char * const argv[]) opterr = 0; while (1){ - c = getopt (argc, argv, cmd_options); - if (-1 == c) - break; - switch (c) { - case 'h': - usage(progname_g); - exit(0); - break; - case 'f': /* usecase data file name */ - filename_g = optarg; - break; - case 'n': /* number of planes to write/read */ - if ((nplanes_g = HDatoi(optarg)) <= 0){ - fprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case 's': /* use swmr file open mode */ - if ((use_swmr_g = HDatoi(optarg)) < 0){ - fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case 'y': /* Number of planes per chunk */ - if ((chunkplanes_g = HDatoi(optarg)) <= 0){ - fprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case 'z': /* size of chunk=(z,z) */ - if ((chunksize_g = HDatoi(optarg)) <= 0){ - fprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg); - usage(progname_g); - Hgoto_error(-1); - }; - break; - case '?': - fprintf(stderr, "getopt returned '%c'.\n", c); - Hgoto_error(-1); - default: - fprintf(stderr, "getopt returned unexpected value.\n"); - fprintf(stderr, "Unexpected value is %d\n", c); - Hgoto_error(-1); - } + c = getopt (argc, argv, cmd_options); + if (-1 == c) + break; + switch (c) { + case 'h': + usage(progname_g); + HDexit(EXIT_SUCCESS); + break; + case 'f': /* usecase data file name */ + filename_g = optarg; + break; + case 'n': /* number of planes to write/read */ + if ((nplanes_g = HDatoi(optarg)) <= 0){ + HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case 's': /* use swmr file open mode */ + if ((use_swmr_g = HDatoi(optarg)) < 0){ + HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case 'y': /* Number of planes per chunk */ + if ((chunkplanes_g = HDatoi(optarg)) <= 0){ + HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case 'z': /* size of chunk=(z,z) */ + if ((chunksize_g = HDatoi(optarg)) <= 0){ + HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg); + usage(progname_g); + Hgoto_error(-1); + }; + break; + case '?': + HDfprintf(stderr, "getopt returned '%c'.\n", c); + Hgoto_error(-1); + default: + HDfprintf(stderr, "getopt returned unexpected value.\n"); + HDfprintf(stderr, "Unexpected value is %d\n", c); + Hgoto_error(-1); + } } /* set test file name if not given */ if (!filename_g){ - /* default data file name is <progname>.h5 */ - if ((filename_g = (char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) { - fprintf(stderr, "malloc: failed\n"); - Hgoto_error(-1); - }; - HDstrcpy(filename_g, progname_g); - HDstrcat(filename_g, ".h5"); + /* default data file name is <progname>.h5 */ + if ((filename_g = (char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) { + HDfprintf(stderr, "malloc: failed\n"); + Hgoto_error(-1); + }; + HDstrcpy(filename_g, progname_g); + HDstrcat(filename_g, ".h5"); } done: @@ -162,35 +162,35 @@ done: } /* parse_option() */ /* Show parameters used for this use case */ -static void +static void show_parameters(void) { - printf("===Parameters used:===\n"); - printf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)chunkdims_g[0], + HDprintf("===Parameters used:===\n"); + HDprintf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)chunkdims_g[0], (unsigned long long)chunkdims_g[1], (unsigned long long)chunkdims_g[2]); - printf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)max_dims_g[0], + HDprintf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)max_dims_g[0], (unsigned long long)max_dims_g[1], (unsigned long long)max_dims_g[2]); - printf("number of planes to write=%llu\n", (unsigned long long)nplanes_g); - printf("using SWMR mode=%s\n", use_swmr_g ? "yes(1)" : "no(0)"); - printf("data filename=%s\n", filename_g); - printf("===Parameters shown===\n"); + HDprintf("number of planes to write=%llu\n", (unsigned long long)nplanes_g); + HDprintf("using SWMR mode=%s\n", use_swmr_g ? "yes(1)" : "no(0)"); + HDprintf("data filename=%s\n", filename_g); + HDprintf("===Parameters shown===\n"); } /* show_parameters() */ -/* +/* * Setup parameters for the use case. * Return: 0 succeed; -1 fail. */ -static int +static int setup_parameters(int argc, char * const argv[]) { /* use case defaults */ chunksize_g = Chunksize_DFT; - use_swmr_g = 1; /* use swmr open */ + use_swmr_g = 1; /* use swmr open */ chunkplanes_g = 1; /* parse options */ if (parse_option(argc, argv) < 0){ - return(-1); + return(-1); } /* set chunk dims */ chunkdims_g[0] = chunkplanes_g; @@ -210,7 +210,7 @@ setup_parameters(int argc, char * const argv[]) return(0); } /* setup_parameters() */ -/* +/* * Create the skeleton use case file for testing. * It has one 3d dataset using chunked storage. * The dataset is (unlimited, chunksize, chunksize). @@ -219,10 +219,10 @@ setup_parameters(int argc, char * const argv[]) * * Return: 0 succeed; -1 fail. */ -static int +static int create_file(void) { - hsize_t dims[3]; /* Dataset starting dimensions */ + hsize_t dims[3]; /* Dataset starting dimensions */ hid_t fid; /* File ID for new HDF5 file */ hid_t dcpl; /* Dataset creation property list */ hid_t sid; /* Dataspace ID */ @@ -254,7 +254,7 @@ create_file(void) /* create dataset of progname */ if((dsid = H5Dcreate2(fid, progname_g, UC_DATATYPE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - return -1; + return -1; /* Check that the chunk index type is not version 1 B-tree. * Version 1 B-trees are not supported under SWMR. @@ -262,13 +262,13 @@ create_file(void) if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) return -1; if(idx_type == H5D_CHUNK_IDX_BTREE) { - fprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n"); + HDfprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n"); return -1; } /* Close everything */ if(H5Dclose(dsid) < 0) - return -1; + return -1; if(H5Pclose(fapl) < 0) return -1; if(H5Pclose(dcpl) < 0) @@ -281,7 +281,7 @@ create_file(void) return 0; } /* create_file() */ -/* +/* * Append planes, each of (1,2*chunksize,2*chunksize) to the dataset. * In other words, 4 chunks are appended to the dataset at a time. * Fill each plane with the plane number and then write it at the nth plane. @@ -290,24 +290,24 @@ create_file(void) * * Return: 0 succeed; -1 fail. */ -static int +static int write_file(void) { - hid_t fid; /* File ID for new HDF5 file */ - hid_t dsid; /* dataset ID */ - hid_t fapl; /* File access property list */ - hid_t dcpl; /* Dataset creation property list */ - char *name; - UC_CTYPE *buffer, *bufptr; /* data buffer */ - hsize_t cz=chunksize_g; /* Chunk size */ - hid_t f_sid; /* dataset file space id */ - hid_t m_sid; /* memory space id */ - int rank; /* rank */ - hsize_t chunk_dims[3]; /* Chunk dimensions */ - hsize_t dims[3]; /* Dataspace dimensions */ - hsize_t memdims[3]; /* Memory space dimensions */ - hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ - hbool_t disabled; /* Object's disabled status */ + hid_t fid; /* File ID for new HDF5 file */ + hid_t dsid; /* dataset ID */ + hid_t fapl; /* File access property list */ + hid_t dcpl; /* Dataset creation property list */ + char *name; + UC_CTYPE *buffer, *bufptr; /* data buffer */ + hsize_t cz=chunksize_g; /* Chunk size */ + hid_t f_sid; /* dataset file space id */ + hid_t m_sid; /* memory space id */ + int rank; /* rank */ + hsize_t chunk_dims[3]; /* Chunk dimensions */ + hsize_t dims[3]; /* Dataspace dimensions */ + hsize_t memdims[3]; /* Memory space dimensions */ + hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ + hbool_t disabled; /* Object's disabled status */ hsize_t i, j, k; name = filename_g; @@ -319,51 +319,51 @@ write_file(void) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; if((fid = H5Fopen(name, H5F_ACC_RDWR | (use_swmr_g ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0){ - fprintf(stderr, "H5Fopen failed\n"); + HDfprintf(stderr, "H5Fopen failed\n"); return -1; } /* Open the dataset of the program name */ if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){ - fprintf(stderr, "H5Dopen2 failed\n"); - return -1; + HDfprintf(stderr, "H5Dopen2 failed\n"); + return -1; } /* Disabled mdc flushed for the dataset */ if(H5Odisable_mdc_flushes(dsid) < 0) { - fprintf(stderr, "H5Odisable_mdc_flushes failed\n"); - return -1; + HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n"); + return -1; } /* Get mdc disabled status of the dataset */ if(H5Oare_mdc_flushes_disabled(dsid, &disabled) < 0) { - fprintf(stderr, "H5Oare_mdc_flushes_disabled failed\n"); - return -1; + HDfprintf(stderr, "H5Oare_mdc_flushes_disabled failed\n"); + return -1; } else if(disabled) - printf("Dataset has disabled mdc flushes.\n"); + HDprintf("Dataset has disabled mdc flushes.\n"); else - printf("Dataset should have disabled its mdc flushes.\n"); + HDprintf("Dataset should have disabled its mdc flushes.\n"); /* Find chunksize used */ if ((dcpl = H5Dget_create_plist(dsid)) < 0){ - fprintf(stderr, "H5Dget_create_plist failed\n"); - return -1; + HDfprintf(stderr, "H5Dget_create_plist failed\n"); + return -1; } if (H5D_CHUNKED != H5Pget_layout(dcpl)){ - fprintf(stderr, "storage layout is not chunked\n"); - return -1; + HDfprintf(stderr, "storage layout is not chunked\n"); + return -1; } if ((rank = H5Pget_chunk(dcpl, 3, chunk_dims)) != 3){ - fprintf(stderr, "storage rank is not 3\n"); - return -1; + HDfprintf(stderr, "storage rank is not 3\n"); + return -1; } /* verify chunk_dims against set paramenters */ if (chunk_dims[0]!= chunkdims_g[0] || chunk_dims[1] != cz || chunk_dims[2] != cz){ - fprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n", - (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1], + HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n", + (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1], (unsigned long long)chunk_dims[2]); - return -1; + return -1; } /* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */ @@ -371,8 +371,8 @@ write_file(void) memdims[1] = dims_g[1]; memdims[2] = dims_g[2]; if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) { - fprintf(stderr, "malloc: failed\n"); - return -1; + HDfprintf(stderr, "malloc: failed\n"); + return -1; }; /* @@ -381,28 +381,28 @@ write_file(void) f_sid = H5Dget_space(dsid); /* Get filespace handle first. */ rank = H5Sget_simple_extent_ndims(f_sid); if (rank != UC_RANK){ - fprintf(stderr, "rank(%d) of dataset does not match\n", rank); - return -1; + HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank); + return -1; } if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){ - fprintf(stderr, "H5Sget_simple_extent_dims got error\n"); - return -1; + HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n"); + return -1; } - printf("dataset rank %d, dimensions %llu x %llu x %llu\n", - rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]), + HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", + rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]), (unsigned long long)(dims[2])); /* verify that file space dims are as expected and are consistent with memory space dims */ if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]){ - fprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", - (unsigned long long)dims[0], (unsigned long long)dims[1], + HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", + (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]); - return -1; + return -1; } - + /* setup mem-space for buffer */ if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){ - fprintf(stderr, "H5Screate_simple for memory failed\n"); - return -1; + HDfprintf(stderr, "H5Screate_simple for memory failed\n"); + return -1; }; /* write planes */ @@ -410,82 +410,82 @@ write_file(void) count[1]=dims[1]; count[2]=dims[2]; for (i=0; i<nplanes_g; i++){ - /* fill buffer with value i+1 */ - bufptr = buffer; - for (j=0; j<dims[1]; j++) - for (k=0; k<dims[2]; k++) - *bufptr++ = i; - - /* extend the dataset by one for new plane */ - dims[0]=i+1; + /* fill buffer with value i+1 */ + bufptr = buffer; + for (j=0; j<dims[1]; j++) + for (k=0; k<dims[2]; k++) + *bufptr++ = i; + + /* extend the dataset by one for new plane */ + dims[0]=i+1; if(H5Dset_extent(dsid, dims) < 0){ - fprintf(stderr, "H5Dset_extent failed\n"); + HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } /* Get the dataset's dataspace */ if((f_sid = H5Dget_space(dsid)) < 0){ - fprintf(stderr, "H5Dset_extent failed\n"); + HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } - start[0]=i; + start[0]=i; /* Choose the next plane to write */ if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){ - fprintf(stderr, "Failed H5Sselect_hyperslab\n"); + HDfprintf(stderr, "Failed H5Sselect_hyperslab\n"); return -1; - } + } /* Write plane to the dataset */ if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){ - fprintf(stderr, "Failed H5Dwrite\n"); + HDfprintf(stderr, "Failed H5Dwrite\n"); return -1; - } - - /* Flush the dataset for every "chunkplanes_g" planes */ - if(!((i + 1) % (hsize_t)chunkplanes_g)) { - if(H5Dflush(dsid) < 0) { - fprintf(stderr, "Failed to H5Dflush dataset\n"); - return -1; - } - } + } + + /* Flush the dataset for every "chunkplanes_g" planes */ + if(!((i + 1) % (hsize_t)chunkplanes_g)) { + if(H5Dflush(dsid) < 0) { + HDfprintf(stderr, "Failed to H5Dflush dataset\n"); + return -1; + } + } } if(H5Dflush(dsid) < 0) { - fprintf(stderr, "Failed to H5Dflush dataset\n"); - return -1; + HDfprintf(stderr, "Failed to H5Dflush dataset\n"); + return -1; } /* Enable mdc flushes for the dataset */ /* Closing the dataset later will enable mdc flushes automatically if this is not done */ if(disabled) - if(H5Oenable_mdc_flushes(dsid) < 0) { - fprintf(stderr, "Failed to H5Oenable_mdc_flushes\n"); - return -1; - } + if(H5Oenable_mdc_flushes(dsid) < 0) { + HDfprintf(stderr, "Failed to H5Oenable_mdc_flushes\n"); + return -1; + } /* Done writing. Free/Close all resources including data file */ HDfree(buffer); if(H5Dclose(dsid) < 0){ - fprintf(stderr, "Failed to close datasete\n"); - return -1; + HDfprintf(stderr, "Failed to close datasete\n"); + return -1; } if(H5Sclose(m_sid) < 0){ - fprintf(stderr, "Failed to close memory space\n"); - return -1; + HDfprintf(stderr, "Failed to close memory space\n"); + return -1; } if(H5Sclose(f_sid) < 0){ - fprintf(stderr, "Failed to close file space\n"); - return -1; + HDfprintf(stderr, "Failed to close file space\n"); + return -1; } if(H5Pclose(fapl) < 0){ - fprintf(stderr, "Failed to property list\n"); - return -1; + HDfprintf(stderr, "Failed to property list\n"); + return -1; } if(H5Fclose(fid) < 0){ - fprintf(stderr, "Failed to close file id\n"); - return -1; + HDfprintf(stderr, "Failed to close file id\n"); + return -1; } return 0; @@ -493,7 +493,7 @@ write_file(void) -/* Overall Algorithm: +/* Overall Algorithm: * Parse options from user; * Generate/pre-created test files needed and close it; * Write to the file. @@ -505,31 +505,31 @@ main(int argc, char *argv[]) /* initialization */ if(setup_parameters(argc, argv) < 0) - Hgoto_error(1); + Hgoto_error(1); /* ============*/ /* Create file */ /* ============*/ - printf("Creating skeleton data file for testing H5Odisable_mdc_flushes()...\n"); + HDprintf("Creating skeleton data file for testing H5Odisable_mdc_flushes()...\n"); if(create_file() < 0) { - fprintf(stderr, "***encounter error\n"); - Hgoto_error(1); + HDfprintf(stderr, "***encounter error\n"); + Hgoto_error(1); } /* end if */ else - printf("File created.\n"); + HDprintf("File created.\n"); - printf("writing to the file\n"); + HDprintf("writing to the file\n"); if(write_file() < 0) { - fprintf(stderr, "write_file encountered error\n"); - Hgoto_error(1); + HDfprintf(stderr, "write_file encountered error\n"); + Hgoto_error(1); } done: /* Print result and exit */ if(ret_value != 0) - printf("Error(s) encountered\n"); + HDprintf("Error(s) encountered\n"); else - printf("All passed\n"); + HDprintf("All passed\n"); return(ret_value); } @@ -540,7 +540,7 @@ int main(void) { HDfprintf(stderr, "Non-POSIX platform. Skipping.\n"); - return EXIT_SUCCESS; + HDexit(EXIT_SUCCESS); } /* end main() */ #endif /* H5_HAVE_FORK */ @@ -55,7 +55,7 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 -#define TMPDIR "tmp/" +#define TMPDIR "tmp_vds/" /*------------------------------------------------------------------------- diff --git a/test/vds_env.c b/test/vds_env.c index b2ca9d0..19b2d96 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -34,7 +34,7 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 -#define TMPDIR "tmp/" +#define TMPDIR "tmp_vds_env/" /*------------------------------------------------------------------------- * Function: test_vds_prefix_second @@ -58,6 +58,7 @@ const char *FILENAME[] = { "stdio_file", /*7*/ "windows_file", /*8*/ "new_multi_file_v16",/*9*/ + "ro_s3_file", /*10*/ NULL }; @@ -66,7 +67,7 @@ const char *FILENAME[] = { #define COMPAT_BASENAME "family_v16_" #define MULTI_COMPAT_BASENAME "multi_file_v16" - + /*------------------------------------------------------------------------- * Function: test_sec2 * @@ -178,7 +179,7 @@ error: return -1; } /* end test_sec2() */ - + /*------------------------------------------------------------------------- * Function: test_core * @@ -534,7 +535,7 @@ error: return -1; } /* end test_core() */ - + /*------------------------------------------------------------------------- * Function: test_direct * @@ -754,7 +755,7 @@ error: #endif /*H5_HAVE_DIRECT*/ } - + /*------------------------------------------------------------------------- * Function: test_family_opens * @@ -835,7 +836,7 @@ error: } /* end test_family_opens() */ #pragma GCC diagnostic pop - + /*------------------------------------------------------------------------- * Function: test_family * @@ -1017,7 +1018,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_family_compat * @@ -1129,7 +1130,7 @@ error: } /* end test_family_compat() */ #pragma GCC diagnostic pop - + /*------------------------------------------------------------------------- * Function: test_family_member_fapl * @@ -1302,7 +1303,7 @@ test_multi_opens(char *fname) } /* end test_multi_opens() */ #pragma GCC diagnostic pop - + /*------------------------------------------------------------------------- * Function: test_multi * @@ -1536,7 +1537,7 @@ error: return FAIL; } /* end test_multi() */ - + /*------------------------------------------------------------------------- * Function: test_multi_compat * @@ -1710,7 +1711,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_log * @@ -1821,7 +1822,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_stdio * @@ -1926,7 +1927,7 @@ error: } - + /*------------------------------------------------------------------------- * Function: test_windows * @@ -2048,7 +2049,104 @@ error: } /* end test_windows() */ - +/*------------------------------------------------------------------------- + * Function: test_ros3 + * + * Purpose: Tests the file handle interface for the ROS3 driver + * + * As the ROS3 driver is 1) read only, 2) requires access + * to an S3 server (minio for now), this test is quite + * different from the other tests. + * + * For now, test only fapl & flags. Extend as the + * work on the VFD continues. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: John Mainzer + * 7/12/17 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_ros3(void) +{ +#ifdef H5_HAVE_ROS3_VFD + hid_t fid = -1; /* file ID */ + hid_t fapl_id = -1; /* file access property list ID */ + hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + char filename[1024]; /* filename */ + void *os_file_handle = NULL; /* OS file handle */ + hsize_t file_size; /* file size */ + H5FD_ros3_fapl_t test_ros3_fa; + H5FD_ros3_fapl_t ros3_fa_0 = + { + /* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION, + /* authenticate = */ FALSE, + /* aws_region = */ "", + /* secret_id = */ "", + /* secret_key = */ "plugh", + }; +#endif /*H5_HAVE_ROS3_VFD */ + + TESTING("Read-only S3 file driver"); + +#ifndef H5_HAVE_ROS3_VFD + SKIPPED(); + return 0; +#else /* H5_HAVE_ROS3_VFD */ + + /* Set property list and file name for ROS3 driver. */ + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; + + if(H5Pset_fapl_ros3(fapl_id, &ros3_fa_0) < 0) + TEST_ERROR; + + /* verify that the ROS3 FAPL entry is set as expected */ + if(H5Pget_fapl_ros3(fapl_id, &test_ros3_fa) < 0) + TEST_ERROR; + + /* need a macro to compare instances of H5FD_ros3_fapl_t */ + if((test_ros3_fa.version != ros3_fa_0.version) || + (test_ros3_fa.authenticate != ros3_fa_0.authenticate) || + (strcmp(test_ros3_fa.aws_region, ros3_fa_0.aws_region) != 0) || + (strcmp(test_ros3_fa.secret_id, ros3_fa_0.secret_id) != 0) || + (strcmp(test_ros3_fa.secret_key, ros3_fa_0.secret_key) != 0)) + TEST_ERROR; + + h5_fixname(FILENAME[10], fapl_id, filename, sizeof(filename)); + + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR; + + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR; + + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) + TEST_ERROR + + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_DATA_SIEVE)) + TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(fapl_id); + H5Pclose(fapl_id_out); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +#endif /* H5_HAVE_ROS3_VFD */ +} /* end test_ros3() */ + /*------------------------------------------------------------------------- * Function: main * @@ -2082,6 +2180,7 @@ main(void) nerrors += test_log() < 0 ? 1 : 0; nerrors += test_stdio() < 0 ? 1 : 0; nerrors += test_windows() < 0 ? 1 : 0; + nerrors += test_ros3() < 0 ? 1 : 0; if(nerrors) { HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", |